@telefonica/mistica 15.9.0 → 15.11.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/boxed.css-mistica.js +35 -2
- package/dist/boxed.css.d.ts +29 -0
- package/dist/boxed.d.ts +6 -4
- package/dist/boxed.js +30 -24
- package/dist/button-group.css-mistica.js +14 -5
- package/dist/button-group.css.d.ts +3 -0
- package/dist/button-group.d.ts +2 -1
- package/dist/button-group.js +29 -16
- package/dist/button-layout.css-mistica.js +7 -7
- package/dist/button-layout.css.d.ts +1 -1
- package/dist/button-layout.js +9 -9
- package/dist/button.d.ts +4 -24
- package/dist/button.js +6 -4
- package/dist/card.d.ts +8 -1
- package/dist/card.js +567 -501
- package/dist/carousel.css-mistica.js +19 -16
- package/dist/carousel.css.d.ts +1 -0
- package/dist/carousel.js +41 -39
- package/dist/chip.js +37 -44
- package/dist/circle.d.ts +11 -4
- package/dist/circle.js +10 -11
- package/dist/community/advanced-data-card.css-mistica.js +24 -21
- package/dist/community/advanced-data-card.css.d.ts +1 -0
- package/dist/community/advanced-data-card.d.ts +1 -0
- package/dist/community/advanced-data-card.js +20 -17
- package/dist/counter.js +26 -22
- package/dist/cover-hero-media.d.ts +12 -0
- package/dist/cover-hero-media.js +44 -0
- package/dist/cover-hero.css-mistica.js +56 -0
- package/dist/cover-hero.css.d.ts +14 -0
- package/dist/cover-hero.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/cover-hero.d.ts +38 -0
- package/dist/cover-hero.js +296 -0
- package/dist/empty-state.js +6 -6
- package/dist/grid-layout.css-mistica.js +11 -8
- package/dist/grid-layout.css.d.ts +1 -0
- package/dist/grid-layout.d.ts +12 -22
- package/dist/grid-layout.js +63 -49
- package/dist/header.js +18 -18
- package/dist/highlighted-card.d.ts +1 -0
- package/dist/highlighted-card.js +22 -18
- package/dist/icon-button.d.ts +7 -6
- package/dist/image.js +69 -48
- package/dist/index.d.ts +4 -1
- package/dist/index.js +15 -0
- package/dist/list.d.ts +1 -0
- package/dist/navigation-bar.d.ts +1 -1
- package/dist/navigation-bar.js +1 -1
- package/dist/package-version.js +1 -1
- package/dist/select.js +16 -12
- package/dist/skins/movistar.d.ts +13 -0
- package/dist/skins/movistar.js +112 -99
- package/dist/spinner.js +19 -18
- package/dist/table.css-mistica.js +58 -0
- package/dist/table.css.d.ts +13 -0
- package/dist/table.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/table.d.ts +39 -0
- package/dist/table.js +269 -0
- package/dist/text.d.ts +1 -1
- package/dist/theme.d.ts +20 -0
- package/dist/theme.js +80 -20
- package/dist/timer.css-mistica.js +39 -0
- package/dist/timer.css.d.ts +8 -0
- package/dist/timer.css.ts.vanilla.css-mistica.js +11 -0
- package/dist/timer.d.ts +27 -0
- package/dist/timer.js +370 -0
- package/dist/tooltip.js +13 -13
- package/dist/touchable.d.ts +2 -0
- package/dist/touchable.js +35 -31
- package/dist/utils/helpers.js +32 -32
- package/dist-es/boxed.css-mistica.js +29 -2
- package/dist-es/boxed.js +37 -31
- package/dist-es/button-group.css-mistica.js +2 -2
- package/dist-es/button-group.js +37 -24
- package/dist-es/button-layout.css-mistica.js +2 -2
- package/dist-es/button-layout.js +16 -16
- package/dist-es/button.js +24 -22
- package/dist-es/card.js +681 -618
- package/dist-es/carousel.css-mistica.js +7 -7
- package/dist-es/carousel.js +75 -73
- package/dist-es/chip.js +57 -64
- package/dist-es/circle.js +15 -16
- package/dist-es/community/advanced-data-card.css-mistica.js +4 -4
- package/dist-es/community/advanced-data-card.js +59 -56
- package/dist-es/counter.js +62 -58
- package/dist-es/cover-hero-media.js +30 -0
- package/dist-es/cover-hero.css-mistica.js +9 -0
- package/dist-es/cover-hero.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/cover-hero.js +241 -0
- package/dist-es/empty-state.js +13 -13
- package/dist-es/grid-layout.css-mistica.js +3 -3
- package/dist-es/grid-layout.js +80 -66
- package/dist-es/header.js +37 -37
- package/dist-es/highlighted-card.js +35 -31
- package/dist-es/image.js +88 -67
- package/dist-es/index.js +1817 -1814
- package/dist-es/navigation-bar.js +1 -1
- package/dist-es/package-version.js +1 -1
- package/dist-es/select.js +23 -18
- package/dist-es/skins/movistar.js +112 -99
- package/dist-es/spinner.js +38 -37
- package/dist-es/style.css +1 -1
- package/dist-es/table.css-mistica.js +14 -0
- package/dist-es/table.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/table.js +214 -0
- package/dist-es/theme.js +77 -17
- package/dist-es/timer.css-mistica.js +4 -0
- package/dist-es/timer.css.ts.vanilla.css-mistica.js +2 -0
- package/dist-es/timer.js +307 -0
- package/dist-es/tooltip.js +16 -16
- package/dist-es/touchable.js +47 -43
- package/dist-es/utils/helpers.js +31 -31
- package/package.json +1 -1
package/dist/utils/helpers.js
CHANGED
|
@@ -10,46 +10,46 @@ function _export(target, all) {
|
|
|
10
10
|
}
|
|
11
11
|
_export(exports, {
|
|
12
12
|
debounce: function() {
|
|
13
|
-
return
|
|
13
|
+
return W;
|
|
14
14
|
},
|
|
15
15
|
isEqual: function() {
|
|
16
|
-
return
|
|
16
|
+
return p;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
|
-
const
|
|
20
|
-
let
|
|
21
|
-
var
|
|
22
|
-
const a =
|
|
23
|
-
let o, d = 0, s = -1, f,
|
|
24
|
-
const
|
|
25
|
-
const u =
|
|
26
|
-
return s < 0 || u >=
|
|
27
|
-
},
|
|
28
|
-
const u =
|
|
19
|
+
const W = function(e, t) {
|
|
20
|
+
let i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
|
|
21
|
+
var _i_leading, _i_trailing;
|
|
22
|
+
const a = t, c = (_i_leading = i.leading) !== null && _i_leading !== void 0 ? _i_leading : !1, y = (_i_trailing = i.trailing) !== null && _i_trailing !== void 0 ? _i_trailing : !0, l = i.maxWait !== void 0 ? Math.max(i.maxWait, a) : void 0;
|
|
23
|
+
let o, d = 0, s = -1, f, r;
|
|
24
|
+
const g = (n)=>(d = n, o && (f = e(...o)), o = void 0, f), T = (n)=>{
|
|
25
|
+
const u = n - s, m = n - d;
|
|
26
|
+
return s < 0 || u >= t || u < 0 || l !== void 0 && m >= l;
|
|
27
|
+
}, x = (n)=>{
|
|
28
|
+
const u = n - s, m = n - d, h = t - u;
|
|
29
29
|
return l !== void 0 ? Math.min(h, l - m) : h;
|
|
30
|
-
}, k = (
|
|
31
|
-
const
|
|
32
|
-
if (T(
|
|
33
|
-
|
|
34
|
-
},
|
|
35
|
-
for(var _len = arguments.length,
|
|
36
|
-
|
|
30
|
+
}, k = (n)=>(r = void 0, y && o ? g(n) : (o = void 0, f)), v = ()=>{
|
|
31
|
+
const n = Date.now();
|
|
32
|
+
if (T(n)) return k(n);
|
|
33
|
+
r = setTimeout(v, x(n));
|
|
34
|
+
}, I = (n)=>(d = n, r = setTimeout(v, a), c ? g(n) : f), A = function() {
|
|
35
|
+
for(var _len = arguments.length, n = new Array(_len), _key = 0; _key < _len; _key++){
|
|
36
|
+
n[_key] = arguments[_key];
|
|
37
37
|
}
|
|
38
38
|
const u = Date.now(), m = T(u);
|
|
39
|
-
if (o =
|
|
40
|
-
if (
|
|
41
|
-
if (l !== void 0) return
|
|
39
|
+
if (o = n, s = u, m) {
|
|
40
|
+
if (r === void 0) return I(s);
|
|
41
|
+
if (l !== void 0) return r = setTimeout(v, a), g(s);
|
|
42
42
|
}
|
|
43
|
-
return
|
|
43
|
+
return r === void 0 && (r = setTimeout(v, a)), f;
|
|
44
44
|
};
|
|
45
45
|
return A.cancel = ()=>{
|
|
46
|
-
|
|
47
|
-
}, A.flush = ()=>
|
|
48
|
-
}, D = (e)=>e === null ? !0 : !(typeof e == "object" || typeof e == "function"),
|
|
49
|
-
if (e ===
|
|
50
|
-
if (D(e) || D(
|
|
51
|
-
if (Array.isArray(e) || Array.isArray(
|
|
52
|
-
if (e instanceof Date ||
|
|
53
|
-
const
|
|
54
|
-
return
|
|
46
|
+
r !== void 0 && (clearTimeout(r), r = void 0), d = 0, s = -1, o = void 0;
|
|
47
|
+
}, A.flush = ()=>r === void 0 ? f : k(Date.now()), A;
|
|
48
|
+
}, D = (e)=>e === null ? !0 : !(typeof e == "object" || typeof e == "function"), p = (e, t)=>{
|
|
49
|
+
if (e === t || typeof e == "number" && typeof t == "number" && isNaN(e) && isNaN(t)) return !0;
|
|
50
|
+
if (D(e) || D(t) || typeof e != typeof t || typeof e == "function") return !1;
|
|
51
|
+
if (Array.isArray(e) || Array.isArray(t)) return Array.isArray(e) && Array.isArray(t) ? e.length === t.length && e.every((c, y)=>p(c, t[y])) : !1;
|
|
52
|
+
if (e instanceof Date || t instanceof Date) return e instanceof Date && t instanceof Date ? e.getTime() === t.getTime() : !1;
|
|
53
|
+
const i = Object.keys(e), a = Object.keys(t);
|
|
54
|
+
return i.length === a.length ? i.every((c)=>p(e[c], t[c])) : !1;
|
|
55
55
|
};
|
|
@@ -1,4 +1,31 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
2
|
import "./boxed.css.ts.vanilla.css-mistica.js";
|
|
3
|
-
var e = "_1y2v1nfk1",
|
|
4
|
-
|
|
3
|
+
var e = "_1y2v1nfk1", a = "ihbkeqk", r = "ihbkeqm", b = {
|
|
4
|
+
width: "var(--ihbkeq0)",
|
|
5
|
+
height: "var(--ihbkeq1)",
|
|
6
|
+
minHeight: "var(--ihbkeq2)",
|
|
7
|
+
maxWidth: "var(--ihbkeq3)",
|
|
8
|
+
minWidth: "var(--ihbkeq4)",
|
|
9
|
+
mobile: {
|
|
10
|
+
width: "var(--ihbkeq5)",
|
|
11
|
+
height: "var(--ihbkeq6)",
|
|
12
|
+
minHeight: "var(--ihbkeq7)",
|
|
13
|
+
maxWidth: "var(--ihbkeq8)",
|
|
14
|
+
minWidth: "var(--ihbkeq9)"
|
|
15
|
+
},
|
|
16
|
+
tablet: {
|
|
17
|
+
width: "var(--ihbkeqa)",
|
|
18
|
+
height: "var(--ihbkeqb)",
|
|
19
|
+
minHeight: "var(--ihbkeqc)",
|
|
20
|
+
maxWidth: "var(--ihbkeqd)",
|
|
21
|
+
minWidth: "var(--ihbkeqe)"
|
|
22
|
+
},
|
|
23
|
+
desktop: {
|
|
24
|
+
width: "var(--ihbkeqf)",
|
|
25
|
+
height: "var(--ihbkeqg)",
|
|
26
|
+
minHeight: "var(--ihbkeqh)",
|
|
27
|
+
maxWidth: "var(--ihbkeqi)",
|
|
28
|
+
minWidth: "var(--ihbkeqj)"
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
export { e as boxBorder, a as boxed, r as desktopOnly, b as vars };
|
package/dist-es/boxed.js
CHANGED
|
@@ -52,44 +52,50 @@ function _object_spread_props(target, source) {
|
|
|
52
52
|
return target;
|
|
53
53
|
}
|
|
54
54
|
import { jsx as a } from "react/jsx-runtime";
|
|
55
|
-
import * as
|
|
56
|
-
import
|
|
57
|
-
import { useIsInverseVariant as
|
|
58
|
-
import { getPrefixedDataAttributes as
|
|
59
|
-
import { vars as
|
|
60
|
-
import { desktopOnly as
|
|
61
|
-
import { sprinkles as
|
|
62
|
-
|
|
55
|
+
import * as f from "react";
|
|
56
|
+
import O from "classnames";
|
|
57
|
+
import { useIsInverseVariant as R, ThemeVariant as V } from "./theme-variant-context.js";
|
|
58
|
+
import { getPrefixedDataAttributes as I } from "./utils/dom.js";
|
|
59
|
+
import { vars as n } from "./skins/skin-contract.css-mistica.js";
|
|
60
|
+
import { boxed as D, desktopOnly as W, boxBorder as $, vars as i } from "./boxed.css-mistica.js";
|
|
61
|
+
import { sprinkles as l } from "./sprinkles.css-mistica.js";
|
|
62
|
+
import { applyCssVars as j } from "./utils/css.js";
|
|
63
|
+
const z = (o, r)=>o || r ? l({
|
|
63
64
|
border: "none"
|
|
64
|
-
}) :
|
|
65
|
-
|
|
66
|
-
|
|
65
|
+
}) : $, s = (o)=>typeof o == "number" ? `${o}px` : o !== null && o !== void 0 ? o : "initial", e = (o, r)=>{
|
|
66
|
+
if (typeof r == "number" || typeof r == "string" || typeof r > "u") return {
|
|
67
|
+
[i[o]]: s(r)
|
|
68
|
+
};
|
|
69
|
+
const t = {
|
|
70
|
+
[i.mobile[o]]: s(r.mobile),
|
|
71
|
+
[i.desktop[o]]: s(r.desktop)
|
|
72
|
+
};
|
|
73
|
+
return r.tablet && (t[i.tablet[o]] = s(r.tablet)), t;
|
|
74
|
+
}, A = /*#__PURE__*/ f.forwardRef((param, w)=>{
|
|
75
|
+
let { children: o, isInverse: r = !1, className: t, role: p, dataAttributes: b, "aria-label": c, "aria-labelledby": y, width: h, maxWidth: x, minWidth: g, height: k, minHeight: u, borderRadius: B = n.borderRadii.container, background: d, desktopOnly: C } = param;
|
|
76
|
+
const m = R();
|
|
67
77
|
return /* @__PURE__ */ a("div", _object_spread_props(_object_spread({
|
|
68
|
-
ref:
|
|
69
|
-
style: {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
background: t
|
|
75
|
-
},
|
|
76
|
-
className: k(l, w(n, r), s({
|
|
77
|
-
borderRadius: x,
|
|
78
|
+
ref: w,
|
|
79
|
+
style: _object_spread_props(_object_spread({}, j(_object_spread({}, e("width", h), e("maxWidth", x), e("minWidth", g), e("height", k), e("minHeight", u)))), {
|
|
80
|
+
background: d
|
|
81
|
+
}),
|
|
82
|
+
className: O(t, D, z(m, r), l({
|
|
83
|
+
borderRadius: B,
|
|
78
84
|
overflow: "hidden",
|
|
79
|
-
background: (
|
|
85
|
+
background: (d !== null && d !== void 0 ? d : r) ? m ? n.colors.backgroundContainerBrandOverInverse : n.colors.backgroundContainerBrand : n.colors.backgroundContainer
|
|
80
86
|
}), {
|
|
81
|
-
[
|
|
87
|
+
[W]: C
|
|
82
88
|
}),
|
|
83
|
-
role:
|
|
84
|
-
"aria-label":
|
|
85
|
-
"aria-labelledby":
|
|
86
|
-
},
|
|
87
|
-
children: /* @__PURE__ */ a(
|
|
89
|
+
role: p,
|
|
90
|
+
"aria-label": c,
|
|
91
|
+
"aria-labelledby": y
|
|
92
|
+
}, I(b)), {
|
|
93
|
+
children: /* @__PURE__ */ a(V, {
|
|
88
94
|
isInverse: r,
|
|
89
|
-
children:
|
|
95
|
+
children: o
|
|
90
96
|
})
|
|
91
97
|
}));
|
|
92
|
-
}),
|
|
98
|
+
}), J = /*#__PURE__*/ f.forwardRef((o, r)=>/* @__PURE__ */ a(A, _object_spread_props(_object_spread({}, o), {
|
|
93
99
|
ref: r
|
|
94
100
|
})));
|
|
95
|
-
export {
|
|
101
|
+
export { J as Boxed, A as InternalBoxed };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
2
|
import "./button-group.css.ts.vanilla.css-mistica.js";
|
|
3
|
-
var
|
|
4
|
-
export {
|
|
3
|
+
var r = "_1xdd1h67", t = "_1xdd1h66", e = "_1xdd1h64", h = "_1xdd1h62", v = "_1xdd1h63", _ = "_1xdd1h65", a = "_1xdd1h61 _1y2v1nfhl _1y2v1nfhz _1y2v1nfhp";
|
|
4
|
+
export { r as buttonChild, t as buttons, e as centerInDesktop, h as centerInMobile, v as centerInTablet, _ as container, a as inline };
|
package/dist-es/button-group.js
CHANGED
|
@@ -50,38 +50,51 @@ function _object_spread_props(target, source) {
|
|
|
50
50
|
}
|
|
51
51
|
return target;
|
|
52
52
|
}
|
|
53
|
-
import { jsxs as
|
|
54
|
-
import
|
|
55
|
-
import { getPrefixedDataAttributes as
|
|
56
|
-
import { inline as
|
|
57
|
-
const
|
|
58
|
-
let { primaryButton:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
import { jsxs as r, jsx as c } from "react/jsx-runtime";
|
|
54
|
+
import n from "classnames";
|
|
55
|
+
import { getPrefixedDataAttributes as f } from "./utils/dom.js";
|
|
56
|
+
import { inline as b, container as p, centerInDesktop as h, centerInTablet as u, centerInMobile as v, buttons as N, buttonChild as i } from "./button-group.css-mistica.js";
|
|
57
|
+
const k = (param)=>{
|
|
58
|
+
let { primaryButton: t, secondaryButton: o, link: s, align: e = "left", dataAttributes: m } = param;
|
|
59
|
+
var _e_mobile, _e_tablet, _ref, _e_desktop;
|
|
60
|
+
const d = !!t || !!o || !!s, a = !!t && !!o, l = typeof e == "string" ? {
|
|
61
|
+
mobile: e,
|
|
62
|
+
tablet: e,
|
|
63
|
+
desktop: e
|
|
64
|
+
} : {
|
|
65
|
+
mobile: (_e_mobile = e.mobile) !== null && _e_mobile !== void 0 ? _e_mobile : "left",
|
|
66
|
+
tablet: (_ref = (_e_tablet = e.tablet) !== null && _e_tablet !== void 0 ? _e_tablet : e.mobile) !== null && _ref !== void 0 ? _ref : "left",
|
|
67
|
+
desktop: (_e_desktop = e.desktop) !== null && _e_desktop !== void 0 ? _e_desktop : "left"
|
|
68
|
+
};
|
|
69
|
+
return d ? /* @__PURE__ */ r("div", _object_spread_props(_object_spread({
|
|
70
|
+
className: n(b, p, {
|
|
71
|
+
[h]: l.desktop === "center",
|
|
72
|
+
[u]: l.tablet === "center",
|
|
73
|
+
[v]: l.mobile === "center"
|
|
74
|
+
})
|
|
75
|
+
}, f(m, "ButtonGroup")), {
|
|
63
76
|
children: [
|
|
64
|
-
(
|
|
65
|
-
className:
|
|
77
|
+
(t || o) && /* @__PURE__ */ r("div", {
|
|
78
|
+
className: n(b, N),
|
|
66
79
|
children: [
|
|
67
|
-
|
|
68
|
-
className:
|
|
69
|
-
children: s
|
|
70
|
-
}),
|
|
71
|
-
t && /* @__PURE__ */ i("div", {
|
|
72
|
-
className: l,
|
|
80
|
+
t && /* @__PURE__ */ c("div", {
|
|
81
|
+
className: i,
|
|
73
82
|
children: t
|
|
83
|
+
}),
|
|
84
|
+
o && /* @__PURE__ */ c("div", {
|
|
85
|
+
className: i,
|
|
86
|
+
children: o
|
|
74
87
|
})
|
|
75
88
|
]
|
|
76
89
|
}),
|
|
77
|
-
|
|
78
|
-
className:
|
|
90
|
+
s && /* @__PURE__ */ c("div", {
|
|
91
|
+
className: i,
|
|
79
92
|
style: {
|
|
80
|
-
width:
|
|
93
|
+
width: a ? "100%" : "auto"
|
|
81
94
|
},
|
|
82
|
-
children:
|
|
95
|
+
children: s
|
|
83
96
|
})
|
|
84
97
|
]
|
|
85
98
|
})) : null;
|
|
86
|
-
},
|
|
87
|
-
export {
|
|
99
|
+
}, A = k;
|
|
100
|
+
export { A as default };
|
|
@@ -6,5 +6,5 @@ var y = {
|
|
|
6
6
|
left: "kfxylh9 _1y2v1nfhs",
|
|
7
7
|
center: "kfxylha _1y2v1nfht",
|
|
8
8
|
"full-width": "kfxylhb _1y2v1nfht"
|
|
9
|
-
},
|
|
10
|
-
export { y as alignVariant,
|
|
9
|
+
}, l = "kfxylh2 _1y2v1nfhk _1y2v1nfhz", i = "kfxylh3", k = "kfxylhe kfxylhd _1y2v1nfhk _1y2v1nfi7", r = "kfxylhf kfxylhd _1y2v1nfhk _1y2v1nfi7", t = "kfxylh0";
|
|
10
|
+
export { y as alignVariant, l as container, i as containerWithTwoButtons, k as link, r as linkInNewLine, t as margins };
|
package/dist-es/button-layout.js
CHANGED
|
@@ -53,20 +53,20 @@ function _object_spread_props(target, source) {
|
|
|
53
53
|
}
|
|
54
54
|
import { jsx as a, jsxs as n, Fragment as o } from "react/jsx-runtime";
|
|
55
55
|
import * as y from "react";
|
|
56
|
-
import { ButtonPrimary as
|
|
56
|
+
import { ButtonPrimary as L, ButtonDanger as N, ButtonSecondary as v } from "./button.js";
|
|
57
57
|
import g from "classnames";
|
|
58
|
-
import { getPrefixedDataAttributes as
|
|
59
|
-
import {
|
|
58
|
+
import { getPrefixedDataAttributes as w } from "./utils/dom.js";
|
|
59
|
+
import { linkInNewLine as O, link as j, container as A, alignVariant as C, containerWithTwoButtons as D, margins as P } from "./button-layout.css-mistica.js";
|
|
60
60
|
const p = [
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
L,
|
|
62
|
+
N,
|
|
63
|
+
v
|
|
64
64
|
], R = (param)=>{
|
|
65
65
|
let { children: r, primaryButton: e, secondaryButton: s, align: t = "full-width", link: c, withMargins: x = !1, dataAttributes: B } = param;
|
|
66
66
|
const l = y.Children.toArray(r).sort((b, k)=>{
|
|
67
67
|
const f = p.indexOf(b.type), h = p.indexOf(k.type);
|
|
68
68
|
return t === "right" ? h - f : f - h;
|
|
69
|
-
}), i = r ? l.length : (e ? 1 : 0) + (s ? 1 : 0),
|
|
69
|
+
}), i = r ? l.length : (e ? 1 : 0) + (s ? 1 : 0), m = r ? l : t === "right" ? /* @__PURE__ */ n(o, {
|
|
70
70
|
children: [
|
|
71
71
|
s,
|
|
72
72
|
e
|
|
@@ -76,24 +76,24 @@ const p = [
|
|
|
76
76
|
e,
|
|
77
77
|
s
|
|
78
78
|
]
|
|
79
|
-
}),
|
|
80
|
-
className: g(i
|
|
79
|
+
}), u = c ? /* @__PURE__ */ a("div", {
|
|
80
|
+
className: g(i !== 1 ? O : j),
|
|
81
81
|
"data-link": "true",
|
|
82
82
|
children: c
|
|
83
83
|
}) : null, d = /* @__PURE__ */ a("div", _object_spread_props(_object_spread({
|
|
84
84
|
className: g(A, C[t], {
|
|
85
85
|
[D]: i > 1
|
|
86
86
|
})
|
|
87
|
-
},
|
|
87
|
+
}, w(B, "ButtonLayout")), {
|
|
88
88
|
children: t !== "right" || i > 1 ? /* @__PURE__ */ n(o, {
|
|
89
89
|
children: [
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
m,
|
|
91
|
+
u
|
|
92
92
|
]
|
|
93
93
|
}) : /* @__PURE__ */ n(o, {
|
|
94
94
|
children: [
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
u,
|
|
96
|
+
m
|
|
97
97
|
]
|
|
98
98
|
})
|
|
99
99
|
}));
|
|
@@ -101,5 +101,5 @@ const p = [
|
|
|
101
101
|
className: P,
|
|
102
102
|
children: d
|
|
103
103
|
}) : d;
|
|
104
|
-
},
|
|
105
|
-
export {
|
|
104
|
+
}, W = R;
|
|
105
|
+
export { W as default };
|
package/dist-es/button.js
CHANGED
|
@@ -85,14 +85,14 @@ import K from "./spinner.js";
|
|
|
85
85
|
import { BaseTouchable as g } from "./touchable.js";
|
|
86
86
|
import { useIsInverseVariant as O } from "./theme-variant-context.js";
|
|
87
87
|
import { useForm as V } from "./form-context.js";
|
|
88
|
-
import { pxToRem as
|
|
88
|
+
import { pxToRem as w } from "./utils/css.js";
|
|
89
89
|
import { Text as j, Text3 as H, Text2 as Y } from "./text.js";
|
|
90
90
|
import $ from "./box.js";
|
|
91
|
-
import { getTextFromChildren as
|
|
91
|
+
import { getTextFromChildren as P } from "./utils/common.js";
|
|
92
92
|
import { useTrackingConfig as F, eventNames as z, eventCategories as M, eventActions as q } from "./utils/analytics.js";
|
|
93
|
-
import { useTheme as
|
|
93
|
+
import { useTheme as S } from "./hooks.js";
|
|
94
94
|
import { flattenChildren as J } from "./skins/utils.js";
|
|
95
|
-
import { inverseButtonVariants as Q, buttonVariants as U, small as p, isLoading as G, textContent as ee, inverseLinkVariants as te, linkVariants as ne, PADDING_X_LINK as
|
|
95
|
+
import { inverseButtonVariants as Q, buttonVariants as U, small as p, isLoading as G, textContent as ee, inverseLinkVariants as te, linkVariants as ne, PADDING_X_LINK as T, PADDING_Y_LINK as A, textContentLink as ie, SMALL_SPINNER_SIZE as re, SPINNER_SIZE as ae, ICON_MARGIN_PX as C, CHEVRON_MARGIN_LEFT_LINK as oe, loadingFiller as le, X_SMALL_PADDING_PX as se, X_PADDING_PX as ce, loadingContent as de, SMALL_ICON_SIZE as ue, ICON_SIZE as me } from "./button.css-mistica.js";
|
|
96
96
|
import { VIVO_NEW_SKIN as fe } from "./skins/constants.js";
|
|
97
97
|
const k = (param)=>{
|
|
98
98
|
let { content: e, defaultIconSize: t, renderText: i } = param;
|
|
@@ -117,13 +117,13 @@ const k = (param)=>{
|
|
|
117
117
|
marginRight: o ? 0 : C
|
|
118
118
|
},
|
|
119
119
|
children: /*#__PURE__*/ a.cloneElement(d, {
|
|
120
|
-
size:
|
|
120
|
+
size: w(v)
|
|
121
121
|
})
|
|
122
122
|
}, c.length));
|
|
123
123
|
} else s.push(d), o && f();
|
|
124
124
|
}), c;
|
|
125
125
|
}, he = ()=>{
|
|
126
|
-
const { skinName: e } =
|
|
126
|
+
const { skinName: e } = S();
|
|
127
127
|
return e === fe ? /* @__PURE__ */ n("svg", {
|
|
128
128
|
width: "0.5em",
|
|
129
129
|
height: "0.5em",
|
|
@@ -144,7 +144,7 @@ const k = (param)=>{
|
|
|
144
144
|
});
|
|
145
145
|
}, X = (param)=>{
|
|
146
146
|
let { showSpinner: e, children: t, small: i, loadingText: l, shouldRenderSpinner: u, setShouldRenderSpinner: c, renderText: s, textContentStyle: f, StartIcon: d, EndIcon: m, withChevron: h } = param;
|
|
147
|
-
const o = i ? ue : me, r =
|
|
147
|
+
const o = i ? ue : me, r = w(i ? re : ae);
|
|
148
148
|
return /* @__PURE__ */ E(W, {
|
|
149
149
|
children: [
|
|
150
150
|
/* @__PURE__ */ E("div", {
|
|
@@ -158,7 +158,7 @@ const k = (param)=>{
|
|
|
158
158
|
marginRight: C
|
|
159
159
|
},
|
|
160
160
|
children: /* @__PURE__ */ n(d, {
|
|
161
|
-
size:
|
|
161
|
+
size: w(o),
|
|
162
162
|
color: "currentColor"
|
|
163
163
|
})
|
|
164
164
|
}),
|
|
@@ -190,7 +190,7 @@ const k = (param)=>{
|
|
|
190
190
|
marginLeft: C
|
|
191
191
|
},
|
|
192
192
|
children: /* @__PURE__ */ n(m, {
|
|
193
|
-
size:
|
|
193
|
+
size: w(o),
|
|
194
194
|
color: "currentColor"
|
|
195
195
|
})
|
|
196
196
|
})
|
|
@@ -241,7 +241,7 @@ const k = (param)=>{
|
|
|
241
241
|
]
|
|
242
242
|
});
|
|
243
243
|
}, R = /*#__PURE__*/ a.forwardRef((e, t)=>{
|
|
244
|
-
const { textPresets: i } =
|
|
244
|
+
const { textPresets: i } = S(), { eventFormat: l } = F(), { formStatus: u, formId: c } = V(), s = O(), { loadingText: f } = e, d = !!e.submit, m = u === "sending", [h, o] = a.useState(!1), r = e.showSpinner || m && d || h, [v, L] = a.useState(!!r);
|
|
245
245
|
a.useEffect(()=>{
|
|
246
246
|
r && !v && L(!0);
|
|
247
247
|
}, [
|
|
@@ -253,11 +253,11 @@ const k = (param)=>{
|
|
|
253
253
|
const N = ()=>l === "google-analytics-4" ? {
|
|
254
254
|
name: z.userInteraction,
|
|
255
255
|
component_type: `${e.type}_button`,
|
|
256
|
-
component_copy:
|
|
256
|
+
component_copy: P(e.children)
|
|
257
257
|
} : {
|
|
258
258
|
category: M.userInteraction,
|
|
259
259
|
action: `${e.type}_button_tapped`,
|
|
260
|
-
label:
|
|
260
|
+
label: P(e.children)
|
|
261
261
|
}, _ = (I)=>e.small ? /* @__PURE__ */ n(j, {
|
|
262
262
|
size: 14,
|
|
263
263
|
lineHeight: 20,
|
|
@@ -323,6 +323,7 @@ const k = (param)=>{
|
|
|
323
323
|
}));
|
|
324
324
|
if (e.to || e.to === "") return /* @__PURE__ */ n(g, _object_spread_props(_object_spread({}, b), {
|
|
325
325
|
to: e.to,
|
|
326
|
+
newTab: e.newTab,
|
|
326
327
|
fullPageOnWebView: e.fullPageOnWebView,
|
|
327
328
|
onNavigate: e.onNavigate
|
|
328
329
|
}));
|
|
@@ -339,7 +340,7 @@ const k = (param)=>{
|
|
|
339
340
|
"type"
|
|
340
341
|
]);
|
|
341
342
|
var _t_withChevron;
|
|
342
|
-
const { formStatus: l } = V(), u = O(), { textPresets: c } =
|
|
343
|
+
const { formStatus: l } = V(), u = O(), { textPresets: c } = S(), { eventFormat: s } = F(), { isDarkMode: f } = S(), { loadingText: d } = t, m = l === "sending", [h, o] = a.useState(!1), r = t.showSpinner || h, v = (_t_withChevron = t.withChevron) !== null && _t_withChevron !== void 0 ? _t_withChevron : !!t.href || !!t.to, [L, N] = a.useState(!!r);
|
|
343
344
|
a.useEffect(()=>{
|
|
344
345
|
r && !L && N(!0);
|
|
345
346
|
}, [
|
|
@@ -351,11 +352,11 @@ const k = (param)=>{
|
|
|
351
352
|
const _ = ()=>s === "google-analytics-4" ? {
|
|
352
353
|
name: z.userInteraction,
|
|
353
354
|
component_type: e === "danger" ? "danger_link" : "link",
|
|
354
|
-
component_copy:
|
|
355
|
+
component_copy: P(t.children)
|
|
355
356
|
} : {
|
|
356
357
|
category: M.userInteraction,
|
|
357
358
|
action: q.linkTapped,
|
|
358
|
-
label:
|
|
359
|
+
label: P(t.children)
|
|
359
360
|
}, b = (x)=>/* @__PURE__ */ n(Y, {
|
|
360
361
|
weight: c.button.weight,
|
|
361
362
|
truncate: 1,
|
|
@@ -369,12 +370,12 @@ const k = (param)=>{
|
|
|
369
370
|
* Setting bleed classes with style to override the margin:0 set by the Touchable component.
|
|
370
371
|
* If we set it using className, it may not work depending on the order in which the styles are applied.
|
|
371
372
|
*/ style: _object_spread({}, t.bleedLeft ? {
|
|
372
|
-
marginLeft: -
|
|
373
|
+
marginLeft: -T
|
|
373
374
|
} : void 0, t.bleedRight ? {
|
|
374
|
-
marginRight: -
|
|
375
|
+
marginRight: -T
|
|
375
376
|
} : void 0, t.bleedY ? {
|
|
376
|
-
marginTop: -
|
|
377
|
-
marginBottom: -
|
|
377
|
+
marginTop: -A,
|
|
378
|
+
marginBottom: -A
|
|
378
379
|
} : void 0),
|
|
379
380
|
trackingEvent: (_t_trackingEvent = t.trackingEvent) !== null && _t_trackingEvent !== void 0 ? _t_trackingEvent : t.trackEvent ? _() : void 0,
|
|
380
381
|
dataAttributes: t.dataAttributes,
|
|
@@ -411,6 +412,7 @@ const k = (param)=>{
|
|
|
411
412
|
ref: i
|
|
412
413
|
}, y), {
|
|
413
414
|
to: t.to,
|
|
415
|
+
newTab: t.newTab,
|
|
414
416
|
fullPageOnWebView: t.fullPageOnWebView,
|
|
415
417
|
onNavigate: t.onNavigate
|
|
416
418
|
}));
|
|
@@ -448,7 +450,7 @@ const k = (param)=>{
|
|
|
448
450
|
ref: i,
|
|
449
451
|
type: "danger"
|
|
450
452
|
}));
|
|
451
|
-
}),
|
|
453
|
+
}), Te = /*#__PURE__*/ a.forwardRef((_param, i)=>{
|
|
452
454
|
var { dataAttributes: e } = _param, t = _object_without_properties(_param, [
|
|
453
455
|
"dataAttributes"
|
|
454
456
|
]);
|
|
@@ -460,7 +462,7 @@ const k = (param)=>{
|
|
|
460
462
|
ref: i,
|
|
461
463
|
type: "primary"
|
|
462
464
|
}));
|
|
463
|
-
}),
|
|
465
|
+
}), Ae = /*#__PURE__*/ a.forwardRef((_param, i)=>{
|
|
464
466
|
var { dataAttributes: e } = _param, t = _object_without_properties(_param, [
|
|
465
467
|
"dataAttributes"
|
|
466
468
|
]);
|
|
@@ -485,4 +487,4 @@ const k = (param)=>{
|
|
|
485
487
|
type: "danger"
|
|
486
488
|
}));
|
|
487
489
|
});
|
|
488
|
-
export { De as ButtonDanger, Re as ButtonLink, Be as ButtonLinkDanger,
|
|
490
|
+
export { De as ButtonDanger, Re as ButtonLink, Be as ButtonLinkDanger, Te as ButtonPrimary, Ae as ButtonSecondary };
|