@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.
- package/css/mistica.css +1 -1
- package/dist/button.css-mistica.js +61 -52
- package/dist/button.css.d.ts +33 -17
- package/dist/button.d.ts +9 -46
- package/dist/button.js +188 -237
- package/dist/callout.d.ts +1 -0
- package/dist/callout.js +10 -10
- package/dist/card.d.ts +6 -1
- package/dist/card.js +375 -365
- package/dist/chip.d.ts +1 -0
- package/dist/chip.js +15 -15
- package/dist/dialog.d.ts +1 -0
- package/dist/dialog.js +18 -17
- package/dist/feedback.js +58 -52
- package/dist/inline.css-mistica.js +11 -8
- package/dist/inline.css.d.ts +1 -0
- package/dist/inline.js +12 -12
- package/dist/logo-blau.d.ts +4 -0
- package/dist/logo-blau.js +74 -0
- package/dist/logo-common.d.ts +9 -0
- package/dist/logo-common.js +21 -0
- package/dist/logo-movistar.d.ts +4 -0
- package/dist/logo-movistar.js +99 -0
- package/dist/logo-o2-new.d.ts +4 -0
- package/dist/logo-o2-new.js +29 -0
- package/dist/logo-o2.d.ts +4 -0
- package/dist/logo-o2.js +29 -0
- package/dist/logo-telefonica.d.ts +4 -0
- package/dist/logo-telefonica.js +197 -0
- package/dist/logo-tu.d.ts +4 -0
- package/dist/logo-tu.js +28 -0
- package/dist/logo-vivo.d.ts +4 -0
- package/dist/logo-vivo.js +81 -0
- package/dist/logo.d.ts +10 -10
- package/dist/logo.js +174 -534
- package/dist/navigation-bar.d.ts +7 -0
- package/dist/navigation-bar.js +99 -91
- package/dist/package-version.js +1 -1
- package/dist/popover.d.ts +1 -0
- package/dist/popover.js +9 -7
- package/dist/snackbar-context.js +23 -22
- package/dist/snackbar.d.ts +1 -0
- package/dist/snackbar.js +51 -47
- package/dist/text.d.ts +1 -0
- package/dist/text.js +133 -109
- package/dist/tooltip.d.ts +1 -0
- package/dist/tooltip.js +110 -110
- package/dist-es/button.css-mistica.js +36 -18
- package/dist-es/button.js +219 -268
- package/dist-es/callout.js +38 -38
- package/dist-es/card.js +492 -482
- package/dist-es/chip.js +25 -25
- package/dist-es/dialog.js +22 -21
- package/dist-es/feedback.js +96 -89
- package/dist-es/inline.css-mistica.js +3 -3
- package/dist-es/inline.js +23 -23
- package/dist-es/logo-blau.js +65 -0
- package/dist-es/logo-common.js +12 -0
- package/dist-es/logo-movistar.js +90 -0
- package/dist-es/logo-o2-new.js +20 -0
- package/dist-es/logo-o2.js +20 -0
- package/dist-es/logo-telefonica.js +188 -0
- package/dist-es/logo-tu.js +19 -0
- package/dist-es/logo-vivo.js +72 -0
- package/dist-es/logo.js +132 -533
- package/dist-es/navigation-bar.js +163 -155
- package/dist-es/package-version.js +1 -1
- package/dist-es/popover.js +26 -24
- package/dist-es/snackbar-context.js +25 -24
- package/dist-es/snackbar.js +81 -77
- package/dist-es/style.css +1 -1
- package/dist-es/text.js +143 -119
- package/dist-es/tooltip.js +149 -149
- 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
|
|
81
|
+
import { jsx as t, jsxs as w, Fragment as F } from "react/jsx-runtime";
|
|
82
82
|
import * as a from "react";
|
|
83
|
-
import
|
|
84
|
-
import
|
|
85
|
-
import { BaseTouchable as
|
|
86
|
-
import { useIsInverseVariant as
|
|
87
|
-
import { useForm as
|
|
88
|
-
import { pxToRem as
|
|
89
|
-
import { Text as
|
|
90
|
-
import
|
|
91
|
-
import { getTextFromChildren as
|
|
92
|
-
import { useTrackingConfig as
|
|
93
|
-
import { useTheme as
|
|
94
|
-
import { flattenChildren as
|
|
95
|
-
import {
|
|
96
|
-
import { VIVO_NEW_SKIN as
|
|
97
|
-
const
|
|
98
|
-
let {
|
|
99
|
-
const
|
|
100
|
-
let
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
children:
|
|
104
|
-
},
|
|
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
|
|
107
|
-
const
|
|
108
|
-
if (/*#__PURE__*/ a.isValidElement(
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
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:
|
|
117
|
-
marginRight: o ? 0 :
|
|
115
|
+
marginLeft: u ? 0 : k,
|
|
116
|
+
marginRight: o ? 0 : k
|
|
118
117
|
},
|
|
119
|
-
children: /*#__PURE__*/ a.cloneElement(
|
|
120
|
-
size:
|
|
118
|
+
children: /*#__PURE__*/ a.cloneElement(s, {
|
|
119
|
+
size: y
|
|
121
120
|
})
|
|
122
|
-
},
|
|
123
|
-
} else
|
|
124
|
-
}),
|
|
125
|
-
},
|
|
126
|
-
const { skinName: e } =
|
|
127
|
-
return e ===
|
|
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__ */
|
|
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__ */
|
|
135
|
+
}) : /* @__PURE__ */ t("svg", {
|
|
137
136
|
width: "0.5em",
|
|
138
137
|
height: "0.5em",
|
|
139
138
|
viewBox: "0 0 8 8",
|
|
140
|
-
children: /* @__PURE__ */
|
|
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
|
-
},
|
|
146
|
-
let { showSpinner: e, children:
|
|
147
|
-
const
|
|
148
|
-
|
|
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__ */
|
|
159
|
+
/* @__PURE__ */ w("div", {
|
|
151
160
|
"aria-hidden": e ? !0 : void 0,
|
|
152
|
-
className:
|
|
161
|
+
className: le,
|
|
153
162
|
children: [
|
|
154
|
-
|
|
163
|
+
c && /* @__PURE__ */ t("div", {
|
|
155
164
|
style: {
|
|
156
165
|
display: "flex",
|
|
157
166
|
alignItems: "center",
|
|
158
|
-
marginRight:
|
|
167
|
+
marginRight: k
|
|
159
168
|
},
|
|
160
|
-
children: /* @__PURE__ */
|
|
161
|
-
size:
|
|
169
|
+
children: /* @__PURE__ */ t(c, {
|
|
170
|
+
size: d,
|
|
162
171
|
color: "currentColor"
|
|
163
172
|
})
|
|
164
173
|
}),
|
|
165
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ w("div", {
|
|
166
175
|
style: {
|
|
167
176
|
display: "flex",
|
|
168
177
|
alignItems: "baseline"
|
|
169
178
|
},
|
|
170
179
|
children: [
|
|
171
|
-
|
|
172
|
-
|
|
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:
|
|
185
|
+
marginLeft: se
|
|
181
186
|
},
|
|
182
|
-
children: /* @__PURE__ */
|
|
187
|
+
children: /* @__PURE__ */ t(me, {})
|
|
183
188
|
})
|
|
184
189
|
]
|
|
185
190
|
}),
|
|
186
|
-
m && !
|
|
191
|
+
m && !s && /* @__PURE__ */ t("div", {
|
|
187
192
|
style: {
|
|
188
193
|
display: "flex",
|
|
189
194
|
alignItems: "center",
|
|
190
|
-
marginLeft:
|
|
195
|
+
marginLeft: k
|
|
191
196
|
},
|
|
192
|
-
children: /* @__PURE__ */
|
|
193
|
-
size:
|
|
197
|
+
children: /* @__PURE__ */ t(m, {
|
|
198
|
+
size: d,
|
|
194
199
|
color: "currentColor"
|
|
195
200
|
})
|
|
196
201
|
})
|
|
197
202
|
]
|
|
198
203
|
}),
|
|
199
|
-
/* @__PURE__ */
|
|
200
|
-
className:
|
|
204
|
+
/* @__PURE__ */ t("div", {
|
|
205
|
+
className: ce,
|
|
201
206
|
"aria-hidden": !0,
|
|
202
|
-
style:
|
|
203
|
-
paddingLeft:
|
|
204
|
-
paddingRight:
|
|
207
|
+
style: r ? {
|
|
208
|
+
paddingLeft: u,
|
|
209
|
+
paddingRight: `calc(${k} + 2 * ${n ? v.small : v.default})`
|
|
205
210
|
} : void 0,
|
|
206
|
-
children:
|
|
207
|
-
content: l,
|
|
208
|
-
defaultIconSize: o,
|
|
209
|
-
renderText: s
|
|
210
|
-
})
|
|
211
|
+
children: C
|
|
211
212
|
}),
|
|
212
|
-
/* @__PURE__ */
|
|
213
|
+
/* @__PURE__ */ w("div", {
|
|
213
214
|
"aria-hidden": e ? void 0 : !0,
|
|
214
215
|
className: de,
|
|
215
216
|
onTransitionEnd: ()=>{
|
|
216
|
-
e !==
|
|
217
|
+
e !== f && g(e);
|
|
217
218
|
},
|
|
218
219
|
children: [
|
|
219
|
-
|
|
220
|
-
rolePresentation: !!
|
|
220
|
+
f ? /* @__PURE__ */ t(j, {
|
|
221
|
+
rolePresentation: !!r,
|
|
221
222
|
color: "currentcolor",
|
|
222
223
|
delay: "0s",
|
|
223
|
-
size:
|
|
224
|
-
}) : /* @__PURE__ */
|
|
224
|
+
size: u
|
|
225
|
+
}) : /* @__PURE__ */ t("div", {
|
|
225
226
|
style: {
|
|
226
227
|
display: "inline-block",
|
|
227
|
-
width:
|
|
228
|
-
height:
|
|
228
|
+
width: u,
|
|
229
|
+
height: u
|
|
229
230
|
}
|
|
230
231
|
}),
|
|
231
|
-
|
|
232
|
+
r ? /* @__PURE__ */ t(G, {
|
|
232
233
|
paddingLeft: 8,
|
|
233
|
-
children:
|
|
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
|
-
},
|
|
244
|
-
|
|
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
|
-
|
|
244
|
+
o && !y && P(!0);
|
|
247
245
|
}, [
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
246
|
+
o,
|
|
247
|
+
y,
|
|
248
|
+
r
|
|
251
249
|
]);
|
|
252
250
|
var _e_trackingEvent;
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
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:
|
|
259
|
-
action:
|
|
260
|
-
label:
|
|
261
|
-
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
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 ?
|
|
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:
|
|
292
|
-
showSpinner:
|
|
293
|
-
shouldRenderSpinner:
|
|
294
|
-
setShouldRenderSpinner:
|
|
298
|
+
children: fe({
|
|
299
|
+
showSpinner: o,
|
|
300
|
+
shouldRenderSpinner: y,
|
|
301
|
+
setShouldRenderSpinner: P,
|
|
295
302
|
children: e.children,
|
|
296
|
-
loadingText:
|
|
303
|
+
loadingText: l,
|
|
297
304
|
small: e.small,
|
|
298
|
-
|
|
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 ||
|
|
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__ */
|
|
314
|
+
if (e.fake) return /* @__PURE__ */ t(L, _object_spread_props(_object_spread({
|
|
308
315
|
maybe: !0
|
|
309
|
-
},
|
|
316
|
+
}, T), {
|
|
310
317
|
role: "presentation",
|
|
311
318
|
"aria-hidden": "true"
|
|
312
319
|
}));
|
|
313
|
-
if (e.submit) return /* @__PURE__ */
|
|
320
|
+
if (e.submit) return /* @__PURE__ */ t(L, _object_spread({
|
|
314
321
|
type: "submit",
|
|
315
|
-
formId:
|
|
322
|
+
formId: f,
|
|
316
323
|
onPress: ()=>{}
|
|
317
|
-
},
|
|
318
|
-
if (e.onPress) return /* @__PURE__ */
|
|
319
|
-
onPress: (
|
|
320
|
-
const
|
|
321
|
-
|
|
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__ */
|
|
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__ */
|
|
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
|
-
}),
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
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__ */
|
|
375
|
+
return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
|
|
433
376
|
dataAttributes: _object_spread({
|
|
434
377
|
"component-name": "ButtonLink"
|
|
435
378
|
}, e)
|
|
436
|
-
},
|
|
437
|
-
|
|
438
|
-
|
|
379
|
+
}, n), {
|
|
380
|
+
small: !0,
|
|
381
|
+
ref: r,
|
|
382
|
+
buttonType: "link",
|
|
383
|
+
TextContentRenderer: O
|
|
439
384
|
}));
|
|
440
|
-
}),
|
|
441
|
-
var { dataAttributes: e } = _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__ */
|
|
390
|
+
return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
|
|
445
391
|
dataAttributes: _object_spread({
|
|
446
392
|
"component-name": "ButtonLinkDanger"
|
|
447
393
|
}, e)
|
|
448
|
-
},
|
|
394
|
+
}, n), {
|
|
449
395
|
withChevron: !1,
|
|
450
|
-
|
|
451
|
-
|
|
396
|
+
small: !0,
|
|
397
|
+
ref: r,
|
|
398
|
+
buttonType: "linkDanger",
|
|
399
|
+
TextContentRenderer: O
|
|
452
400
|
}));
|
|
453
|
-
}),
|
|
454
|
-
var { dataAttributes: e } = _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__ */
|
|
405
|
+
return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
|
|
458
406
|
dataAttributes: _object_spread({
|
|
459
407
|
"component-name": "ButtonPrimary"
|
|
460
408
|
}, e)
|
|
461
|
-
},
|
|
462
|
-
ref:
|
|
463
|
-
|
|
409
|
+
}, i), {
|
|
410
|
+
ref: n,
|
|
411
|
+
buttonType: "primary",
|
|
412
|
+
TextContentRenderer: I
|
|
464
413
|
}));
|
|
465
|
-
}),
|
|
466
|
-
var { dataAttributes: e } = _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__ */
|
|
418
|
+
return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
|
|
470
419
|
dataAttributes: _object_spread({
|
|
471
420
|
"component-name": "ButtonSecondary"
|
|
472
421
|
}, e)
|
|
473
|
-
},
|
|
474
|
-
ref:
|
|
475
|
-
|
|
422
|
+
}, i), {
|
|
423
|
+
ref: n,
|
|
424
|
+
buttonType: "secondary",
|
|
425
|
+
TextContentRenderer: I
|
|
476
426
|
}));
|
|
477
|
-
}),
|
|
478
|
-
var { dataAttributes: e } = _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__ */
|
|
431
|
+
return /* @__PURE__ */ t(x, _object_spread_props(_object_spread({
|
|
482
432
|
dataAttributes: _object_spread({
|
|
483
433
|
"component-name": "ButtonDanger"
|
|
484
434
|
}, e)
|
|
485
|
-
},
|
|
486
|
-
ref:
|
|
487
|
-
|
|
435
|
+
}, i), {
|
|
436
|
+
ref: n,
|
|
437
|
+
buttonType: "danger",
|
|
438
|
+
TextContentRenderer: I
|
|
488
439
|
}));
|
|
489
440
|
});
|
|
490
|
-
export {
|
|
441
|
+
export { ze as ButtonDanger, Pe as ButtonLink, Ne as ButtonLinkDanger, Se as ButtonPrimary, Ve as ButtonSecondary };
|