@telefonica/mistica 14.16.1 → 14.17.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/button.css-mistica.js +19 -16
- package/dist/button.css.d.ts +1 -0
- package/dist/button.d.ts +6 -1
- package/dist/button.js +161 -115
- package/dist/card.js +41 -41
- package/dist/list.css-mistica.js +17 -11
- package/dist/list.css.d.ts +2 -0
- package/dist/list.d.ts +1 -0
- package/dist/list.js +106 -94
- package/dist/package-version.js +1 -1
- package/dist/skins/blau.js +11 -10
- package/dist/skins/defaults.js +1 -0
- package/dist/skins/movistar-legacy.js +11 -10
- package/dist/skins/movistar.js +11 -10
- package/dist/skins/o2.js +11 -10
- package/dist/skins/telefonica.js +11 -10
- package/dist/skins/types/index.d.ts +1 -0
- package/dist/skins/vivo-new.js +11 -10
- package/dist/skins/vivo.js +11 -10
- package/dist/spinner.css-mistica.js +4 -4
- package/dist/tabs.js +13 -13
- package/dist-es/button.css-mistica.js +3 -3
- package/dist-es/button.js +201 -155
- package/dist-es/card.js +66 -66
- package/dist-es/list.css-mistica.js +2 -2
- package/dist-es/list.js +143 -131
- package/dist-es/package-version.js +1 -1
- package/dist-es/skins/blau.js +11 -10
- package/dist-es/skins/defaults.js +1 -0
- package/dist-es/skins/movistar-legacy.js +11 -10
- package/dist-es/skins/movistar.js +11 -10
- package/dist-es/skins/o2.js +11 -10
- package/dist-es/skins/telefonica.js +11 -10
- package/dist-es/skins/vivo-new.js +11 -10
- package/dist-es/skins/vivo.js +11 -10
- package/dist-es/spinner.css-mistica.js +2 -2
- package/dist-es/style.css +1 -1
- package/dist-es/tabs.js +18 -18
- package/package.json +1 -1
package/dist/skins/vivo.js
CHANGED
|
@@ -289,6 +289,17 @@ const e = {
|
|
|
289
289
|
button: {
|
|
290
290
|
weight: "medium"
|
|
291
291
|
},
|
|
292
|
+
tabsLabel: {
|
|
293
|
+
weight: "medium",
|
|
294
|
+
size: {
|
|
295
|
+
mobile: 16,
|
|
296
|
+
desktop: 18
|
|
297
|
+
},
|
|
298
|
+
lineHeight: {
|
|
299
|
+
mobile: 24,
|
|
300
|
+
desktop: 24
|
|
301
|
+
}
|
|
302
|
+
},
|
|
292
303
|
link: {
|
|
293
304
|
weight: "medium"
|
|
294
305
|
},
|
|
@@ -315,16 +326,6 @@ const e = {
|
|
|
315
326
|
},
|
|
316
327
|
text10: {
|
|
317
328
|
weight: "light"
|
|
318
|
-
},
|
|
319
|
-
tabsLabel: {
|
|
320
|
-
size: {
|
|
321
|
-
mobile: 16,
|
|
322
|
-
desktop: 18
|
|
323
|
-
},
|
|
324
|
-
lineHeight: {
|
|
325
|
-
mobile: 24,
|
|
326
|
-
desktop: 24
|
|
327
|
-
}
|
|
328
329
|
}
|
|
329
330
|
}
|
|
330
331
|
});
|
|
@@ -13,15 +13,15 @@ _export(exports, {
|
|
|
13
13
|
return t;
|
|
14
14
|
},
|
|
15
15
|
spinnerDefaultPath: function() {
|
|
16
|
-
return
|
|
16
|
+
return f;
|
|
17
17
|
},
|
|
18
18
|
spinnerIos: function() {
|
|
19
|
-
return
|
|
19
|
+
return v;
|
|
20
20
|
},
|
|
21
21
|
spinnerIosSvgPath: function() {
|
|
22
|
-
return
|
|
22
|
+
return a;
|
|
23
23
|
}
|
|
24
24
|
});
|
|
25
25
|
require("./sprinkles.css.ts.vanilla.css-mistica.js");
|
|
26
26
|
require("./spinner.css.ts.vanilla.css-mistica.js");
|
|
27
|
-
var t = "_1fthc594 _1y2v1nf6m",
|
|
27
|
+
var t = "_1fthc594 _1y2v1nf6m _1y2v1nf66", f = "_1fthc595", v = "_1y2v1nf6m _1y2v1nf66", a = "_1fthc597";
|
package/dist/tabs.js
CHANGED
|
@@ -114,7 +114,7 @@ function _object_spread_props(target, source) {
|
|
|
114
114
|
}
|
|
115
115
|
return target;
|
|
116
116
|
}
|
|
117
|
-
const
|
|
117
|
+
const d = (0, _platform.isRunningAcceptanceTest)() ? 0 : 300, q = (i)=>{
|
|
118
118
|
switch(i){
|
|
119
119
|
case 2:
|
|
120
120
|
return "tabs2";
|
|
@@ -125,13 +125,13 @@ const f = (0, _platform.isRunningAcceptanceTest)() ? 0 : 300, q = (i)=>{
|
|
|
125
125
|
}
|
|
126
126
|
}, C = (param)=>{
|
|
127
127
|
let { selectedIndex: i , onChange: y , tabs: b , dataAttributes: T } = param;
|
|
128
|
-
const { textPresets:
|
|
129
|
-
const t = document.querySelector(`[id='${n}'] [data-tabindex="${l}"]`),
|
|
130
|
-
t &&
|
|
131
|
-
e.style.width = `${
|
|
128
|
+
const { textPresets: r } = (0, _hooks.useTheme)(), n = (0, _hooks.useAriaId)(), { ref: A } = (0, _hooks.useElementDimensions)(), u = _react.useRef(null), h = _react.useRef(null), [p, L] = _react.useState(!1), N = (l, c)=>{
|
|
129
|
+
const t = document.querySelector(`[id='${n}'] [data-tabindex="${l}"]`), o = document.querySelector(`[id='${n}'] [data-tabindex="${c}"]`), e = u.current, a = h.current;
|
|
130
|
+
t && o && e && a && (L(!0), e.style.display = "block", e.style.width = `${t.offsetWidth}px`, e.style.transform = `translate(${t.offsetLeft - a.scrollLeft}px, 0)`, Promise.resolve().then(()=>{
|
|
131
|
+
e.style.width = `${o.offsetWidth}px`, e.style.transform = `translate(${o.offsetLeft - a.scrollLeft}px, 0)`, e.style.transition = `transform ${d}ms, width ${d}ms`;
|
|
132
132
|
}), setTimeout(()=>{
|
|
133
133
|
e.style.transition = "", e.style.display = "none", L(!1);
|
|
134
|
-
},
|
|
134
|
+
}, d));
|
|
135
135
|
};
|
|
136
136
|
return /* @__PURE__ */ (0, _jsxruntime.jsx)("div", _object_spread_props(_object_spread({
|
|
137
137
|
id: n,
|
|
@@ -150,7 +150,7 @@ const f = (0, _platform.isRunningAcceptanceTest)() ? 0 : 300, q = (i)=>{
|
|
|
150
150
|
children: /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
151
151
|
className: _tabscssmistica.tabsContainer,
|
|
152
152
|
children: b.map((param, e)=>{
|
|
153
|
-
let { text: l , trackingEvent: c , icon: t , "aria-controls":
|
|
153
|
+
let { text: l , trackingEvent: c , icon: t , "aria-controls": o } = param;
|
|
154
154
|
const a = e === i;
|
|
155
155
|
return /* @__PURE__ */ (0, _jsxruntime.jsxs)(_touchable.BaseTouchable, {
|
|
156
156
|
dataAttributes: {
|
|
@@ -163,7 +163,7 @@ const f = (0, _platform.isRunningAcceptanceTest)() ? 0 : 300, q = (i)=>{
|
|
|
163
163
|
},
|
|
164
164
|
trackingEvent: c,
|
|
165
165
|
role: "tab",
|
|
166
|
-
"aria-controls":
|
|
166
|
+
"aria-controls": o,
|
|
167
167
|
"aria-selected": a ? "true" : "false",
|
|
168
168
|
children: [
|
|
169
169
|
t && /* @__PURE__ */ (0, _jsxruntime.jsx)("div", {
|
|
@@ -171,11 +171,11 @@ const f = (0, _platform.isRunningAcceptanceTest)() ? 0 : 300, q = (i)=>{
|
|
|
171
171
|
children: t
|
|
172
172
|
}),
|
|
173
173
|
/* @__PURE__ */ (0, _jsxruntime.jsx)(_text.Text, {
|
|
174
|
-
desktopSize:
|
|
175
|
-
mobileSize:
|
|
176
|
-
desktopLineHeight:
|
|
177
|
-
mobileLineHeight:
|
|
178
|
-
weight:
|
|
174
|
+
desktopSize: r.tabsLabel.size.desktop,
|
|
175
|
+
mobileSize: r.tabsLabel.size.mobile,
|
|
176
|
+
desktopLineHeight: r.tabsLabel.lineHeight.desktop,
|
|
177
|
+
mobileLineHeight: r.tabsLabel.lineHeight.mobile,
|
|
178
|
+
weight: r.tabsLabel.weight,
|
|
179
179
|
color: "inherit",
|
|
180
180
|
wordBreak: !1,
|
|
181
181
|
textAlign: "center",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import "./sprinkles.css.ts.vanilla.css-mistica.js";
|
|
2
2
|
import "./button.css.ts.vanilla.css-mistica.js";
|
|
3
|
-
var _ = 104, r =
|
|
3
|
+
var _ = 104, r = 2, y = 8, f = 24, a = 20, p = 16, b = 20, i = 14.5, s = 10.5, e = "rrbrpnl", I = "rrbrpni _1y2v1nf28", l = {
|
|
4
4
|
primary: "rrbrpnp rrbrpn2 _1y2v1nf6r _1y2v1nf76 _1y2v1nf7l _1y2v1nf80 _1y2v1nf68 _1y2v1nf5z _1y2v1nf8g _1y2v1nfah _1y2v1nfas _1y2v1nf21 _1y2v1nf3s",
|
|
5
5
|
secondary: "rrbrpnq rrbrpn2 _1y2v1nf6r _1y2v1nf76 _1y2v1nf7l _1y2v1nf80 _1y2v1nf68 _1y2v1nf5z _1y2v1nf8g _1y2v1nfah _1y2v1nfas _1y2v1nf25 _1y2v1nf5y",
|
|
6
6
|
danger: "rrbrpnr rrbrpn2 _1y2v1nf6r _1y2v1nf76 _1y2v1nf7l _1y2v1nf80 _1y2v1nf68 _1y2v1nf5z _1y2v1nf8g _1y2v1nfah _1y2v1nfas _1y2v1nf20 _1y2v1nf3m"
|
|
7
|
-
}, t = "rrbrpn0",
|
|
7
|
+
}, t = "rrbrpn0", N = "rrbrpng _1y2v1nf7p _1y2v1nf84 _1y2v1nf68 _1y2v1nf8g _1y2v1nf5z _1y2v1nfah _1y2v1nfaa _1y2v1nf27 _1y2v1nf5y _1y2v1nfas _1y2v1nf9m", g = "rrbrpn7 _1y2v1nf65 _1y2v1nf60 _1y2v1nfau _1y2v1nfc3 _1y2v1nf6d _1y2v1nf6j", o = "rrbrpn4 _1y2v1nf66 _1y2v1nf8x _1y2v1nfas", L = "rrbrpn5", d = "rrbrpn9 _1y2v1nf64 _1y2v1nf6j _1y2v1nf6d", m = "rrbrpnk _1y2v1nf64 _1y2v1nf6j _1y2v1nf6d", S = {
|
|
8
8
|
primary: "rrbrpnm rrbrpn2 _1y2v1nf6r _1y2v1nf76 _1y2v1nf7l _1y2v1nf80 _1y2v1nf68 _1y2v1nf5z _1y2v1nf8g _1y2v1nfah _1y2v1nfas _1y2v1nf20 _1y2v1nf3r",
|
|
9
9
|
secondary: "rrbrpnn rrbrpn2 _1y2v1nf6r _1y2v1nf76 _1y2v1nf7l _1y2v1nf80 _1y2v1nf68 _1y2v1nf5z _1y2v1nf8g _1y2v1nfah _1y2v1nfas _1y2v1nf23 _1y2v1nf5y",
|
|
10
10
|
danger: "rrbrpno rrbrpn2 _1y2v1nf6r _1y2v1nf76 _1y2v1nf7l _1y2v1nf80 _1y2v1nf68 _1y2v1nf5z _1y2v1nf8g _1y2v1nfah _1y2v1nfas _1y2v1nf20 _1y2v1nf3m"
|
|
11
11
|
};
|
|
12
|
-
export { _ as BUTTON_MIN_WIDTH, r as
|
|
12
|
+
export { _ as BUTTON_MIN_WIDTH, r as CHEVRON_MARGIN_LEFT_LINK, y as ICON_MARGIN_PX, f as ICON_SIZE, a as SMALL_ICON_SIZE, p as SMALL_SPINNER_SIZE, b as SPINNER_SIZE, i as X_PADDING_PX, s as X_SMALL_PADDING_PX, e as alignedLink, I as inverseLink, l as inverseVariants, t as isLoading, N as link, g as loadingContent, o as loadingFiller, L as small, d as textContent, m as textContentLink, S as variants };
|
package/dist-es/button.js
CHANGED
|
@@ -77,298 +77,344 @@ function _object_without_properties_loose(source, excluded) {
|
|
|
77
77
|
}
|
|
78
78
|
return target;
|
|
79
79
|
}
|
|
80
|
-
import { jsx as t, jsxs as
|
|
81
|
-
import * as
|
|
82
|
-
import
|
|
80
|
+
import { jsx as t, jsxs as C, Fragment as F } from "react/jsx-runtime";
|
|
81
|
+
import * as o from "react";
|
|
82
|
+
import x from "classnames";
|
|
83
83
|
import z from "./spinner.js";
|
|
84
|
-
import { BaseTouchable as
|
|
85
|
-
import { useIsInverseVariant as
|
|
86
|
-
import { useForm as
|
|
87
|
-
import { pxToRem as
|
|
88
|
-
import { Text as
|
|
89
|
-
import
|
|
90
|
-
import { getTextFromChildren as
|
|
91
|
-
import { useTrackingConfig as
|
|
92
|
-
import { useTheme as
|
|
93
|
-
import { flattenChildren as
|
|
94
|
-
import { inverseVariants as
|
|
84
|
+
import { BaseTouchable as y } from "./touchable.js";
|
|
85
|
+
import { useIsInverseVariant as R } from "./theme-variant-context.js";
|
|
86
|
+
import { useForm as k } from "./form-context.js";
|
|
87
|
+
import { pxToRem as T } from "./utils/css.js";
|
|
88
|
+
import { Text as M, Text3 as X, Text2 as Z } from "./text.js";
|
|
89
|
+
import G from "./box.js";
|
|
90
|
+
import { getTextFromChildren as P } from "./utils/common.js";
|
|
91
|
+
import { useTrackingConfig as W, eventNames as A, eventCategories as B, eventActions as j } from "./utils/analytics.js";
|
|
92
|
+
import { useTheme as O } from "./hooks.js";
|
|
93
|
+
import { flattenChildren as H } from "./skins/utils.js";
|
|
94
|
+
import { inverseVariants as $, variants as K, small as q, isLoading as D, textContent as J, link as Q, inverseLink as U, alignedLink as Y, textContentLink as p, SMALL_SPINNER_SIZE as ee, SPINNER_SIZE as te, ICON_MARGIN_PX as b, CHEVRON_MARGIN_LEFT_LINK as ne, loadingFiller as re, X_SMALL_PADDING_PX as ie, X_PADDING_PX as oe, loadingContent as ae, SMALL_ICON_SIZE as se, ICON_SIZE as ce } from "./button.css-mistica.js";
|
|
95
95
|
const w = (param)=>{
|
|
96
|
-
let { content: e , defaultIconSize:
|
|
97
|
-
const
|
|
98
|
-
let
|
|
99
|
-
const
|
|
100
|
-
|
|
101
|
-
children: n(
|
|
102
|
-
},
|
|
96
|
+
let { content: e , defaultIconSize: i , renderText: n } = param;
|
|
97
|
+
const c = H(e), f = c.length, d = [];
|
|
98
|
+
let l = [];
|
|
99
|
+
const g = ()=>{
|
|
100
|
+
d.push(/* @__PURE__ */ t(o.Fragment, {
|
|
101
|
+
children: n(l)
|
|
102
|
+
}, d.length)), l = [];
|
|
103
103
|
};
|
|
104
|
-
return
|
|
105
|
-
const
|
|
106
|
-
if (/*#__PURE__*/
|
|
107
|
-
|
|
108
|
-
var
|
|
109
|
-
const
|
|
110
|
-
|
|
104
|
+
return c.forEach((u, m)=>{
|
|
105
|
+
const a = m === 0, s = m === f - 1;
|
|
106
|
+
if (/*#__PURE__*/ o.isValidElement(u)) {
|
|
107
|
+
l.length && g();
|
|
108
|
+
var _u_props_size;
|
|
109
|
+
const v = (_u_props_size = u.props.size) !== null && _u_props_size !== void 0 ? _u_props_size : i;
|
|
110
|
+
d.push(/* @__PURE__ */ t("div", {
|
|
111
111
|
style: {
|
|
112
112
|
display: "flex",
|
|
113
113
|
alignItems: "center",
|
|
114
|
-
marginLeft:
|
|
115
|
-
marginRight:
|
|
114
|
+
marginLeft: a ? 0 : b,
|
|
115
|
+
marginRight: s ? 0 : b
|
|
116
116
|
},
|
|
117
|
-
children: /*#__PURE__*/
|
|
118
|
-
size:
|
|
117
|
+
children: /*#__PURE__*/ o.cloneElement(u, {
|
|
118
|
+
size: T(v)
|
|
119
119
|
})
|
|
120
|
-
},
|
|
121
|
-
} else
|
|
122
|
-
}),
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
120
|
+
}, d.length));
|
|
121
|
+
} else l.push(u), s && g();
|
|
122
|
+
}), d;
|
|
123
|
+
}, le = ()=>/* @__PURE__ */ t("svg", {
|
|
124
|
+
width: "8",
|
|
125
|
+
height: "20",
|
|
126
|
+
viewBox: "0 0 8 20",
|
|
127
|
+
children: /* @__PURE__ */ t("path", {
|
|
128
|
+
d: "M6.32595 11.0107L3.03801 7.7086L3.03292 7.70375L3.032 7.70291L3.02931 7.70047L3.02848 7.69974L3.02248 7.69436C2.88533 7.57121 2.71386 7.53733 2.56343 7.55395C2.41648 7.57018 2.27272 7.63567 2.16886 7.73711C2.06893 7.83185 2.01209 7.97816 2.00175 8.11707C1.99083 8.26377 2.02925 8.43959 2.16869 8.57393L5.24446 11.5515L2.15859 14.512L2.15375 14.5171L2.1529 14.518L2.15046 14.5207L2.14974 14.5215L2.14435 14.5275C2.02121 14.6647 1.98733 14.8361 2.00394 14.9866C2.02017 15.1335 2.08567 15.2773 2.18711 15.3811C2.28184 15.4811 2.42816 15.5379 2.56706 15.5483C2.71377 15.5592 2.88958 15.5208 3.02392 15.3813L6.32595 12.0922C6.6246 11.7936 6.6246 11.3094 6.32595 11.0107Z",
|
|
129
|
+
fill: "currentColor"
|
|
130
|
+
})
|
|
131
|
+
}), V = (param)=>{
|
|
132
|
+
let { showSpinner: e , children: i , small: n , loadingText: c , shouldRenderSpinner: f , setShouldRenderSpinner: d , renderText: l , textContentStyle: g , StartIcon: u , EndIcon: m , withChevron: a } = param;
|
|
133
|
+
const s = n ? se : ce, r = T(n ? ee : te);
|
|
134
|
+
return /* @__PURE__ */ C(F, {
|
|
127
135
|
children: [
|
|
128
|
-
/* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ C("div", {
|
|
129
137
|
"aria-hidden": e ? !0 : void 0,
|
|
130
|
-
className:
|
|
131
|
-
children:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
138
|
+
className: g,
|
|
139
|
+
children: [
|
|
140
|
+
u && /* @__PURE__ */ t("div", {
|
|
141
|
+
style: {
|
|
142
|
+
display: "flex",
|
|
143
|
+
alignItems: "center",
|
|
144
|
+
marginRight: b
|
|
145
|
+
},
|
|
146
|
+
children: /* @__PURE__ */ t(u, {
|
|
147
|
+
size: s,
|
|
148
|
+
color: "currentColor"
|
|
149
|
+
})
|
|
150
|
+
}),
|
|
151
|
+
w({
|
|
152
|
+
content: i,
|
|
153
|
+
defaultIconSize: s,
|
|
154
|
+
renderText: l
|
|
155
|
+
}),
|
|
156
|
+
m && !a && /* @__PURE__ */ t("div", {
|
|
157
|
+
style: {
|
|
158
|
+
display: "flex",
|
|
159
|
+
alignItems: "center",
|
|
160
|
+
marginLeft: b
|
|
161
|
+
},
|
|
162
|
+
children: /* @__PURE__ */ t(m, {
|
|
163
|
+
size: s,
|
|
164
|
+
color: "currentColor"
|
|
165
|
+
})
|
|
166
|
+
}),
|
|
167
|
+
a && /* @__PURE__ */ t("div", {
|
|
168
|
+
style: {
|
|
169
|
+
display: "flex",
|
|
170
|
+
alignItems: "center",
|
|
171
|
+
marginLeft: ne
|
|
172
|
+
},
|
|
173
|
+
children: /* @__PURE__ */ t(le, {})
|
|
174
|
+
})
|
|
175
|
+
]
|
|
136
176
|
}),
|
|
137
177
|
/* @__PURE__ */ t("div", {
|
|
138
|
-
className:
|
|
178
|
+
className: re,
|
|
139
179
|
"aria-hidden": !0,
|
|
140
|
-
style:
|
|
141
|
-
paddingLeft:
|
|
142
|
-
paddingRight:
|
|
180
|
+
style: c ? {
|
|
181
|
+
paddingLeft: r,
|
|
182
|
+
paddingRight: b + 2 * (n ? ie : oe)
|
|
143
183
|
} : void 0,
|
|
144
184
|
children: w({
|
|
145
|
-
content:
|
|
146
|
-
defaultIconSize:
|
|
147
|
-
renderText:
|
|
185
|
+
content: c,
|
|
186
|
+
defaultIconSize: s,
|
|
187
|
+
renderText: l
|
|
148
188
|
})
|
|
149
189
|
}),
|
|
150
|
-
/* @__PURE__ */
|
|
190
|
+
/* @__PURE__ */ C("div", {
|
|
151
191
|
"aria-hidden": e ? void 0 : !0,
|
|
152
|
-
className:
|
|
192
|
+
className: ae,
|
|
153
193
|
onTransitionEnd: ()=>{
|
|
154
|
-
e !==
|
|
194
|
+
e !== f && d(e);
|
|
155
195
|
},
|
|
156
196
|
children: [
|
|
157
|
-
|
|
158
|
-
rolePresentation: !!
|
|
197
|
+
f ? /* @__PURE__ */ t(z, {
|
|
198
|
+
rolePresentation: !!c,
|
|
159
199
|
color: "currentcolor",
|
|
160
200
|
delay: "0s",
|
|
161
|
-
size:
|
|
201
|
+
size: r
|
|
162
202
|
}) : /* @__PURE__ */ t("div", {
|
|
163
203
|
style: {
|
|
164
204
|
display: "inline-block",
|
|
165
|
-
width:
|
|
166
|
-
height:
|
|
205
|
+
width: r,
|
|
206
|
+
height: r
|
|
167
207
|
}
|
|
168
208
|
}),
|
|
169
|
-
|
|
209
|
+
c ? /* @__PURE__ */ t(G, {
|
|
170
210
|
paddingLeft: 8,
|
|
171
211
|
children: w({
|
|
172
|
-
content:
|
|
173
|
-
defaultIconSize:
|
|
174
|
-
renderText:
|
|
212
|
+
content: c,
|
|
213
|
+
defaultIconSize: s,
|
|
214
|
+
renderText: l
|
|
175
215
|
})
|
|
176
216
|
}) : null
|
|
177
217
|
]
|
|
178
218
|
})
|
|
179
219
|
]
|
|
180
220
|
});
|
|
181
|
-
},
|
|
182
|
-
const { textPresets: n } =
|
|
183
|
-
|
|
184
|
-
|
|
221
|
+
}, N = /*#__PURE__*/ o.forwardRef((e, i)=>{
|
|
222
|
+
const { textPresets: n } = O(), { eventFormat: c } = W(), { formStatus: f , formId: d } = k(), l = R(), { loadingText: g } = e, u = !!e.submit, m = f === "sending", [a, s] = o.useState(!1), r = e.showSpinner || m && u || a, [v, L] = o.useState(!!r);
|
|
223
|
+
o.useEffect(()=>{
|
|
224
|
+
r && !v && L(!0);
|
|
185
225
|
}, [
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
226
|
+
r,
|
|
227
|
+
v,
|
|
228
|
+
f
|
|
189
229
|
]);
|
|
190
230
|
var _e_trackingEvent;
|
|
191
|
-
const
|
|
192
|
-
name:
|
|
231
|
+
const S = ()=>c === "google-analytics-4" ? {
|
|
232
|
+
name: A.userInteraction,
|
|
193
233
|
component_type: `${e.type}_button`,
|
|
194
|
-
component_copy:
|
|
234
|
+
component_copy: P(e.children)
|
|
195
235
|
} : {
|
|
196
|
-
category:
|
|
236
|
+
category: B.userInteraction,
|
|
197
237
|
action: `${e.type}_button_tapped`,
|
|
198
|
-
label:
|
|
199
|
-
}, E = (
|
|
238
|
+
label: P(e.children)
|
|
239
|
+
}, E = (I)=>e.small ? /* @__PURE__ */ t(M, {
|
|
200
240
|
size: 14,
|
|
201
241
|
lineHeight: 20,
|
|
202
242
|
weight: n.button.weight,
|
|
203
243
|
truncate: 1,
|
|
204
244
|
color: "inherit",
|
|
205
245
|
as: "div",
|
|
206
|
-
children:
|
|
207
|
-
}) : /* @__PURE__ */ t(
|
|
246
|
+
children: I
|
|
247
|
+
}) : /* @__PURE__ */ t(X, {
|
|
208
248
|
weight: n.button.weight,
|
|
209
249
|
truncate: 1,
|
|
210
250
|
color: "inherit",
|
|
211
251
|
as: "div",
|
|
212
|
-
children:
|
|
213
|
-
}),
|
|
214
|
-
ref:
|
|
215
|
-
className:
|
|
216
|
-
[
|
|
217
|
-
[D]:
|
|
252
|
+
children: I
|
|
253
|
+
}), h = {
|
|
254
|
+
ref: i,
|
|
255
|
+
className: x(l ? $[e.type] : K[e.type], e.className, {
|
|
256
|
+
[q]: e.small,
|
|
257
|
+
[D]: r
|
|
218
258
|
}),
|
|
219
259
|
style: _object_spread({
|
|
220
260
|
cursor: e.fake ? "pointer" : void 0
|
|
221
261
|
}, e.style),
|
|
222
|
-
trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ?
|
|
262
|
+
trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ? S() : void 0,
|
|
223
263
|
dataAttributes: e.dataAttributes,
|
|
224
264
|
"aria-controls": e["aria-controls"],
|
|
225
265
|
"aria-expanded": e["aria-expanded"],
|
|
226
266
|
tabIndex: e.tabIndex,
|
|
227
267
|
children: V({
|
|
228
|
-
showSpinner:
|
|
229
|
-
shouldRenderSpinner:
|
|
230
|
-
setShouldRenderSpinner:
|
|
268
|
+
showSpinner: r,
|
|
269
|
+
shouldRenderSpinner: v,
|
|
270
|
+
setShouldRenderSpinner: L,
|
|
231
271
|
children: e.children,
|
|
232
|
-
loadingText:
|
|
272
|
+
loadingText: g,
|
|
233
273
|
small: e.small,
|
|
234
274
|
renderText: E,
|
|
235
|
-
textContentStyle:
|
|
275
|
+
textContentStyle: J,
|
|
276
|
+
StartIcon: e.StartIcon,
|
|
277
|
+
EndIcon: e.EndIcon
|
|
236
278
|
}),
|
|
237
|
-
disabled: e.disabled ||
|
|
279
|
+
disabled: e.disabled || r || m,
|
|
238
280
|
role: "button"
|
|
239
281
|
};
|
|
240
282
|
if (process.env.NODE_ENV !== "production" && (e.to === "" || e.href === "")) throw Error("to or href props are empty strings");
|
|
241
|
-
if (e.fake) return /* @__PURE__ */ t(
|
|
283
|
+
if (e.fake) return /* @__PURE__ */ t(y, _object_spread_props(_object_spread({
|
|
242
284
|
maybe: !0
|
|
243
|
-
},
|
|
285
|
+
}, h), {
|
|
244
286
|
role: "presentation",
|
|
245
287
|
"aria-hidden": "true"
|
|
246
288
|
}));
|
|
247
|
-
if (e.submit) return /* @__PURE__ */ t(
|
|
289
|
+
if (e.submit) return /* @__PURE__ */ t(y, _object_spread({
|
|
248
290
|
type: "submit",
|
|
249
|
-
formId:
|
|
291
|
+
formId: d,
|
|
250
292
|
onPress: ()=>{}
|
|
251
|
-
},
|
|
252
|
-
if (e.onPress) return /* @__PURE__ */ t(
|
|
253
|
-
onPress: (
|
|
254
|
-
const
|
|
255
|
-
|
|
293
|
+
}, h));
|
|
294
|
+
if (e.onPress) return /* @__PURE__ */ t(y, _object_spread_props(_object_spread({}, h), {
|
|
295
|
+
onPress: (I)=>{
|
|
296
|
+
const _ = e.onPress(I);
|
|
297
|
+
_ && (s(!0), _.finally(()=>s(!1)));
|
|
256
298
|
}
|
|
257
299
|
}));
|
|
258
|
-
if (e.to || e.to === "") return /* @__PURE__ */ t(
|
|
300
|
+
if (e.to || e.to === "") return /* @__PURE__ */ t(y, _object_spread_props(_object_spread({}, h), {
|
|
259
301
|
to: e.to,
|
|
260
302
|
fullPageOnWebView: e.fullPageOnWebView
|
|
261
303
|
}));
|
|
262
|
-
if (e.href || e.href === "") return /* @__PURE__ */ t(
|
|
304
|
+
if (e.href || e.href === "") return /* @__PURE__ */ t(y, _object_spread_props(_object_spread({}, h), {
|
|
263
305
|
href: e.href,
|
|
264
306
|
newTab: e.newTab,
|
|
265
307
|
loadOnTop: e.loadOnTop
|
|
266
308
|
}));
|
|
267
309
|
if (process.env.NODE_ENV !== "production") throw Error("Bad button props");
|
|
268
310
|
return null;
|
|
269
|
-
}),
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
311
|
+
}), Ce = /*#__PURE__*/ o.forwardRef((e, i)=>{
|
|
312
|
+
var _e_withChevron;
|
|
313
|
+
const { formStatus: n } = k(), c = R(), { analytics: f , textPresets: d } = O(), { loadingText: l } = e, g = n === "sending", [u, m] = o.useState(!1), a = e.showSpinner || u, s = (_e_withChevron = e.withChevron) !== null && _e_withChevron !== void 0 ? _e_withChevron : !!e.href || !!e.to, [r, v] = o.useState(!!a);
|
|
314
|
+
o.useEffect(()=>{
|
|
315
|
+
a && !r && v(!0);
|
|
273
316
|
}, [
|
|
274
|
-
|
|
275
|
-
|
|
317
|
+
a,
|
|
318
|
+
r,
|
|
276
319
|
n
|
|
277
320
|
]);
|
|
278
321
|
var _e_trackingEvent;
|
|
279
|
-
const
|
|
280
|
-
name:
|
|
322
|
+
const L = ()=>f.eventFormat === "google-analytics-4" ? {
|
|
323
|
+
name: A.userInteraction,
|
|
281
324
|
component_type: "link",
|
|
282
|
-
component_copy:
|
|
325
|
+
component_copy: P(e.children)
|
|
283
326
|
} : {
|
|
284
|
-
category:
|
|
327
|
+
category: B.userInteraction,
|
|
285
328
|
action: j.linkTapped,
|
|
286
|
-
label:
|
|
287
|
-
},
|
|
288
|
-
weight:
|
|
329
|
+
label: P(e.children)
|
|
330
|
+
}, S = (h)=>/* @__PURE__ */ t(Z, {
|
|
331
|
+
weight: d.button.weight,
|
|
289
332
|
truncate: 1,
|
|
290
333
|
color: "inherit",
|
|
291
|
-
children:
|
|
292
|
-
}),
|
|
293
|
-
className:
|
|
294
|
-
[U]:
|
|
334
|
+
children: h
|
|
335
|
+
}), E = {
|
|
336
|
+
className: x(Q, {
|
|
337
|
+
[U]: c,
|
|
295
338
|
[Y]: e.aligned,
|
|
296
|
-
[D]:
|
|
339
|
+
[D]: a
|
|
297
340
|
}),
|
|
298
|
-
trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ?
|
|
341
|
+
trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ? L() : void 0,
|
|
299
342
|
dataAttributes: _object_spread({
|
|
300
343
|
"component-name": "ButtonLink"
|
|
301
344
|
}, e.dataAttributes),
|
|
302
345
|
children: V({
|
|
303
|
-
showSpinner:
|
|
304
|
-
shouldRenderSpinner:
|
|
305
|
-
setShouldRenderSpinner:
|
|
346
|
+
showSpinner: a,
|
|
347
|
+
shouldRenderSpinner: r,
|
|
348
|
+
setShouldRenderSpinner: v,
|
|
306
349
|
children: e.children,
|
|
307
|
-
loadingText:
|
|
350
|
+
loadingText: l,
|
|
308
351
|
small: !0,
|
|
309
|
-
renderText:
|
|
310
|
-
textContentStyle: p
|
|
352
|
+
renderText: S,
|
|
353
|
+
textContentStyle: p,
|
|
354
|
+
StartIcon: e.StartIcon,
|
|
355
|
+
EndIcon: e.EndIcon,
|
|
356
|
+
withChevron: s
|
|
311
357
|
}),
|
|
312
|
-
disabled: e.disabled ||
|
|
358
|
+
disabled: e.disabled || a || g
|
|
313
359
|
};
|
|
314
360
|
if (process.env.NODE_ENV !== "production" && (e.to === "" || e.href === "")) throw Error("to or href props are empty strings");
|
|
315
|
-
if (e.onPress) return /* @__PURE__ */ t(
|
|
316
|
-
ref:
|
|
317
|
-
},
|
|
318
|
-
onPress: (
|
|
319
|
-
const
|
|
320
|
-
|
|
361
|
+
if (e.onPress) return /* @__PURE__ */ t(y, _object_spread_props(_object_spread({
|
|
362
|
+
ref: i
|
|
363
|
+
}, E), {
|
|
364
|
+
onPress: (h)=>{
|
|
365
|
+
const I = e.onPress(h);
|
|
366
|
+
I && (m(!0), I.finally(()=>m(!1)));
|
|
321
367
|
}
|
|
322
368
|
}));
|
|
323
|
-
if (e.to || e.to === "") return /* @__PURE__ */ t(
|
|
324
|
-
ref:
|
|
325
|
-
},
|
|
369
|
+
if (e.to || e.to === "") return /* @__PURE__ */ t(y, _object_spread_props(_object_spread({
|
|
370
|
+
ref: i
|
|
371
|
+
}, E), {
|
|
326
372
|
to: e.to,
|
|
327
373
|
fullPageOnWebView: e.fullPageOnWebView
|
|
328
374
|
}));
|
|
329
|
-
if (e.href || e.href === "") return /* @__PURE__ */ t(
|
|
330
|
-
ref:
|
|
331
|
-
},
|
|
375
|
+
if (e.href || e.href === "") return /* @__PURE__ */ t(y, _object_spread_props(_object_spread({
|
|
376
|
+
ref: i
|
|
377
|
+
}, E), {
|
|
332
378
|
href: e.href,
|
|
333
379
|
newTab: e.newTab
|
|
334
380
|
}));
|
|
335
381
|
if (process.env.NODE_ENV !== "production") throw Error("Bad button props");
|
|
336
382
|
return null;
|
|
337
|
-
}), we = /*#__PURE__*/
|
|
338
|
-
var { dataAttributes: e } = _param,
|
|
383
|
+
}), we = /*#__PURE__*/ o.forwardRef((_param, n)=>/* @__PURE__ */ {
|
|
384
|
+
var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
|
|
339
385
|
"dataAttributes"
|
|
340
386
|
]);
|
|
341
|
-
return t(
|
|
387
|
+
return t(N, _object_spread_props(_object_spread({
|
|
342
388
|
dataAttributes: _object_spread({
|
|
343
389
|
"component-name": "ButtonPrimary"
|
|
344
390
|
}, e)
|
|
345
|
-
},
|
|
391
|
+
}, i), {
|
|
346
392
|
ref: n,
|
|
347
393
|
type: "primary"
|
|
348
394
|
}));
|
|
349
|
-
}), Ne = /*#__PURE__*/
|
|
350
|
-
var { dataAttributes: e } = _param,
|
|
395
|
+
}), Ne = /*#__PURE__*/ o.forwardRef((_param, n)=>/* @__PURE__ */ {
|
|
396
|
+
var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
|
|
351
397
|
"dataAttributes"
|
|
352
398
|
]);
|
|
353
|
-
return t(
|
|
399
|
+
return t(N, _object_spread_props(_object_spread({
|
|
354
400
|
dataAttributes: _object_spread({
|
|
355
401
|
"component-name": "ButtonSecondary"
|
|
356
402
|
}, e)
|
|
357
|
-
},
|
|
403
|
+
}, i), {
|
|
358
404
|
ref: n,
|
|
359
405
|
type: "secondary"
|
|
360
406
|
}));
|
|
361
|
-
}), _e = /*#__PURE__*/
|
|
362
|
-
var { dataAttributes: e } = _param,
|
|
407
|
+
}), _e = /*#__PURE__*/ o.forwardRef((_param, n)=>/* @__PURE__ */ {
|
|
408
|
+
var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
|
|
363
409
|
"dataAttributes"
|
|
364
410
|
]);
|
|
365
|
-
return t(
|
|
411
|
+
return t(N, _object_spread_props(_object_spread({
|
|
366
412
|
dataAttributes: _object_spread({
|
|
367
413
|
"component-name": "ButtonDanger"
|
|
368
414
|
}, e)
|
|
369
|
-
},
|
|
415
|
+
}, i), {
|
|
370
416
|
ref: n,
|
|
371
417
|
type: "danger"
|
|
372
418
|
}));
|
|
373
419
|
});
|
|
374
|
-
export { _e as ButtonDanger,
|
|
420
|
+
export { _e as ButtonDanger, Ce as ButtonLink, we as ButtonPrimary, Ne as ButtonSecondary };
|