@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.
Files changed (114) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/boxed.css-mistica.js +35 -2
  3. package/dist/boxed.css.d.ts +29 -0
  4. package/dist/boxed.d.ts +6 -4
  5. package/dist/boxed.js +30 -24
  6. package/dist/button-group.css-mistica.js +14 -5
  7. package/dist/button-group.css.d.ts +3 -0
  8. package/dist/button-group.d.ts +2 -1
  9. package/dist/button-group.js +29 -16
  10. package/dist/button-layout.css-mistica.js +7 -7
  11. package/dist/button-layout.css.d.ts +1 -1
  12. package/dist/button-layout.js +9 -9
  13. package/dist/button.d.ts +4 -24
  14. package/dist/button.js +6 -4
  15. package/dist/card.d.ts +8 -1
  16. package/dist/card.js +567 -501
  17. package/dist/carousel.css-mistica.js +19 -16
  18. package/dist/carousel.css.d.ts +1 -0
  19. package/dist/carousel.js +41 -39
  20. package/dist/chip.js +37 -44
  21. package/dist/circle.d.ts +11 -4
  22. package/dist/circle.js +10 -11
  23. package/dist/community/advanced-data-card.css-mistica.js +24 -21
  24. package/dist/community/advanced-data-card.css.d.ts +1 -0
  25. package/dist/community/advanced-data-card.d.ts +1 -0
  26. package/dist/community/advanced-data-card.js +20 -17
  27. package/dist/counter.js +26 -22
  28. package/dist/cover-hero-media.d.ts +12 -0
  29. package/dist/cover-hero-media.js +44 -0
  30. package/dist/cover-hero.css-mistica.js +56 -0
  31. package/dist/cover-hero.css.d.ts +14 -0
  32. package/dist/cover-hero.css.ts.vanilla.css-mistica.js +11 -0
  33. package/dist/cover-hero.d.ts +38 -0
  34. package/dist/cover-hero.js +296 -0
  35. package/dist/empty-state.js +6 -6
  36. package/dist/grid-layout.css-mistica.js +11 -8
  37. package/dist/grid-layout.css.d.ts +1 -0
  38. package/dist/grid-layout.d.ts +12 -22
  39. package/dist/grid-layout.js +63 -49
  40. package/dist/header.js +18 -18
  41. package/dist/highlighted-card.d.ts +1 -0
  42. package/dist/highlighted-card.js +22 -18
  43. package/dist/icon-button.d.ts +7 -6
  44. package/dist/image.js +69 -48
  45. package/dist/index.d.ts +4 -1
  46. package/dist/index.js +15 -0
  47. package/dist/list.d.ts +1 -0
  48. package/dist/navigation-bar.d.ts +1 -1
  49. package/dist/navigation-bar.js +1 -1
  50. package/dist/package-version.js +1 -1
  51. package/dist/select.js +16 -12
  52. package/dist/skins/movistar.d.ts +13 -0
  53. package/dist/skins/movistar.js +112 -99
  54. package/dist/spinner.js +19 -18
  55. package/dist/table.css-mistica.js +58 -0
  56. package/dist/table.css.d.ts +13 -0
  57. package/dist/table.css.ts.vanilla.css-mistica.js +11 -0
  58. package/dist/table.d.ts +39 -0
  59. package/dist/table.js +269 -0
  60. package/dist/text.d.ts +1 -1
  61. package/dist/theme.d.ts +20 -0
  62. package/dist/theme.js +80 -20
  63. package/dist/timer.css-mistica.js +39 -0
  64. package/dist/timer.css.d.ts +8 -0
  65. package/dist/timer.css.ts.vanilla.css-mistica.js +11 -0
  66. package/dist/timer.d.ts +27 -0
  67. package/dist/timer.js +370 -0
  68. package/dist/tooltip.js +13 -13
  69. package/dist/touchable.d.ts +2 -0
  70. package/dist/touchable.js +35 -31
  71. package/dist/utils/helpers.js +32 -32
  72. package/dist-es/boxed.css-mistica.js +29 -2
  73. package/dist-es/boxed.js +37 -31
  74. package/dist-es/button-group.css-mistica.js +2 -2
  75. package/dist-es/button-group.js +37 -24
  76. package/dist-es/button-layout.css-mistica.js +2 -2
  77. package/dist-es/button-layout.js +16 -16
  78. package/dist-es/button.js +24 -22
  79. package/dist-es/card.js +681 -618
  80. package/dist-es/carousel.css-mistica.js +7 -7
  81. package/dist-es/carousel.js +75 -73
  82. package/dist-es/chip.js +57 -64
  83. package/dist-es/circle.js +15 -16
  84. package/dist-es/community/advanced-data-card.css-mistica.js +4 -4
  85. package/dist-es/community/advanced-data-card.js +59 -56
  86. package/dist-es/counter.js +62 -58
  87. package/dist-es/cover-hero-media.js +30 -0
  88. package/dist-es/cover-hero.css-mistica.js +9 -0
  89. package/dist-es/cover-hero.css.ts.vanilla.css-mistica.js +2 -0
  90. package/dist-es/cover-hero.js +241 -0
  91. package/dist-es/empty-state.js +13 -13
  92. package/dist-es/grid-layout.css-mistica.js +3 -3
  93. package/dist-es/grid-layout.js +80 -66
  94. package/dist-es/header.js +37 -37
  95. package/dist-es/highlighted-card.js +35 -31
  96. package/dist-es/image.js +88 -67
  97. package/dist-es/index.js +1817 -1814
  98. package/dist-es/navigation-bar.js +1 -1
  99. package/dist-es/package-version.js +1 -1
  100. package/dist-es/select.js +23 -18
  101. package/dist-es/skins/movistar.js +112 -99
  102. package/dist-es/spinner.js +38 -37
  103. package/dist-es/style.css +1 -1
  104. package/dist-es/table.css-mistica.js +14 -0
  105. package/dist-es/table.css.ts.vanilla.css-mistica.js +2 -0
  106. package/dist-es/table.js +214 -0
  107. package/dist-es/theme.js +77 -17
  108. package/dist-es/timer.css-mistica.js +4 -0
  109. package/dist-es/timer.css.ts.vanilla.css-mistica.js +2 -0
  110. package/dist-es/timer.js +307 -0
  111. package/dist-es/tooltip.js +16 -16
  112. package/dist-es/touchable.js +47 -43
  113. package/dist-es/utils/helpers.js +31 -31
  114. package/package.json +1 -1
@@ -10,46 +10,46 @@ function _export(target, all) {
10
10
  }
11
11
  _export(exports, {
12
12
  debounce: function() {
13
- return p;
13
+ return W;
14
14
  },
15
15
  isEqual: function() {
16
- return x;
16
+ return p;
17
17
  }
18
18
  });
19
- const p = function(e, n) {
20
- let r = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
21
- var _r_leading, _r_trailing;
22
- const a = n, c = (_r_leading = r.leading) !== null && _r_leading !== void 0 ? _r_leading : !1, g = (_r_trailing = r.trailing) !== null && _r_trailing !== void 0 ? _r_trailing : !0, l = r.maxWait !== void 0 ? Math.max(r.maxWait, a) : void 0;
23
- let o, d = 0, s = -1, f, i;
24
- const y = (t)=>(d = t, o && (f = e(...o)), o = void 0, f), T = (t)=>{
25
- const u = t - s, m = t - d;
26
- return s < 0 || u >= n || u < 0 || l !== void 0 && m >= l;
27
- }, I = (t)=>{
28
- const u = t - s, m = t - d, h = n - 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 = (t)=>(i = void 0, g && o ? y(t) : (o = void 0, f)), v = ()=>{
31
- const t = Date.now();
32
- if (T(t)) return k(t);
33
- i = setTimeout(v, I(t));
34
- }, W = (t)=>(d = t, i = setTimeout(v, a), c ? y(t) : f), A = function() {
35
- for(var _len = arguments.length, t = new Array(_len), _key = 0; _key < _len; _key++){
36
- t[_key] = arguments[_key];
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 = t, s = u, m) {
40
- if (i === void 0) return W(s);
41
- if (l !== void 0) return i = setTimeout(v, a), y(s);
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 i === void 0 && (i = setTimeout(v, a)), f;
43
+ return r === void 0 && (r = setTimeout(v, a)), f;
44
44
  };
45
45
  return A.cancel = ()=>{
46
- i !== void 0 && (clearTimeout(i), i = void 0), d = 0, s = -1, o = void 0;
47
- }, A.flush = ()=>i === void 0 ? f : k(Date.now()), A;
48
- }, D = (e)=>e === null ? !0 : !(typeof e == "object" || typeof e == "function"), x = (e, n)=>{
49
- if (e === n) return !0;
50
- if (D(e) || D(n) || typeof e != typeof n || typeof e == "function") return !1;
51
- if (Array.isArray(e) || Array.isArray(n)) return Array.isArray(e) && Array.isArray(n) ? e.length === n.length && e.every((c, g)=>x(c, n[g])) : !1;
52
- if (e instanceof Date || n instanceof Date) return e instanceof Date && n instanceof Date ? e.getTime() === n.getTime() : !1;
53
- const r = Object.keys(e), a = Object.keys(n);
54
- return r.length === a.length ? r.every((c)=>x(e[c], n[c])) : !1;
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", p = "ihbkeq1";
4
- export { e as boxBorder, p as desktopOnly };
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 i from "react";
56
- import k from "classnames";
57
- import { useIsInverseVariant as y, ThemeVariant as B } from "./theme-variant-context.js";
58
- import { getPrefixedDataAttributes as O } from "./utils/dom.js";
59
- import { vars as o } from "./skins/skin-contract.css-mistica.js";
60
- import { desktopOnly as R, boxBorder as h } from "./boxed.css-mistica.js";
61
- import { sprinkles as s } from "./sprinkles.css-mistica.js";
62
- const w = (e, r)=>e || r ? s({
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
- }) : h, C = /*#__PURE__*/ i.forwardRef((param, g)=>{
65
- let { children: e, isInverse: r = !1, className: l, role: d, dataAttributes: m, "aria-label": b, "aria-labelledby": f, width: c, height: p, minHeight: u, borderRadius: x = o.borderRadii.container, background: t, desktopOnly: v } = param;
66
- const n = y();
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: g,
69
- style: {
70
- width: c,
71
- height: p,
72
- minHeight: u,
73
- boxSizing: "border-box",
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: (t !== null && t !== void 0 ? t : r) ? n ? o.colors.backgroundContainerBrandOverInverse : o.colors.backgroundContainerBrand : o.colors.backgroundContainer
85
+ background: (d !== null && d !== void 0 ? d : r) ? m ? n.colors.backgroundContainerBrandOverInverse : n.colors.backgroundContainerBrand : n.colors.backgroundContainer
80
86
  }), {
81
- [R]: v
87
+ [W]: C
82
88
  }),
83
- role: d,
84
- "aria-label": b,
85
- "aria-labelledby": f
86
- }, O(m)), {
87
- children: /* @__PURE__ */ a(B, {
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: e
95
+ children: o
90
96
  })
91
97
  }));
92
- }), N = /*#__PURE__*/ i.forwardRef((e, r)=>/* @__PURE__ */ a(C, _object_spread_props(_object_spread({}, e), {
98
+ }), J = /*#__PURE__*/ f.forwardRef((o, r)=>/* @__PURE__ */ a(A, _object_spread_props(_object_spread({}, o), {
93
99
  ref: r
94
100
  })));
95
- export { N as Boxed, C as InternalBoxed };
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 h = "_1xdd1h64", r = "_1xdd1h63", t = "_1xdd1h62", v = "_1xdd1h61 _1y2v1nfhl _1y2v1nfhz _1y2v1nfhp";
4
- export { h as buttonChild, r as buttons, t as container, v as inline };
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 };
@@ -50,38 +50,51 @@ function _object_spread_props(target, source) {
50
50
  }
51
51
  return target;
52
52
  }
53
- import { jsxs as o, jsx as i } from "react/jsx-runtime";
54
- import c from "classnames";
55
- import { getPrefixedDataAttributes as r } from "./utils/dom.js";
56
- import { inline as a, container as h, buttons as f, buttonChild as l } from "./button-group.css-mistica.js";
57
- const u = (param)=>{
58
- let { primaryButton: s, secondaryButton: t, link: e, dataAttributes: d } = param;
59
- const m = !!s || !!t || !!e, n = !!s && !!t;
60
- return m ? /* @__PURE__ */ o("div", _object_spread_props(_object_spread({
61
- className: c(a, h)
62
- }, r(d, "ButtonGroup")), {
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
- (s || t) && /* @__PURE__ */ o("div", {
65
- className: c(a, f),
77
+ (t || o) && /* @__PURE__ */ r("div", {
78
+ className: n(b, N),
66
79
  children: [
67
- s && /* @__PURE__ */ i("div", {
68
- className: l,
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
- e && /* @__PURE__ */ i("div", {
78
- className: l,
90
+ s && /* @__PURE__ */ c("div", {
91
+ className: i,
79
92
  style: {
80
- width: n ? "100%" : "auto"
93
+ width: a ? "100%" : "auto"
81
94
  },
82
- children: e
95
+ children: s
83
96
  })
84
97
  ]
85
98
  })) : null;
86
- }, x = u;
87
- export { x as default };
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
- }, t = "kfxylh2 _1y2v1nfhk _1y2v1nfhz", l = "kfxylh3", i = "kfxylhe kfxylhd _1y2v1nfhk _1y2v1nfi7", k = "kfxylhf kfxylhd _1y2v1nfhk _1y2v1nfi7", r = "kfxylh0";
10
- export { y as alignVariant, t as container, l as containerWithTwoButtons, i as link, k as linkWithTwoButtons, r as margins };
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 };
@@ -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 v, ButtonDanger as w, ButtonSecondary as L } from "./button.js";
56
+ import { ButtonPrimary as L, ButtonDanger as N, ButtonSecondary as v } from "./button.js";
57
57
  import g from "classnames";
58
- import { getPrefixedDataAttributes as N } from "./utils/dom.js";
59
- import { linkWithTwoButtons as O, link as j, container as A, alignVariant as C, containerWithTwoButtons as D, margins as P } from "./button-layout.css-mistica.js";
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
- v,
62
- w,
63
- L
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), u = r ? l : t === "right" ? /* @__PURE__ */ n(o, {
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
- }), m = c ? /* @__PURE__ */ a("div", {
80
- className: g(i > 1 ? O : j),
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
- }, N(B, "ButtonLayout")), {
87
+ }, w(B, "ButtonLayout")), {
88
88
  children: t !== "right" || i > 1 ? /* @__PURE__ */ n(o, {
89
89
  children: [
90
- u,
91
- m
90
+ m,
91
+ u
92
92
  ]
93
93
  }) : /* @__PURE__ */ n(o, {
94
94
  children: [
95
- m,
96
- u
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
- }, q = R;
105
- export { q as default };
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 P } from "./utils/css.js";
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 S } from "./utils/common.js";
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 w } from "./hooks.js";
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 A, PADDING_Y_LINK as T, 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";
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: P(v)
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 } = w();
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 = P(i ? re : ae);
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: P(o),
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: P(o),
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 } = w(), { 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);
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: S(e.children)
256
+ component_copy: P(e.children)
257
257
  } : {
258
258
  category: M.userInteraction,
259
259
  action: `${e.type}_button_tapped`,
260
- label: S(e.children)
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 } = w(), { eventFormat: s } = F(), { isDarkMode: f } = w(), { 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
+ 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: S(t.children)
355
+ component_copy: P(t.children)
355
356
  } : {
356
357
  category: M.userInteraction,
357
358
  action: q.linkTapped,
358
- label: S(t.children)
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: -A
373
+ marginLeft: -T
373
374
  } : void 0, t.bleedRight ? {
374
- marginRight: -A
375
+ marginRight: -T
375
376
  } : void 0, t.bleedY ? {
376
- marginTop: -T,
377
- marginBottom: -T
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
- }), Ae = /*#__PURE__*/ a.forwardRef((_param, i)=>{
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
- }), Te = /*#__PURE__*/ a.forwardRef((_param, i)=>{
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, Ae as ButtonPrimary, Te as ButtonSecondary };
490
+ export { De as ButtonDanger, Re as ButtonLink, Be as ButtonLinkDanger, Te as ButtonPrimary, Ae as ButtonSecondary };