@micromag/element-call-to-action 0.4.71 → 0.4.76
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/es/index.js +475 -191
- package/package.json +12 -10
package/es/index.js
CHANGED
|
@@ -1,34 +1,25 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
|
-
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
1
|
+
import { c } from 'react/compiler-runtime';
|
|
5
2
|
import { useGesture } from '@use-gesture/react';
|
|
6
3
|
import classNames from 'classnames';
|
|
7
4
|
import isString from 'lodash/isString';
|
|
8
|
-
import {
|
|
5
|
+
import { useRef, useState, useEffect } from 'react';
|
|
9
6
|
import { useTrackEvent } from '@micromag/core/hooks';
|
|
10
7
|
import { isValidUrl, getStyleFromColor, isIos } from '@micromag/core/utils';
|
|
11
8
|
import Button from '@micromag/element-button';
|
|
12
9
|
import Text from '@micromag/element-text';
|
|
13
10
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
14
11
|
|
|
15
|
-
function Arrow(
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
className
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
width: "48.53px",
|
|
27
|
-
height: "12.38px",
|
|
28
|
-
viewBox: "0 0 48.53 12.38",
|
|
29
|
-
className: className,
|
|
30
|
-
xmlSpace: "preserve",
|
|
31
|
-
children: /*#__PURE__*/jsx("g", {
|
|
12
|
+
function Arrow(t0) {
|
|
13
|
+
const $ = c(5);
|
|
14
|
+
const {
|
|
15
|
+
color: t1,
|
|
16
|
+
className: t2
|
|
17
|
+
} = t0;
|
|
18
|
+
const color = t1 === undefined ? "currentColor" : t1;
|
|
19
|
+
const className = t2 === undefined ? null : t2;
|
|
20
|
+
let t3;
|
|
21
|
+
if ($[0] !== color) {
|
|
22
|
+
t3 = /*#__PURE__*/jsx("g", {
|
|
32
23
|
transform: "matrix(1, 0, 0, 1, 0, 0)",
|
|
33
24
|
children: /*#__PURE__*/jsx("path", {
|
|
34
25
|
id: "b",
|
|
@@ -39,190 +30,483 @@ function Arrow(_ref) {
|
|
|
39
30
|
strokeLinecap: "round",
|
|
40
31
|
d: "M1.5,10.88L24.26,1.5l22.77,9.38"
|
|
41
32
|
})
|
|
42
|
-
})
|
|
43
|
-
|
|
33
|
+
});
|
|
34
|
+
$[0] = color;
|
|
35
|
+
$[1] = t3;
|
|
36
|
+
} else {
|
|
37
|
+
t3 = $[1];
|
|
38
|
+
}
|
|
39
|
+
let t4;
|
|
40
|
+
if ($[2] !== className || $[3] !== t3) {
|
|
41
|
+
t4 = /*#__PURE__*/jsx("svg", {
|
|
42
|
+
version: "1.1",
|
|
43
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
44
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
45
|
+
x: "0",
|
|
46
|
+
y: "0px",
|
|
47
|
+
width: "48.53px",
|
|
48
|
+
height: "12.38px",
|
|
49
|
+
viewBox: "0 0 48.53 12.38",
|
|
50
|
+
className: className,
|
|
51
|
+
xmlSpace: "preserve",
|
|
52
|
+
children: t3
|
|
53
|
+
});
|
|
54
|
+
$[2] = className;
|
|
55
|
+
$[3] = t3;
|
|
56
|
+
$[4] = t4;
|
|
57
|
+
} else {
|
|
58
|
+
t4 = $[4];
|
|
59
|
+
}
|
|
60
|
+
return t4;
|
|
44
61
|
}
|
|
45
62
|
|
|
46
63
|
var styles = {"container":"micromag-element-call-to-action-container","arrow":"micromag-element-call-to-action-arrow","button":"micromag-element-call-to-action-button","withoutLinkStyle":"micromag-element-call-to-action-withoutLinkStyle","label":"micromag-element-call-to-action-label","icon":"micromag-element-call-to-action-icon","text":"micromag-element-call-to-action-text","selfTargetLink":"micromag-element-call-to-action-selfTargetLink","leavingFrame":"micromag-element-call-to-action-leavingFrame","animationDisabled":"micromag-element-call-to-action-animationDisabled","invalidUrl":"micromag-element-call-to-action-invalidUrl"};
|
|
47
64
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
type
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
65
|
+
function CallToAction(t0) {
|
|
66
|
+
const $ = c(92);
|
|
67
|
+
const {
|
|
68
|
+
type: t1,
|
|
69
|
+
url: t2,
|
|
70
|
+
label: t3,
|
|
71
|
+
boxStyle: t4,
|
|
72
|
+
inWebView: t5,
|
|
73
|
+
elRef: t6,
|
|
74
|
+
disabled: t7,
|
|
75
|
+
animationDisabled: t8,
|
|
76
|
+
icon: t9,
|
|
77
|
+
arrow: t10,
|
|
78
|
+
dragAmount: t11,
|
|
79
|
+
className: t12,
|
|
80
|
+
buttonClassName: t13,
|
|
81
|
+
buttonBorderClassName: t14,
|
|
82
|
+
labelClassName: t15,
|
|
83
|
+
arrowClassName: t16,
|
|
84
|
+
focusable: t17,
|
|
85
|
+
external: t18,
|
|
86
|
+
openWebView: t19,
|
|
87
|
+
onClick: t20
|
|
88
|
+
} = t0;
|
|
89
|
+
const type = t1 === undefined ? null : t1;
|
|
90
|
+
const url = t2 === undefined ? null : t2;
|
|
91
|
+
const label = t3 === undefined ? null : t3;
|
|
92
|
+
const boxStyle = t4 === undefined ? null : t4;
|
|
93
|
+
const inWebView = t5 === undefined ? false : t5;
|
|
94
|
+
const elRef = t6 === undefined ? null : t6;
|
|
95
|
+
const disabled = t7 === undefined ? false : t7;
|
|
96
|
+
const animationDisabled = t8 === undefined ? false : t8;
|
|
97
|
+
const icon = t9 === undefined ? null : t9;
|
|
98
|
+
const arrow = t10 === undefined ? null : t10;
|
|
99
|
+
const dragAmount = t11 === undefined ? 50 : t11;
|
|
100
|
+
const className = t12 === undefined ? null : t12;
|
|
101
|
+
const buttonClassName = t13 === undefined ? null : t13;
|
|
102
|
+
const buttonBorderClassName = t14 === undefined ? null : t14;
|
|
103
|
+
const labelClassName = t15 === undefined ? null : t15;
|
|
104
|
+
const arrowClassName = t16 === undefined ? null : t16;
|
|
105
|
+
const focusable = t17 === undefined ? true : t17;
|
|
106
|
+
const external = t18 === undefined ? true : t18;
|
|
107
|
+
const openWebView = t19 === undefined ? null : t19;
|
|
108
|
+
const onClick = t20 === undefined ? null : t20;
|
|
109
|
+
const trackEvent = useTrackEvent();
|
|
110
|
+
const swipeUpEnabled = type === null || type === "swipe-up";
|
|
111
|
+
let t21;
|
|
112
|
+
if ($[0] !== url) {
|
|
113
|
+
t21 = isValidUrl(url);
|
|
114
|
+
$[0] = url;
|
|
115
|
+
$[1] = t21;
|
|
116
|
+
} else {
|
|
117
|
+
t21 = $[1];
|
|
118
|
+
}
|
|
119
|
+
const validUrl = t21;
|
|
120
|
+
const buttonRef = useRef(null);
|
|
121
|
+
let t22;
|
|
122
|
+
if ($[2] !== label) {
|
|
123
|
+
t22 = label || {};
|
|
124
|
+
$[2] = label;
|
|
125
|
+
$[3] = t22;
|
|
126
|
+
} else {
|
|
127
|
+
t22 = $[3];
|
|
128
|
+
}
|
|
129
|
+
const {
|
|
130
|
+
textStyle: t23
|
|
131
|
+
} = t22;
|
|
132
|
+
const textStyle = t23 === undefined ? null : t23;
|
|
133
|
+
let t24;
|
|
134
|
+
if ($[4] !== textStyle) {
|
|
135
|
+
t24 = textStyle || {};
|
|
136
|
+
$[4] = textStyle;
|
|
137
|
+
$[5] = t24;
|
|
138
|
+
} else {
|
|
139
|
+
t24 = $[5];
|
|
140
|
+
}
|
|
141
|
+
const {
|
|
142
|
+
fontSize: t25,
|
|
143
|
+
color: t26,
|
|
144
|
+
lineHeight: t27
|
|
145
|
+
} = t24;
|
|
146
|
+
const fontSize = t25 === undefined ? null : t25;
|
|
147
|
+
const color = t26 === undefined ? null : t26;
|
|
148
|
+
const lineHeight = t27 === undefined ? null : t27;
|
|
149
|
+
let t28;
|
|
150
|
+
if ($[6] !== boxStyle) {
|
|
151
|
+
t28 = boxStyle || {};
|
|
152
|
+
$[6] = boxStyle;
|
|
153
|
+
$[7] = t28;
|
|
154
|
+
} else {
|
|
155
|
+
t28 = $[7];
|
|
156
|
+
}
|
|
157
|
+
const {
|
|
158
|
+
backgroundColor: t29
|
|
159
|
+
} = t28;
|
|
160
|
+
const backgroundColor = t29 === undefined ? null : t29;
|
|
161
|
+
let t30;
|
|
162
|
+
if ($[8] !== fontSize) {
|
|
163
|
+
t30 = {
|
|
164
|
+
fontSize
|
|
165
|
+
};
|
|
166
|
+
$[8] = fontSize;
|
|
167
|
+
$[9] = t30;
|
|
168
|
+
} else {
|
|
169
|
+
t30 = $[9];
|
|
170
|
+
}
|
|
171
|
+
let t31;
|
|
172
|
+
if ($[10] !== backgroundColor || $[11] !== color) {
|
|
173
|
+
t31 = backgroundColor === null ? getStyleFromColor(color, "color") : getStyleFromColor(backgroundColor, "color");
|
|
174
|
+
$[10] = backgroundColor;
|
|
175
|
+
$[11] = color;
|
|
176
|
+
$[12] = t31;
|
|
177
|
+
} else {
|
|
178
|
+
t31 = $[12];
|
|
179
|
+
}
|
|
180
|
+
let t32;
|
|
181
|
+
if ($[13] !== t30 || $[14] !== t31) {
|
|
182
|
+
t32 = {
|
|
183
|
+
...t30,
|
|
184
|
+
...t31
|
|
185
|
+
};
|
|
186
|
+
$[13] = t30;
|
|
187
|
+
$[14] = t31;
|
|
188
|
+
$[15] = t32;
|
|
189
|
+
} else {
|
|
190
|
+
t32 = $[15];
|
|
191
|
+
}
|
|
192
|
+
const arrowStyle = t32;
|
|
193
|
+
const selfTargetLinkRef = useRef(null);
|
|
194
|
+
const [leaving, setLeaving] = useState(false);
|
|
195
|
+
const [toggled, setToggled] = useState(false);
|
|
196
|
+
let t33;
|
|
197
|
+
if ($[16] !== inWebView || $[17] !== onClick || $[18] !== openWebView || $[19] !== toggled || $[20] !== trackEvent || $[21] !== url) {
|
|
198
|
+
t33 = (e, t34) => {
|
|
199
|
+
const action = t34 === undefined ? "click" : t34;
|
|
200
|
+
setToggled(!toggled);
|
|
201
|
+
if (inWebView && openWebView !== null) {
|
|
202
|
+
openWebView({
|
|
203
|
+
url
|
|
204
|
+
});
|
|
205
|
+
}
|
|
206
|
+
if (onClick !== null && action === "click") {
|
|
207
|
+
onClick(e);
|
|
208
|
+
}
|
|
209
|
+
if (trackEvent !== null) {
|
|
210
|
+
trackEvent("call_to_action", isString(action) ? action : "click", url);
|
|
160
211
|
}
|
|
161
|
-
}
|
|
162
|
-
}, [dragAmount, inWebView, onClickLink, setLeaving]);
|
|
163
|
-
var bind = useGesture({
|
|
164
|
-
onDrag: onDrag,
|
|
165
|
-
onDragEnd: onDragEnd
|
|
166
|
-
});
|
|
167
|
-
useEffect(function () {
|
|
168
|
-
var onPageHide = function onPageHide() {
|
|
169
|
-
setLeaving(false);
|
|
170
212
|
};
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
213
|
+
$[16] = inWebView;
|
|
214
|
+
$[17] = onClick;
|
|
215
|
+
$[18] = openWebView;
|
|
216
|
+
$[19] = toggled;
|
|
217
|
+
$[20] = trackEvent;
|
|
218
|
+
$[21] = url;
|
|
219
|
+
$[22] = t33;
|
|
220
|
+
} else {
|
|
221
|
+
t33 = $[22];
|
|
222
|
+
}
|
|
223
|
+
const onClickLink = t33;
|
|
224
|
+
const onDrag = _temp;
|
|
225
|
+
let t34;
|
|
226
|
+
if ($[23] !== dragAmount || $[24] !== inWebView || $[25] !== onClickLink) {
|
|
227
|
+
t34 = t35 => {
|
|
228
|
+
const {
|
|
229
|
+
movement: t36
|
|
230
|
+
} = t35;
|
|
231
|
+
const [, my] = t36;
|
|
232
|
+
if (my < -dragAmount) {
|
|
233
|
+
if (inWebView) {
|
|
234
|
+
onClickLink(null, "swipe");
|
|
235
|
+
} else {
|
|
236
|
+
if (isIos() && selfTargetLinkRef.current !== null) {
|
|
237
|
+
selfTargetLinkRef.current.click();
|
|
238
|
+
setLeaving(true);
|
|
239
|
+
onClickLink(null, "swipe");
|
|
240
|
+
} else {
|
|
241
|
+
if (buttonRef.current) {
|
|
242
|
+
buttonRef.current.click();
|
|
243
|
+
onClickLink(null, "swipe");
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
$[23] = dragAmount;
|
|
250
|
+
$[24] = inWebView;
|
|
251
|
+
$[25] = onClickLink;
|
|
252
|
+
$[26] = t34;
|
|
253
|
+
} else {
|
|
254
|
+
t34 = $[26];
|
|
255
|
+
}
|
|
256
|
+
const onDragEnd = t34;
|
|
257
|
+
let t35;
|
|
258
|
+
if ($[27] !== onDragEnd) {
|
|
259
|
+
t35 = {
|
|
260
|
+
onDrag,
|
|
261
|
+
onDragEnd
|
|
262
|
+
};
|
|
263
|
+
$[27] = onDragEnd;
|
|
264
|
+
$[28] = t35;
|
|
265
|
+
} else {
|
|
266
|
+
t35 = $[28];
|
|
267
|
+
}
|
|
268
|
+
const bind = useGesture(t35);
|
|
269
|
+
let t36;
|
|
270
|
+
let t37;
|
|
271
|
+
if ($[29] === Symbol.for("react.memo_cache_sentinel")) {
|
|
272
|
+
t36 = () => {
|
|
273
|
+
const onPageHide = () => {
|
|
274
|
+
setLeaving(false);
|
|
275
|
+
};
|
|
276
|
+
window.addEventListener("pagehide", onPageHide);
|
|
277
|
+
return () => {
|
|
278
|
+
window.removeEventListener("pagehide", onPageHide);
|
|
279
|
+
};
|
|
174
280
|
};
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
281
|
+
t37 = [setLeaving];
|
|
282
|
+
$[29] = t36;
|
|
283
|
+
$[30] = t37;
|
|
284
|
+
} else {
|
|
285
|
+
t36 = $[29];
|
|
286
|
+
t37 = $[30];
|
|
287
|
+
}
|
|
288
|
+
useEffect(t36, t37);
|
|
289
|
+
const t38 = !validUrl;
|
|
290
|
+
let t39;
|
|
291
|
+
if ($[31] !== animationDisabled || $[32] !== className || $[33] !== disabled || $[34] !== inWebView || $[35] !== t38) {
|
|
292
|
+
t39 = classNames([styles.container, className, {
|
|
293
|
+
[styles.disabled]: disabled,
|
|
294
|
+
[styles.animationDisabled]: animationDisabled,
|
|
295
|
+
[styles.invalidUrl]: t38,
|
|
296
|
+
[styles.inWebView]: inWebView
|
|
297
|
+
}]);
|
|
298
|
+
$[31] = animationDisabled;
|
|
299
|
+
$[32] = className;
|
|
300
|
+
$[33] = disabled;
|
|
301
|
+
$[34] = inWebView;
|
|
302
|
+
$[35] = t38;
|
|
303
|
+
$[36] = t39;
|
|
304
|
+
} else {
|
|
305
|
+
t39 = $[36];
|
|
306
|
+
}
|
|
307
|
+
let t40;
|
|
308
|
+
if ($[37] !== leaving) {
|
|
309
|
+
t40 = leaving ? /*#__PURE__*/jsx("div", {
|
|
180
310
|
className: styles.leavingFrame
|
|
181
|
-
}) : null
|
|
311
|
+
}) : null;
|
|
312
|
+
$[37] = leaving;
|
|
313
|
+
$[38] = t40;
|
|
314
|
+
} else {
|
|
315
|
+
t40 = $[38];
|
|
316
|
+
}
|
|
317
|
+
let t41;
|
|
318
|
+
if ($[39] !== focusable || $[40] !== inWebView || $[41] !== swipeUpEnabled || $[42] !== url) {
|
|
319
|
+
t41 = !inWebView && swipeUpEnabled ? /*#__PURE__*/jsx("a", {
|
|
182
320
|
className: styles.selfTargetLink,
|
|
183
321
|
href: url,
|
|
184
322
|
ref: selfTargetLinkRef,
|
|
185
|
-
tabIndex: focusable ?
|
|
186
|
-
}) : null
|
|
323
|
+
tabIndex: focusable ? "0" : "-1"
|
|
324
|
+
}) : null;
|
|
325
|
+
$[39] = focusable;
|
|
326
|
+
$[40] = inWebView;
|
|
327
|
+
$[41] = swipeUpEnabled;
|
|
328
|
+
$[42] = url;
|
|
329
|
+
$[43] = t41;
|
|
330
|
+
} else {
|
|
331
|
+
t41 = $[43];
|
|
332
|
+
}
|
|
333
|
+
let t42;
|
|
334
|
+
if ($[44] !== arrow || $[45] !== arrowClassName || $[46] !== arrowStyle || $[47] !== swipeUpEnabled) {
|
|
335
|
+
t42 = swipeUpEnabled ? /*#__PURE__*/jsx("div", {
|
|
187
336
|
className: classNames([styles.arrow, arrowClassName]),
|
|
188
337
|
style: arrowStyle,
|
|
189
338
|
children: arrow || /*#__PURE__*/jsx(Arrow, {})
|
|
190
|
-
}) : null
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
}
|
|
339
|
+
}) : null;
|
|
340
|
+
$[44] = arrow;
|
|
341
|
+
$[45] = arrowClassName;
|
|
342
|
+
$[46] = arrowStyle;
|
|
343
|
+
$[47] = swipeUpEnabled;
|
|
344
|
+
$[48] = t42;
|
|
345
|
+
} else {
|
|
346
|
+
t42 = $[48];
|
|
347
|
+
}
|
|
348
|
+
let t43;
|
|
349
|
+
if ($[49] !== buttonBorderClassName) {
|
|
350
|
+
t43 = classNames([styles.buttonBorder, buttonBorderClassName]);
|
|
351
|
+
$[49] = buttonBorderClassName;
|
|
352
|
+
$[50] = t43;
|
|
353
|
+
} else {
|
|
354
|
+
t43 = $[50];
|
|
355
|
+
}
|
|
356
|
+
const t44 = !inWebView;
|
|
357
|
+
let t45;
|
|
358
|
+
if ($[51] !== buttonClassName || $[52] !== t44) {
|
|
359
|
+
t45 = classNames([styles.button, buttonClassName, {
|
|
360
|
+
[styles.withoutLinkStyle]: t44
|
|
361
|
+
}]);
|
|
362
|
+
$[51] = buttonClassName;
|
|
363
|
+
$[52] = t44;
|
|
364
|
+
$[53] = t45;
|
|
365
|
+
} else {
|
|
366
|
+
t45 = $[53];
|
|
367
|
+
}
|
|
368
|
+
const t46 = !inWebView ? url : null;
|
|
369
|
+
const t47 = !inWebView ? external : false;
|
|
370
|
+
let t48;
|
|
371
|
+
if ($[54] !== bind || $[55] !== disabled || $[56] !== swipeUpEnabled) {
|
|
372
|
+
t48 = swipeUpEnabled && !disabled ? bind() : null;
|
|
373
|
+
$[54] = bind;
|
|
374
|
+
$[55] = disabled;
|
|
375
|
+
$[56] = swipeUpEnabled;
|
|
376
|
+
$[57] = t48;
|
|
377
|
+
} else {
|
|
378
|
+
t48 = $[57];
|
|
379
|
+
}
|
|
380
|
+
let t49;
|
|
381
|
+
if ($[58] !== labelClassName) {
|
|
382
|
+
t49 = classNames([styles.label, labelClassName]);
|
|
383
|
+
$[58] = labelClassName;
|
|
384
|
+
$[59] = t49;
|
|
385
|
+
} else {
|
|
386
|
+
t49 = $[59];
|
|
387
|
+
}
|
|
388
|
+
let t50;
|
|
389
|
+
if ($[60] !== icon) {
|
|
390
|
+
t50 = icon !== null ? /*#__PURE__*/jsx("div", {
|
|
391
|
+
className: styles.icon,
|
|
392
|
+
children: icon
|
|
393
|
+
}) : null;
|
|
394
|
+
$[60] = icon;
|
|
395
|
+
$[61] = t50;
|
|
396
|
+
} else {
|
|
397
|
+
t50 = $[61];
|
|
398
|
+
}
|
|
399
|
+
const t51 = lineHeight || 1;
|
|
400
|
+
let t52;
|
|
401
|
+
if ($[62] !== t51 || $[63] !== textStyle) {
|
|
402
|
+
t52 = {
|
|
403
|
+
...textStyle,
|
|
404
|
+
lineHeight: t51
|
|
405
|
+
};
|
|
406
|
+
$[62] = t51;
|
|
407
|
+
$[63] = textStyle;
|
|
408
|
+
$[64] = t52;
|
|
409
|
+
} else {
|
|
410
|
+
t52 = $[64];
|
|
411
|
+
}
|
|
412
|
+
let t53;
|
|
413
|
+
if ($[65] !== label || $[66] !== t52) {
|
|
414
|
+
t53 = /*#__PURE__*/jsx(Text, {
|
|
415
|
+
...label,
|
|
416
|
+
className: styles.text,
|
|
417
|
+
textStyle: t52,
|
|
418
|
+
inline: true
|
|
419
|
+
});
|
|
420
|
+
$[65] = label;
|
|
421
|
+
$[66] = t52;
|
|
422
|
+
$[67] = t53;
|
|
423
|
+
} else {
|
|
424
|
+
t53 = $[67];
|
|
425
|
+
}
|
|
426
|
+
let t54;
|
|
427
|
+
if ($[68] !== t49 || $[69] !== t50 || $[70] !== t53) {
|
|
428
|
+
t54 = /*#__PURE__*/jsxs("span", {
|
|
429
|
+
className: t49,
|
|
430
|
+
children: [t50, t53]
|
|
431
|
+
});
|
|
432
|
+
$[68] = t49;
|
|
433
|
+
$[69] = t50;
|
|
434
|
+
$[70] = t53;
|
|
435
|
+
$[71] = t54;
|
|
436
|
+
} else {
|
|
437
|
+
t54 = $[71];
|
|
438
|
+
}
|
|
439
|
+
let t55;
|
|
440
|
+
if ($[72] !== boxStyle || $[73] !== focusable || $[74] !== onClickLink || $[75] !== t45 || $[76] !== t46 || $[77] !== t47 || $[78] !== t48 || $[79] !== t54 || $[80] !== toggled) {
|
|
441
|
+
t55 = /*#__PURE__*/jsx(Button, {
|
|
442
|
+
className: t45,
|
|
443
|
+
refButton: buttonRef,
|
|
444
|
+
focusable: focusable,
|
|
445
|
+
buttonStyle: boxStyle,
|
|
446
|
+
inline: true,
|
|
447
|
+
"aria-pressed": toggled,
|
|
448
|
+
href: t46,
|
|
449
|
+
external: t47,
|
|
450
|
+
onClick: onClickLink,
|
|
451
|
+
...t48,
|
|
452
|
+
children: t54
|
|
453
|
+
});
|
|
454
|
+
$[72] = boxStyle;
|
|
455
|
+
$[73] = focusable;
|
|
456
|
+
$[74] = onClickLink;
|
|
457
|
+
$[75] = t45;
|
|
458
|
+
$[76] = t46;
|
|
459
|
+
$[77] = t47;
|
|
460
|
+
$[78] = t48;
|
|
461
|
+
$[79] = t54;
|
|
462
|
+
$[80] = toggled;
|
|
463
|
+
$[81] = t55;
|
|
464
|
+
} else {
|
|
465
|
+
t55 = $[81];
|
|
466
|
+
}
|
|
467
|
+
let t56;
|
|
468
|
+
if ($[82] !== t43 || $[83] !== t55) {
|
|
469
|
+
t56 = /*#__PURE__*/jsx("div", {
|
|
470
|
+
className: t43,
|
|
471
|
+
children: t55
|
|
472
|
+
});
|
|
473
|
+
$[82] = t43;
|
|
474
|
+
$[83] = t55;
|
|
475
|
+
$[84] = t56;
|
|
476
|
+
} else {
|
|
477
|
+
t56 = $[84];
|
|
478
|
+
}
|
|
479
|
+
let t57;
|
|
480
|
+
if ($[85] !== elRef || $[86] !== t39 || $[87] !== t40 || $[88] !== t41 || $[89] !== t42 || $[90] !== t56) {
|
|
481
|
+
t57 = /*#__PURE__*/jsxs("div", {
|
|
482
|
+
className: t39,
|
|
483
|
+
ref: elRef,
|
|
484
|
+
children: [t40, t41, t42, t56]
|
|
485
|
+
});
|
|
486
|
+
$[85] = elRef;
|
|
487
|
+
$[86] = t39;
|
|
488
|
+
$[87] = t40;
|
|
489
|
+
$[88] = t41;
|
|
490
|
+
$[89] = t42;
|
|
491
|
+
$[90] = t56;
|
|
492
|
+
$[91] = t57;
|
|
493
|
+
} else {
|
|
494
|
+
t57 = $[91];
|
|
495
|
+
}
|
|
496
|
+
return t57;
|
|
497
|
+
}
|
|
498
|
+
function _temp(t0) {
|
|
499
|
+
const {
|
|
500
|
+
event
|
|
501
|
+
} = t0;
|
|
502
|
+
event.preventDefault();
|
|
219
503
|
}
|
|
220
|
-
var CallToAction_default = (
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
504
|
+
var CallToAction_default = ({
|
|
505
|
+
ref,
|
|
506
|
+
...props
|
|
507
|
+
}) => /*#__PURE__*/jsx(CallToAction, {
|
|
508
|
+
elRef: ref,
|
|
509
|
+
...props
|
|
226
510
|
});
|
|
227
511
|
|
|
228
512
|
export { CallToAction_default as default };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-call-to-action",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.76",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"type": "module",
|
|
34
34
|
"module": "es/index.js",
|
|
35
|
+
"style": "./assets/css/styles.css",
|
|
35
36
|
"exports": {
|
|
36
37
|
".": {
|
|
37
38
|
"types": "./es/index.d.ts",
|
|
39
|
+
"style": "./assets/css/styles.css",
|
|
38
40
|
"import": "./es/index.js"
|
|
39
41
|
},
|
|
40
42
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -51,22 +53,22 @@
|
|
|
51
53
|
"build": "../../scripts/prepare-package.sh --types"
|
|
52
54
|
},
|
|
53
55
|
"devDependencies": {
|
|
54
|
-
"react": "^
|
|
55
|
-
"react-dom": "^
|
|
56
|
+
"react": "^19.0.0",
|
|
57
|
+
"react-dom": "^19.0.0"
|
|
56
58
|
},
|
|
57
59
|
"peerDependencies": {
|
|
58
|
-
"react": "^
|
|
59
|
-
"react-dom": "^
|
|
60
|
+
"react": "^19.0.0",
|
|
61
|
+
"react-dom": "^19.0.0"
|
|
60
62
|
},
|
|
61
63
|
"dependencies": {
|
|
62
64
|
"@babel/runtime": "^7.28.6",
|
|
63
65
|
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
64
66
|
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
65
67
|
"@fortawesome/react-fontawesome": "^3.2.0",
|
|
66
|
-
"@micromag/core": "^0.4.
|
|
67
|
-
"@micromag/element-button": "^0.4.
|
|
68
|
-
"@micromag/element-text": "^0.4.
|
|
69
|
-
"@micromag/element-webview": "^0.4.
|
|
68
|
+
"@micromag/core": "^0.4.74",
|
|
69
|
+
"@micromag/element-button": "^0.4.76",
|
|
70
|
+
"@micromag/element-text": "^0.4.74",
|
|
71
|
+
"@micromag/element-webview": "^0.4.76",
|
|
70
72
|
"@react-spring/core": "^10.0.3",
|
|
71
73
|
"@react-spring/web": "^10.0.3",
|
|
72
74
|
"@use-gesture/react": "^10.3.0",
|
|
@@ -79,6 +81,6 @@
|
|
|
79
81
|
"access": "public",
|
|
80
82
|
"registry": "https://registry.npmjs.org/"
|
|
81
83
|
},
|
|
82
|
-
"gitHead": "
|
|
84
|
+
"gitHead": "42a24f578994b23090271013f136b7f78956b632",
|
|
83
85
|
"types": "es/index.d.ts"
|
|
84
86
|
}
|