@telefonica/mistica 15.17.0 → 15.19.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 (74) hide show
  1. package/css/mistica.css +1 -1
  2. package/dist/button.css-mistica.js +61 -52
  3. package/dist/button.css.d.ts +33 -17
  4. package/dist/button.d.ts +9 -46
  5. package/dist/button.js +188 -237
  6. package/dist/callout.d.ts +1 -0
  7. package/dist/callout.js +10 -10
  8. package/dist/card.d.ts +6 -1
  9. package/dist/card.js +375 -365
  10. package/dist/chip.d.ts +1 -0
  11. package/dist/chip.js +15 -15
  12. package/dist/dialog.d.ts +1 -0
  13. package/dist/dialog.js +18 -17
  14. package/dist/feedback.js +58 -52
  15. package/dist/inline.css-mistica.js +11 -8
  16. package/dist/inline.css.d.ts +1 -0
  17. package/dist/inline.js +12 -12
  18. package/dist/logo-blau.d.ts +4 -0
  19. package/dist/logo-blau.js +74 -0
  20. package/dist/logo-common.d.ts +9 -0
  21. package/dist/logo-common.js +21 -0
  22. package/dist/logo-movistar.d.ts +4 -0
  23. package/dist/logo-movistar.js +99 -0
  24. package/dist/logo-o2-new.d.ts +4 -0
  25. package/dist/logo-o2-new.js +29 -0
  26. package/dist/logo-o2.d.ts +4 -0
  27. package/dist/logo-o2.js +29 -0
  28. package/dist/logo-telefonica.d.ts +4 -0
  29. package/dist/logo-telefonica.js +197 -0
  30. package/dist/logo-tu.d.ts +4 -0
  31. package/dist/logo-tu.js +28 -0
  32. package/dist/logo-vivo.d.ts +4 -0
  33. package/dist/logo-vivo.js +81 -0
  34. package/dist/logo.d.ts +10 -10
  35. package/dist/logo.js +174 -534
  36. package/dist/navigation-bar.d.ts +7 -0
  37. package/dist/navigation-bar.js +99 -91
  38. package/dist/package-version.js +1 -1
  39. package/dist/popover.d.ts +1 -0
  40. package/dist/popover.js +9 -7
  41. package/dist/snackbar-context.js +23 -22
  42. package/dist/snackbar.d.ts +1 -0
  43. package/dist/snackbar.js +51 -47
  44. package/dist/text.d.ts +1 -0
  45. package/dist/text.js +133 -109
  46. package/dist/tooltip.d.ts +1 -0
  47. package/dist/tooltip.js +110 -110
  48. package/dist-es/button.css-mistica.js +36 -18
  49. package/dist-es/button.js +219 -268
  50. package/dist-es/callout.js +38 -38
  51. package/dist-es/card.js +492 -482
  52. package/dist-es/chip.js +25 -25
  53. package/dist-es/dialog.js +22 -21
  54. package/dist-es/feedback.js +96 -89
  55. package/dist-es/inline.css-mistica.js +3 -3
  56. package/dist-es/inline.js +23 -23
  57. package/dist-es/logo-blau.js +65 -0
  58. package/dist-es/logo-common.js +12 -0
  59. package/dist-es/logo-movistar.js +90 -0
  60. package/dist-es/logo-o2-new.js +20 -0
  61. package/dist-es/logo-o2.js +20 -0
  62. package/dist-es/logo-telefonica.js +188 -0
  63. package/dist-es/logo-tu.js +19 -0
  64. package/dist-es/logo-vivo.js +72 -0
  65. package/dist-es/logo.js +132 -533
  66. package/dist-es/navigation-bar.js +163 -155
  67. package/dist-es/package-version.js +1 -1
  68. package/dist-es/popover.js +26 -24
  69. package/dist-es/snackbar-context.js +25 -24
  70. package/dist-es/snackbar.js +81 -77
  71. package/dist-es/style.css +1 -1
  72. package/dist-es/text.js +143 -119
  73. package/dist-es/tooltip.js +149 -149
  74. package/package.json +1 -1
package/dist-es/button.js CHANGED
@@ -78,256 +78,263 @@ function _object_without_properties_loose(source, excluded) {
78
78
  }
79
79
  return target;
80
80
  }
81
- import { jsx as n, jsxs as E, Fragment as W } from "react/jsx-runtime";
81
+ import { jsx as t, jsxs as w, Fragment as F } from "react/jsx-runtime";
82
82
  import * as a from "react";
83
- import D from "classnames";
84
- import K from "./spinner.js";
85
- import { BaseTouchable as g } from "./touchable.js";
86
- import { useIsInverseVariant as O } from "./theme-variant-context.js";
87
- import { useForm as V } from "./form-context.js";
88
- import { pxToRem as w } from "./utils/css.js";
89
- import { Text as j, Text3 as H, Text2 as Y } from "./text.js";
90
- import $ from "./box.js";
91
- import { getTextFromChildren as P } from "./utils/common.js";
92
- import { useTrackingConfig as F, eventNames as z, eventCategories as M, eventActions as q } from "./utils/analytics.js";
93
- import { useTheme as S } from "./hooks.js";
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 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
- import { VIVO_NEW_SKIN as fe } from "./skins/constants.js";
97
- const k = (param)=>{
98
- let { content: e, defaultIconSize: t, renderText: i } = param;
99
- const l = J(e), u = l.length, c = [];
100
- let s = [];
101
- const f = ()=>{
102
- c.push(/* @__PURE__ */ n(a.Fragment, {
103
- children: i(s)
104
- }, c.length)), s = [];
83
+ import M from "classnames";
84
+ import j from "./spinner.js";
85
+ import { BaseTouchable as L } from "./touchable.js";
86
+ import { useIsInverseVariant as Y } from "./theme-variant-context.js";
87
+ import { useForm as Z } from "./form-context.js";
88
+ import { applyCssVars as H, pxToRem as K } from "./utils/css.js";
89
+ import { Text as X, Text3 as _, Text2 as q } from "./text.js";
90
+ import G from "./box.js";
91
+ import { getTextFromChildren as V } from "./utils/common.js";
92
+ import { useTrackingConfig as J, eventNames as Q, eventCategories as U, eventActions as z } from "./utils/analytics.js";
93
+ import { useTheme as E } from "./hooks.js";
94
+ import { flattenChildren as p } from "./skins/utils.js";
95
+ import { linkMinWidth as ee, buttonMinWidth as te, inverseButtonVariants as ne, buttonVariants as ie, small as re, isLoading as ae, buttonVars as oe, borderSize as B, buttonPaddingX as v, buttonPaddingY as R, textContent as le, iconMargin as k, chevronMarginLeft as se, loadingFiller as ce, loadingContent as de, iconSize as D, spinnerSize as $ } from "./button.css-mistica.js";
96
+ import { VIVO_NEW_SKIN as ue } from "./skins/constants.js";
97
+ const A = (param)=>{
98
+ let { small: e, content: i, defaultIconSize: n, TextContentRenderer: r } = param;
99
+ const f = p(i), g = f.length, l = [];
100
+ let c = [];
101
+ const m = ()=>{
102
+ l.push(/* @__PURE__ */ t(a.Fragment, {
103
+ children: r(c, e)
104
+ }, l.length)), c = [];
105
105
  };
106
- return l.forEach((d, m)=>{
107
- const h = m === 0, o = m === u - 1;
108
- if (/*#__PURE__*/ a.isValidElement(d)) {
109
- s.length && f();
110
- var _d_props_size;
111
- const v = (_d_props_size = d.props.size) !== null && _d_props_size !== void 0 ? _d_props_size : t;
112
- c.push(/* @__PURE__ */ n("div", {
106
+ return f.forEach((s, d)=>{
107
+ const u = d === 0, o = d === g - 1;
108
+ if (/*#__PURE__*/ a.isValidElement(s)) {
109
+ c.length && m();
110
+ const y = s.props.size !== void 0 ? K(s.props.size) : n;
111
+ l.push(/* @__PURE__ */ t("div", {
113
112
  style: {
114
113
  display: "flex",
115
114
  alignItems: "center",
116
- marginLeft: h ? 0 : C,
117
- marginRight: o ? 0 : C
115
+ marginLeft: u ? 0 : k,
116
+ marginRight: o ? 0 : k
118
117
  },
119
- children: /*#__PURE__*/ a.cloneElement(d, {
120
- size: w(v)
118
+ children: /*#__PURE__*/ a.cloneElement(s, {
119
+ size: y
121
120
  })
122
- }, c.length));
123
- } else s.push(d), o && f();
124
- }), c;
125
- }, he = ()=>{
126
- const { skinName: e } = S();
127
- return e === fe ? /* @__PURE__ */ n("svg", {
121
+ }, l.length));
122
+ } else c.push(s), o && m();
123
+ }), l;
124
+ }, me = ()=>{
125
+ const { skinName: e } = E();
126
+ return e === ue ? /* @__PURE__ */ t("svg", {
128
127
  width: "0.5em",
129
128
  height: "0.5em",
130
129
  viewBox: "0 0 8 8",
131
130
  fill: "none",
132
- children: /* @__PURE__ */ n("path", {
131
+ children: /* @__PURE__ */ t("path", {
133
132
  d: "M5.11111 3.68886L2.73534 1.30383C2.63671 1.21526 2.51339 1.1909 2.4052 1.20285C2.29952 1.21452 2.19613 1.26162 2.12144 1.33458C2.04957 1.40271 2.00869 1.50793 2.00126 1.60783C1.9934 1.71334 2.02104 1.83978 2.12131 1.93639L4.33333 4.07775L2.11406 6.20689L2.11057 6.21056L2.10821 6.21315L2.10381 6.21806C2.01525 6.31669 1.99089 6.44001 2.00284 6.5482C2.01451 6.65388 2.06161 6.75727 2.13456 6.83196C2.20269 6.90383 2.30792 6.94471 2.40782 6.95215C2.51332 6.96 2.63976 6.93237 2.73638 6.83209L5.11111 4.46664C5.32589 4.25186 5.32589 3.90364 5.11111 3.68886Z",
134
133
  fill: "currentColor"
135
134
  })
136
- }) : /* @__PURE__ */ n("svg", {
135
+ }) : /* @__PURE__ */ t("svg", {
137
136
  width: "0.5em",
138
137
  height: "0.5em",
139
138
  viewBox: "0 0 8 8",
140
- children: /* @__PURE__ */ n("path", {
139
+ children: /* @__PURE__ */ t("path", {
141
140
  d: "M6.32595 3.46071L3.03801 0.158595L3.03292 0.153747L3.032 0.152903L3.02931 0.150463L3.02848 0.149738L3.02248 0.144353C2.88533 0.021206 2.71386 -0.0126731 2.56343 0.00394249C2.41648 0.0201739 2.27272 0.0856702 2.16886 0.18711C2.06893 0.281844 2.01209 0.42816 2.00175 0.567065C1.99083 0.71377 2.02925 0.889583 2.16869 1.02392L5.24446 4.00145L2.15859 6.96199L2.15375 6.96708L2.1529 6.968L2.15046 6.97069L2.14974 6.97152L2.14435 6.97752C2.02121 7.11467 1.98733 7.28614 2.00394 7.43657C2.02017 7.58352 2.08567 7.72728 2.18711 7.83114C2.28184 7.93107 2.42816 7.98791 2.56706 7.99825C2.71377 8.00917 2.88958 7.97075 3.02392 7.83132L6.32595 4.5422V4.5422C6.6246 4.24355 6.6246 3.75935 6.32595 3.46071V3.46071Z",
142
141
  fill: "currentColor"
143
142
  })
144
143
  });
145
- }, X = (param)=>{
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 = w(i ? re : ae);
148
- return /* @__PURE__ */ E(W, {
144
+ }, fe = (param)=>{
145
+ let { showSpinner: e, children: i, small: n, loadingText: r, shouldRenderSpinner: f, setShouldRenderSpinner: g, TextContentRenderer: l, StartIcon: c, EndIcon: m, withChevron: s } = param;
146
+ const d = n ? D.small : D.default, u = n ? $.small : $.default, o = A({
147
+ small: n,
148
+ content: i,
149
+ defaultIconSize: d,
150
+ TextContentRenderer: l
151
+ }), C = A({
152
+ small: n,
153
+ content: r,
154
+ defaultIconSize: d,
155
+ TextContentRenderer: l
156
+ });
157
+ return /* @__PURE__ */ w(F, {
149
158
  children: [
150
- /* @__PURE__ */ E("div", {
159
+ /* @__PURE__ */ w("div", {
151
160
  "aria-hidden": e ? !0 : void 0,
152
- className: f,
161
+ className: le,
153
162
  children: [
154
- d && /* @__PURE__ */ n("div", {
163
+ c && /* @__PURE__ */ t("div", {
155
164
  style: {
156
165
  display: "flex",
157
166
  alignItems: "center",
158
- marginRight: C
167
+ marginRight: k
159
168
  },
160
- children: /* @__PURE__ */ n(d, {
161
- size: w(o),
169
+ children: /* @__PURE__ */ t(c, {
170
+ size: d,
162
171
  color: "currentColor"
163
172
  })
164
173
  }),
165
- /* @__PURE__ */ E("div", {
174
+ /* @__PURE__ */ w("div", {
166
175
  style: {
167
176
  display: "flex",
168
177
  alignItems: "baseline"
169
178
  },
170
179
  children: [
171
- k({
172
- content: t,
173
- defaultIconSize: o,
174
- renderText: s
175
- }),
176
- h && /* @__PURE__ */ n("div", {
180
+ o,
181
+ s && /* @__PURE__ */ t("div", {
177
182
  style: {
178
183
  display: "flex",
179
184
  alignItems: "center",
180
- marginLeft: oe
185
+ marginLeft: se
181
186
  },
182
- children: /* @__PURE__ */ n(he, {})
187
+ children: /* @__PURE__ */ t(me, {})
183
188
  })
184
189
  ]
185
190
  }),
186
- m && !h && /* @__PURE__ */ n("div", {
191
+ m && !s && /* @__PURE__ */ t("div", {
187
192
  style: {
188
193
  display: "flex",
189
194
  alignItems: "center",
190
- marginLeft: C
195
+ marginLeft: k
191
196
  },
192
- children: /* @__PURE__ */ n(m, {
193
- size: w(o),
197
+ children: /* @__PURE__ */ t(m, {
198
+ size: d,
194
199
  color: "currentColor"
195
200
  })
196
201
  })
197
202
  ]
198
203
  }),
199
- /* @__PURE__ */ n("div", {
200
- className: le,
204
+ /* @__PURE__ */ t("div", {
205
+ className: ce,
201
206
  "aria-hidden": !0,
202
- style: l ? {
203
- paddingLeft: r,
204
- paddingRight: C + 2 * (i ? se : ce)
207
+ style: r ? {
208
+ paddingLeft: u,
209
+ paddingRight: `calc(${k} + 2 * ${n ? v.small : v.default})`
205
210
  } : void 0,
206
- children: k({
207
- content: l,
208
- defaultIconSize: o,
209
- renderText: s
210
- })
211
+ children: C
211
212
  }),
212
- /* @__PURE__ */ E("div", {
213
+ /* @__PURE__ */ w("div", {
213
214
  "aria-hidden": e ? void 0 : !0,
214
215
  className: de,
215
216
  onTransitionEnd: ()=>{
216
- e !== u && c(e);
217
+ e !== f && g(e);
217
218
  },
218
219
  children: [
219
- u ? /* @__PURE__ */ n(K, {
220
- rolePresentation: !!l,
220
+ f ? /* @__PURE__ */ t(j, {
221
+ rolePresentation: !!r,
221
222
  color: "currentcolor",
222
223
  delay: "0s",
223
- size: r
224
- }) : /* @__PURE__ */ n("div", {
224
+ size: u
225
+ }) : /* @__PURE__ */ t("div", {
225
226
  style: {
226
227
  display: "inline-block",
227
- width: r,
228
- height: r
228
+ width: u,
229
+ height: u
229
230
  }
230
231
  }),
231
- l ? /* @__PURE__ */ n($, {
232
+ r ? /* @__PURE__ */ t(G, {
232
233
  paddingLeft: 8,
233
- children: k({
234
- content: l,
235
- defaultIconSize: o,
236
- renderText: s
237
- })
234
+ children: C
238
235
  }) : null
239
236
  ]
240
237
  })
241
238
  ]
242
239
  });
243
- }, R = /*#__PURE__*/ a.forwardRef((e, t)=>{
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);
240
+ }, x = /*#__PURE__*/ a.forwardRef((e, i)=>{
241
+ var _e_withChevron;
242
+ const { eventFormat: n } = J(), { formStatus: r, formId: f } = Z(), g = Y(), { loadingText: l } = e, c = !!e.submit, m = r === "sending", { isDarkMode: s } = E(), [d, u] = a.useState(!1), o = e.showSpinner || m && c || d, C = (_e_withChevron = e.withChevron) !== null && _e_withChevron !== void 0 ? _e_withChevron : e.buttonType.startsWith("link") && (!!e.href || !!e.to), [y, P] = a.useState(!!o);
245
243
  a.useEffect(()=>{
246
- r && !v && L(!0);
244
+ o && !y && P(!0);
247
245
  }, [
248
- r,
249
- v,
250
- u
246
+ o,
247
+ y,
248
+ r
251
249
  ]);
252
250
  var _e_trackingEvent;
253
- const N = ()=>l === "google-analytics-4" ? {
254
- name: z.userInteraction,
255
- component_type: `${e.type}_button`,
256
- component_copy: P(e.children)
251
+ const W = ()=>{
252
+ let b, h;
253
+ switch(e.buttonType){
254
+ case "link":
255
+ b = "link", h = z.linkTapped;
256
+ break;
257
+ case "linkDanger":
258
+ b = "danger_link", h = z.linkTapped;
259
+ break;
260
+ default:
261
+ b = `${e.buttonType}_button`, h = `${e.buttonType}_button_tapped`;
262
+ break;
263
+ }
264
+ return n === "google-analytics-4" ? {
265
+ name: Q.userInteraction,
266
+ component_type: b,
267
+ component_copy: V(e.children)
257
268
  } : {
258
- category: M.userInteraction,
259
- action: `${e.type}_button_tapped`,
260
- label: P(e.children)
261
- }, _ = (I)=>e.small ? /* @__PURE__ */ n(j, {
262
- size: 14,
263
- lineHeight: 20,
264
- weight: i.button.weight,
265
- truncate: 1,
266
- color: "inherit",
267
- as: "div",
268
- children: I
269
- }) : /* @__PURE__ */ n(H, {
270
- weight: i.button.weight,
271
- truncate: 1,
272
- color: "inherit",
273
- as: "div",
274
- children: I
275
- }), b = {
276
- ref: t,
277
- className: D(s ? Q[e.type] : U[e.type], e.className, {
278
- [p]: e.small,
279
- [G]: r
269
+ category: U.userInteraction,
270
+ action: h,
271
+ label: V(e.children)
272
+ };
273
+ }, N = e.buttonType.startsWith("link") ? ee : te, S = e.buttonType === "linkDanger" && s && g ? "linkDangerDark" : e.buttonType, T = {
274
+ ref: i,
275
+ className: M(g ? ne[S] : ie[S], e.className, {
276
+ [re]: e.small,
277
+ [ae]: o
280
278
  }),
281
- style: _object_spread({
279
+ style: _object_spread(_object_spread_props(_object_spread({}, H({
280
+ [oe.minWidth]: e.small ? N.small : N.default
281
+ }), e.bleedLeft ? {
282
+ marginLeft: `calc(-1 * (${B} + ${e.small ? v.small : v.default}))`
283
+ } : void 0, e.bleedRight ? {
284
+ marginRight: `calc(-1 * (${B} + ${e.small ? v.small : v.default}))`
285
+ } : void 0, e.bleedY ? {
286
+ marginTop: `calc(-1 * (${B} + ${e.small ? R.small : R.default}))`,
287
+ marginBottom: `calc(-1 * (${B} + ${e.small ? R.small : R.default}))`
288
+ } : void 0), {
282
289
  cursor: e.fake ? "pointer" : void 0
283
- }, e.style),
284
- trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ? N() : void 0,
290
+ }), e.style),
291
+ trackingEvent: (_e_trackingEvent = e.trackingEvent) !== null && _e_trackingEvent !== void 0 ? _e_trackingEvent : e.trackEvent ? W() : void 0,
285
292
  dataAttributes: e.dataAttributes,
286
293
  "aria-label": e["aria-label"],
287
294
  "aria-controls": e["aria-controls"],
288
295
  "aria-expanded": e["aria-expanded"],
289
296
  "aria-haspopup": e["aria-haspopup"],
290
297
  tabIndex: e.tabIndex,
291
- children: X({
292
- showSpinner: r,
293
- shouldRenderSpinner: v,
294
- setShouldRenderSpinner: L,
298
+ children: fe({
299
+ showSpinner: o,
300
+ shouldRenderSpinner: y,
301
+ setShouldRenderSpinner: P,
295
302
  children: e.children,
296
- loadingText: f,
303
+ loadingText: l,
297
304
  small: e.small,
298
- renderText: _,
299
- textContentStyle: ee,
305
+ TextContentRenderer: e.TextContentRenderer,
300
306
  StartIcon: e.StartIcon,
301
- EndIcon: e.EndIcon
307
+ EndIcon: e.EndIcon,
308
+ withChevron: C
302
309
  }),
303
- disabled: e.disabled || r || m,
310
+ disabled: e.disabled || o || m,
304
311
  role: e.role
305
312
  };
306
313
  if (process.env.NODE_ENV !== "production" && (e.to === "" || e.href === "")) throw Error("to or href props are empty strings");
307
- if (e.fake) return /* @__PURE__ */ n(g, _object_spread_props(_object_spread({
314
+ if (e.fake) return /* @__PURE__ */ t(L, _object_spread_props(_object_spread({
308
315
  maybe: !0
309
- }, b), {
316
+ }, T), {
310
317
  role: "presentation",
311
318
  "aria-hidden": "true"
312
319
  }));
313
- if (e.submit) return /* @__PURE__ */ n(g, _object_spread({
320
+ if (e.submit) return /* @__PURE__ */ t(L, _object_spread({
314
321
  type: "submit",
315
- formId: c,
322
+ formId: f,
316
323
  onPress: ()=>{}
317
- }, b));
318
- if (e.onPress) return /* @__PURE__ */ n(g, _object_spread_props(_object_spread({}, b), {
319
- onPress: (I)=>{
320
- const y = e.onPress(I);
321
- y && (o(!0), y.finally(()=>o(!1)));
324
+ }, T));
325
+ if (e.onPress) return /* @__PURE__ */ t(L, _object_spread_props(_object_spread({}, T), {
326
+ onPress: (b)=>{
327
+ const h = e.onPress(b);
328
+ h && (u(!0), h.finally(()=>u(!1)));
322
329
  }
323
330
  }));
324
- if (e.to || e.to === "") return /* @__PURE__ */ n(g, _object_spread_props(_object_spread({}, b), {
331
+ if (e.to || e.to === "") return /* @__PURE__ */ t(L, _object_spread_props(_object_spread({}, T), {
325
332
  to: e.to,
326
333
  newTab: e.newTab,
327
334
  fullPageOnWebView: e.fullPageOnWebView,
328
335
  onNavigate: e.onNavigate
329
336
  }));
330
- if (e.href || e.href === "") return /* @__PURE__ */ n(g, _object_spread_props(_object_spread({}, b), {
337
+ if (e.href || e.href === "") return /* @__PURE__ */ t(L, _object_spread_props(_object_spread({}, T), {
331
338
  href: e.href,
332
339
  newTab: e.newTab,
333
340
  loadOnTop: e.loadOnTop,
@@ -335,156 +342,100 @@ const k = (param)=>{
335
342
  }));
336
343
  if (process.env.NODE_ENV !== "production") throw Error("Bad button props");
337
344
  return null;
338
- }), Z = /*#__PURE__*/ a.forwardRef((_param, i)=>{
339
- var { type: e } = _param, t = _object_without_properties(_param, [
340
- "type"
341
- ]);
342
- var _t_withChevron;
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);
344
- a.useEffect(()=>{
345
- r && !L && N(!0);
346
- }, [
347
- r,
348
- L,
349
- l
350
- ]);
351
- var _t_trackingEvent;
352
- const _ = ()=>s === "google-analytics-4" ? {
353
- name: z.userInteraction,
354
- component_type: e === "danger" ? "danger_link" : "link",
355
- component_copy: P(t.children)
356
- } : {
357
- category: M.userInteraction,
358
- action: q.linkTapped,
359
- label: P(t.children)
360
- }, b = (x)=>/* @__PURE__ */ n(Y, {
361
- weight: c.button.weight,
362
- truncate: 1,
363
- color: "inherit",
364
- children: x
365
- }), I = e === "danger" && f && u ? "dangerDark" : e, y = {
366
- className: D(u ? te[I] : ne[I], {
367
- [G]: r
368
- }),
369
- /**
370
- * Setting bleed classes with style to override the margin:0 set by the Touchable component.
371
- * If we set it using className, it may not work depending on the order in which the styles are applied.
372
- */ style: _object_spread({}, t.bleedLeft ? {
373
- marginLeft: -T
374
- } : void 0, t.bleedRight ? {
375
- marginRight: -T
376
- } : void 0, t.bleedY ? {
377
- marginTop: -A,
378
- marginBottom: -A
379
- } : void 0),
380
- trackingEvent: (_t_trackingEvent = t.trackingEvent) !== null && _t_trackingEvent !== void 0 ? _t_trackingEvent : t.trackEvent ? _() : void 0,
381
- dataAttributes: t.dataAttributes,
382
- "aria-label": t["aria-label"],
383
- "aria-controls": t["aria-controls"],
384
- "aria-expanded": t["aria-expanded"],
385
- "aria-haspopup": t["aria-haspopup"],
386
- children: X({
387
- showSpinner: r,
388
- shouldRenderSpinner: L,
389
- setShouldRenderSpinner: N,
390
- children: t.children,
391
- loadingText: d,
392
- small: !0,
393
- renderText: b,
394
- textContentStyle: ie,
395
- StartIcon: t.StartIcon,
396
- EndIcon: t.EndIcon,
397
- withChevron: v
398
- }),
399
- disabled: t.disabled || r || m,
400
- role: t.role
401
- };
402
- if (process.env.NODE_ENV !== "production" && (t.to === "" || t.href === "")) throw Error("to or href props are empty strings");
403
- if (t.onPress) return /* @__PURE__ */ n(g, _object_spread_props(_object_spread({
404
- ref: i
405
- }, y), {
406
- onPress: (x)=>{
407
- const B = t.onPress(x);
408
- B && (o(!0), B.finally(()=>o(!1)));
409
- }
410
- }));
411
- if (t.to || t.to === "") return /* @__PURE__ */ n(g, _object_spread_props(_object_spread({
412
- ref: i
413
- }, y), {
414
- to: t.to,
415
- newTab: t.newTab,
416
- fullPageOnWebView: t.fullPageOnWebView,
417
- onNavigate: t.onNavigate
418
- }));
419
- if (t.href || t.href === "") return /* @__PURE__ */ n(g, _object_spread_props(_object_spread({
420
- ref: i
421
- }, y), {
422
- href: t.href,
423
- newTab: t.newTab,
424
- onNavigate: t.onNavigate
425
- }));
426
- if (process.env.NODE_ENV !== "production") throw Error("Bad button props");
427
- return null;
428
- }), Re = /*#__PURE__*/ a.forwardRef((_param, i)=>{
429
- var { dataAttributes: e } = _param, t = _object_without_properties(_param, [
430
- "dataAttributes"
345
+ }), I = (e, i)=>{
346
+ const { textPresets: n } = E();
347
+ return i ? /* @__PURE__ */ t(X, {
348
+ size: 14,
349
+ lineHeight: 20,
350
+ weight: n.button.weight,
351
+ truncate: 1,
352
+ color: "inherit",
353
+ as: "div",
354
+ children: e
355
+ }) : /* @__PURE__ */ t(_, {
356
+ weight: n.button.weight,
357
+ truncate: 1,
358
+ color: "inherit",
359
+ as: "div",
360
+ children: e
361
+ });
362
+ }, O = (e, i)=>{
363
+ const { textPresets: n } = E();
364
+ return /* @__PURE__ */ t(i ? q : _, {
365
+ weight: n.button.weight,
366
+ truncate: 1,
367
+ color: "inherit",
368
+ children: e
369
+ });
370
+ }, Pe = /*#__PURE__*/ a.forwardRef((_param, r)=>{
371
+ var { dataAttributes: e, small: i } = _param, n = _object_without_properties(_param, [
372
+ "dataAttributes",
373
+ "small"
431
374
  ]);
432
- return /* @__PURE__ */ n(Z, _object_spread_props(_object_spread({
375
+ return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
433
376
  dataAttributes: _object_spread({
434
377
  "component-name": "ButtonLink"
435
378
  }, e)
436
- }, t), {
437
- ref: i,
438
- type: "default"
379
+ }, n), {
380
+ small: !0,
381
+ ref: r,
382
+ buttonType: "link",
383
+ TextContentRenderer: O
439
384
  }));
440
- }), Be = /*#__PURE__*/ a.forwardRef((_param, i)=>{
441
- var { dataAttributes: e } = _param, t = _object_without_properties(_param, [
442
- "dataAttributes"
385
+ }), Ne = /*#__PURE__*/ a.forwardRef((_param, r)=>{
386
+ var { dataAttributes: e, small: i } = _param, n = _object_without_properties(_param, [
387
+ "dataAttributes",
388
+ "small"
443
389
  ]);
444
- return /* @__PURE__ */ n(Z, _object_spread_props(_object_spread({
390
+ return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
445
391
  dataAttributes: _object_spread({
446
392
  "component-name": "ButtonLinkDanger"
447
393
  }, e)
448
- }, t), {
394
+ }, n), {
449
395
  withChevron: !1,
450
- ref: i,
451
- type: "danger"
396
+ small: !0,
397
+ ref: r,
398
+ buttonType: "linkDanger",
399
+ TextContentRenderer: O
452
400
  }));
453
- }), Te = /*#__PURE__*/ a.forwardRef((_param, i)=>{
454
- var { dataAttributes: e } = _param, t = _object_without_properties(_param, [
401
+ }), Se = /*#__PURE__*/ a.forwardRef((_param, n)=>{
402
+ var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
455
403
  "dataAttributes"
456
404
  ]);
457
- return /* @__PURE__ */ n(R, _object_spread_props(_object_spread({
405
+ return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
458
406
  dataAttributes: _object_spread({
459
407
  "component-name": "ButtonPrimary"
460
408
  }, e)
461
- }, t), {
462
- ref: i,
463
- type: "primary"
409
+ }, i), {
410
+ ref: n,
411
+ buttonType: "primary",
412
+ TextContentRenderer: I
464
413
  }));
465
- }), Ae = /*#__PURE__*/ a.forwardRef((_param, i)=>{
466
- var { dataAttributes: e } = _param, t = _object_without_properties(_param, [
414
+ }), Ve = /*#__PURE__*/ a.forwardRef((_param, n)=>{
415
+ var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
467
416
  "dataAttributes"
468
417
  ]);
469
- return /* @__PURE__ */ n(R, _object_spread_props(_object_spread({
418
+ return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
470
419
  dataAttributes: _object_spread({
471
420
  "component-name": "ButtonSecondary"
472
421
  }, e)
473
- }, t), {
474
- ref: i,
475
- type: "secondary"
422
+ }, i), {
423
+ ref: n,
424
+ buttonType: "secondary",
425
+ TextContentRenderer: I
476
426
  }));
477
- }), De = /*#__PURE__*/ a.forwardRef((_param, i)=>{
478
- var { dataAttributes: e } = _param, t = _object_without_properties(_param, [
427
+ }), ze = /*#__PURE__*/ a.forwardRef((_param, n)=>{
428
+ var { dataAttributes: e } = _param, i = _object_without_properties(_param, [
479
429
  "dataAttributes"
480
430
  ]);
481
- return /* @__PURE__ */ n(R, _object_spread_props(_object_spread({
431
+ return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
482
432
  dataAttributes: _object_spread({
483
433
  "component-name": "ButtonDanger"
484
434
  }, e)
485
- }, t), {
486
- ref: i,
487
- type: "danger"
435
+ }, i), {
436
+ ref: n,
437
+ buttonType: "danger",
438
+ TextContentRenderer: I
488
439
  }));
489
440
  });
490
- export { De as ButtonDanger, Re as ButtonLink, Be as ButtonLinkDanger, Te as ButtonPrimary, Ae as ButtonSecondary };
441
+ export { ze as ButtonDanger, Pe as ButtonLink, Ne as ButtonLinkDanger, Se as ButtonPrimary, Ve as ButtonSecondary };