@micromag/element-call-to-action 0.3.60 → 0.3.64
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 +45 -10
- package/lib/index.js +45 -10
- package/package.json +6 -6
package/es/index.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
|
-
import { faChevronUp } from '@fortawesome/free-solid-svg-icons';
|
|
5
|
-
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
|
6
4
|
import { useGesture } from '@use-gesture/react';
|
|
7
5
|
import classNames from 'classnames';
|
|
8
6
|
import PropTypes from 'prop-types';
|
|
@@ -13,6 +11,45 @@ import Button from '@micromag/element-button';
|
|
|
13
11
|
import Text from '@micromag/element-text';
|
|
14
12
|
import WebView from '@micromag/element-webview';
|
|
15
13
|
|
|
14
|
+
var propTypes$1 = {
|
|
15
|
+
color: PropTypes.string,
|
|
16
|
+
className: PropTypes.string
|
|
17
|
+
};
|
|
18
|
+
var defaultProps$1 = {
|
|
19
|
+
color: 'currentColor',
|
|
20
|
+
className: null
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
var Arrow = function Arrow(_ref) {
|
|
24
|
+
var color = _ref.color,
|
|
25
|
+
className = _ref.className;
|
|
26
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
27
|
+
version: "1.1",
|
|
28
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
29
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
30
|
+
x: "0",
|
|
31
|
+
y: "0px",
|
|
32
|
+
width: "48.53px",
|
|
33
|
+
height: "12.38px",
|
|
34
|
+
viewBox: "0 0 48.53 12.38",
|
|
35
|
+
className: className,
|
|
36
|
+
xmlSpace: "preserve"
|
|
37
|
+
}, /*#__PURE__*/React.createElement("g", {
|
|
38
|
+
transform: "matrix(1, 0, 0, 1, 0, 0)"
|
|
39
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
40
|
+
id: "b",
|
|
41
|
+
fill: "none",
|
|
42
|
+
stroke: color,
|
|
43
|
+
strokeWidth: "3px",
|
|
44
|
+
strokeLinejoin: "round",
|
|
45
|
+
strokeLinecap: "round",
|
|
46
|
+
d: "M1.5,10.88L24.26,1.5l22.77,9.38"
|
|
47
|
+
})));
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
Arrow.propTypes = propTypes$1;
|
|
51
|
+
Arrow.defaultProps = defaultProps$1;
|
|
52
|
+
|
|
16
53
|
var styles = {"container":"micromag-element-call-to-action-container","arrow":"micromag-element-call-to-action-arrow","upAndDown":"micromag-element-call-to-action-upAndDown","icon":"micromag-element-call-to-action-icon","label":"micromag-element-call-to-action-label","button":"micromag-element-call-to-action-button","selfTargetLink":"micromag-element-call-to-action-selfTargetLink","leavingFrame":"micromag-element-call-to-action-leavingFrame","appear":"micromag-element-call-to-action-appear","animationDisabled":"micromag-element-call-to-action-animationDisabled","invalidUrl":"micromag-element-call-to-action-invalidUrl","disabled":"micromag-element-call-to-action-disabled","inWebView":"micromag-element-call-to-action-inWebView","withMargin":"micromag-element-call-to-action-withMargin","webView":"micromag-element-call-to-action-webView","visible":"micromag-element-call-to-action-visible"};
|
|
17
54
|
|
|
18
55
|
var propTypes = {
|
|
@@ -81,8 +118,8 @@ function CallToAction(_ref) {
|
|
|
81
118
|
url = _ref2$url === void 0 ? null : _ref2$url,
|
|
82
119
|
_ref2$label = _ref2.label,
|
|
83
120
|
label = _ref2$label === void 0 ? null : _ref2$label,
|
|
84
|
-
_ref2$
|
|
85
|
-
|
|
121
|
+
_ref2$boxStyle = _ref2.boxStyle,
|
|
122
|
+
boxStyle = _ref2$boxStyle === void 0 ? null : _ref2$boxStyle,
|
|
86
123
|
_ref2$inWebView = _ref2.inWebView,
|
|
87
124
|
inWebView = _ref2$inWebView === void 0 ? false : _ref2$inWebView;
|
|
88
125
|
|
|
@@ -114,8 +151,7 @@ function CallToAction(_ref) {
|
|
|
114
151
|
return _objectSpread(_objectSpread({}, {
|
|
115
152
|
fontSize: fontSize
|
|
116
153
|
}), getStyleFromColor(color, 'color'));
|
|
117
|
-
}, [fontSize, color]);
|
|
118
|
-
console.log(buttonStyle); // MobileSafari blocks popup no matter what
|
|
154
|
+
}, [fontSize, color]); // MobileSafari blocks popup no matter what
|
|
119
155
|
|
|
120
156
|
var selfTargetLinkRef = useRef(null);
|
|
121
157
|
|
|
@@ -183,10 +219,9 @@ function CallToAction(_ref) {
|
|
|
183
219
|
}, [setShowWebView]);
|
|
184
220
|
var ArrowElement = arrow !== null ? /*#__PURE__*/React.createElement("div", {
|
|
185
221
|
className: classNames([styles.arrow, _defineProperty({}, arrowClassName, arrowClassName !== null)])
|
|
186
|
-
}, arrow) : /*#__PURE__*/React.createElement(
|
|
222
|
+
}, arrow) : /*#__PURE__*/React.createElement(Arrow, {
|
|
187
223
|
className: classNames([styles.arrow, _defineProperty({}, arrowClassName, arrowClassName !== null)]),
|
|
188
|
-
style: arrowStyle
|
|
189
|
-
icon: faChevronUp
|
|
224
|
+
style: arrowStyle
|
|
190
225
|
});
|
|
191
226
|
return active ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
192
227
|
className: classNames([styles.container, (_ref8 = {}, _defineProperty(_ref8, className, className !== null), _defineProperty(_ref8, styles.disabled, disabled), _defineProperty(_ref8, styles.animationDisabled, animationDisabled), _defineProperty(_ref8, styles.invalidUrl, !validUrl), _defineProperty(_ref8, styles.inWebView, inWebView), _ref8)]),
|
|
@@ -206,7 +241,7 @@ function CallToAction(_ref) {
|
|
|
206
241
|
focusable: focusable,
|
|
207
242
|
buttonStyle: _objectSpread({
|
|
208
243
|
marginBottom: 10
|
|
209
|
-
},
|
|
244
|
+
}, boxStyle)
|
|
210
245
|
}, swipeUpEnabled && !disabled ? bind() : null, inWebView ? {
|
|
211
246
|
onClick: onOpenWebView
|
|
212
247
|
} : {
|
package/lib/index.js
CHANGED
|
@@ -3,8 +3,6 @@
|
|
|
3
3
|
var _defineProperty = require('@babel/runtime/helpers/defineProperty');
|
|
4
4
|
var _objectSpread = require('@babel/runtime/helpers/objectSpread2');
|
|
5
5
|
var _slicedToArray = require('@babel/runtime/helpers/slicedToArray');
|
|
6
|
-
var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons');
|
|
7
|
-
var reactFontawesome = require('@fortawesome/react-fontawesome');
|
|
8
6
|
var react = require('@use-gesture/react');
|
|
9
7
|
var classNames = require('classnames');
|
|
10
8
|
var PropTypes = require('prop-types');
|
|
@@ -27,6 +25,45 @@ var Button__default = /*#__PURE__*/_interopDefaultLegacy(Button);
|
|
|
27
25
|
var Text__default = /*#__PURE__*/_interopDefaultLegacy(Text);
|
|
28
26
|
var WebView__default = /*#__PURE__*/_interopDefaultLegacy(WebView);
|
|
29
27
|
|
|
28
|
+
var propTypes$1 = {
|
|
29
|
+
color: PropTypes__default["default"].string,
|
|
30
|
+
className: PropTypes__default["default"].string
|
|
31
|
+
};
|
|
32
|
+
var defaultProps$1 = {
|
|
33
|
+
color: 'currentColor',
|
|
34
|
+
className: null
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var Arrow = function Arrow(_ref) {
|
|
38
|
+
var color = _ref.color,
|
|
39
|
+
className = _ref.className;
|
|
40
|
+
return /*#__PURE__*/React__default["default"].createElement("svg", {
|
|
41
|
+
version: "1.1",
|
|
42
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
43
|
+
xmlnsXlink: "http://www.w3.org/1999/xlink",
|
|
44
|
+
x: "0",
|
|
45
|
+
y: "0px",
|
|
46
|
+
width: "48.53px",
|
|
47
|
+
height: "12.38px",
|
|
48
|
+
viewBox: "0 0 48.53 12.38",
|
|
49
|
+
className: className,
|
|
50
|
+
xmlSpace: "preserve"
|
|
51
|
+
}, /*#__PURE__*/React__default["default"].createElement("g", {
|
|
52
|
+
transform: "matrix(1, 0, 0, 1, 0, 0)"
|
|
53
|
+
}, /*#__PURE__*/React__default["default"].createElement("path", {
|
|
54
|
+
id: "b",
|
|
55
|
+
fill: "none",
|
|
56
|
+
stroke: color,
|
|
57
|
+
strokeWidth: "3px",
|
|
58
|
+
strokeLinejoin: "round",
|
|
59
|
+
strokeLinecap: "round",
|
|
60
|
+
d: "M1.5,10.88L24.26,1.5l22.77,9.38"
|
|
61
|
+
})));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
Arrow.propTypes = propTypes$1;
|
|
65
|
+
Arrow.defaultProps = defaultProps$1;
|
|
66
|
+
|
|
30
67
|
var styles = {"container":"micromag-element-call-to-action-container","arrow":"micromag-element-call-to-action-arrow","upAndDown":"micromag-element-call-to-action-upAndDown","icon":"micromag-element-call-to-action-icon","label":"micromag-element-call-to-action-label","button":"micromag-element-call-to-action-button","selfTargetLink":"micromag-element-call-to-action-selfTargetLink","leavingFrame":"micromag-element-call-to-action-leavingFrame","appear":"micromag-element-call-to-action-appear","animationDisabled":"micromag-element-call-to-action-animationDisabled","invalidUrl":"micromag-element-call-to-action-invalidUrl","disabled":"micromag-element-call-to-action-disabled","inWebView":"micromag-element-call-to-action-inWebView","withMargin":"micromag-element-call-to-action-withMargin","webView":"micromag-element-call-to-action-webView","visible":"micromag-element-call-to-action-visible"};
|
|
31
68
|
|
|
32
69
|
var propTypes = {
|
|
@@ -95,8 +132,8 @@ function CallToAction(_ref) {
|
|
|
95
132
|
url = _ref2$url === void 0 ? null : _ref2$url,
|
|
96
133
|
_ref2$label = _ref2.label,
|
|
97
134
|
label = _ref2$label === void 0 ? null : _ref2$label,
|
|
98
|
-
_ref2$
|
|
99
|
-
|
|
135
|
+
_ref2$boxStyle = _ref2.boxStyle,
|
|
136
|
+
boxStyle = _ref2$boxStyle === void 0 ? null : _ref2$boxStyle,
|
|
100
137
|
_ref2$inWebView = _ref2.inWebView,
|
|
101
138
|
inWebView = _ref2$inWebView === void 0 ? false : _ref2$inWebView;
|
|
102
139
|
|
|
@@ -128,8 +165,7 @@ function CallToAction(_ref) {
|
|
|
128
165
|
return _objectSpread__default["default"](_objectSpread__default["default"]({}, {
|
|
129
166
|
fontSize: fontSize
|
|
130
167
|
}), utils.getStyleFromColor(color, 'color'));
|
|
131
|
-
}, [fontSize, color]);
|
|
132
|
-
console.log(buttonStyle); // MobileSafari blocks popup no matter what
|
|
168
|
+
}, [fontSize, color]); // MobileSafari blocks popup no matter what
|
|
133
169
|
|
|
134
170
|
var selfTargetLinkRef = React.useRef(null);
|
|
135
171
|
|
|
@@ -197,10 +233,9 @@ function CallToAction(_ref) {
|
|
|
197
233
|
}, [setShowWebView]);
|
|
198
234
|
var ArrowElement = arrow !== null ? /*#__PURE__*/React__default["default"].createElement("div", {
|
|
199
235
|
className: classNames__default["default"]([styles.arrow, _defineProperty__default["default"]({}, arrowClassName, arrowClassName !== null)])
|
|
200
|
-
}, arrow) : /*#__PURE__*/React__default["default"].createElement(
|
|
236
|
+
}, arrow) : /*#__PURE__*/React__default["default"].createElement(Arrow, {
|
|
201
237
|
className: classNames__default["default"]([styles.arrow, _defineProperty__default["default"]({}, arrowClassName, arrowClassName !== null)]),
|
|
202
|
-
style: arrowStyle
|
|
203
|
-
icon: freeSolidSvgIcons.faChevronUp
|
|
238
|
+
style: arrowStyle
|
|
204
239
|
});
|
|
205
240
|
return active ? /*#__PURE__*/React__default["default"].createElement(React__default["default"].Fragment, null, /*#__PURE__*/React__default["default"].createElement("div", {
|
|
206
241
|
className: classNames__default["default"]([styles.container, (_ref8 = {}, _defineProperty__default["default"](_ref8, className, className !== null), _defineProperty__default["default"](_ref8, styles.disabled, disabled), _defineProperty__default["default"](_ref8, styles.animationDisabled, animationDisabled), _defineProperty__default["default"](_ref8, styles.invalidUrl, !validUrl), _defineProperty__default["default"](_ref8, styles.inWebView, inWebView), _ref8)]),
|
|
@@ -220,7 +255,7 @@ function CallToAction(_ref) {
|
|
|
220
255
|
focusable: focusable,
|
|
221
256
|
buttonStyle: _objectSpread__default["default"]({
|
|
222
257
|
marginBottom: 10
|
|
223
|
-
},
|
|
258
|
+
}, boxStyle)
|
|
224
259
|
}, swipeUpEnabled && !disabled ? bind() : null, inWebView ? {
|
|
225
260
|
onClick: onOpenWebView
|
|
226
261
|
} : {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-call-to-action",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.64",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -52,10 +52,10 @@
|
|
|
52
52
|
"@fortawesome/fontawesome-svg-core": "^1.2.32",
|
|
53
53
|
"@fortawesome/free-solid-svg-icons": "^5.15.1",
|
|
54
54
|
"@fortawesome/react-fontawesome": "^0.1.13",
|
|
55
|
-
"@micromag/core": "^0.3.
|
|
56
|
-
"@micromag/element-button": "^0.3.
|
|
57
|
-
"@micromag/element-text": "^0.3.
|
|
58
|
-
"@micromag/element-webview": "^0.3.
|
|
55
|
+
"@micromag/core": "^0.3.64",
|
|
56
|
+
"@micromag/element-button": "^0.3.64",
|
|
57
|
+
"@micromag/element-text": "^0.3.64",
|
|
58
|
+
"@micromag/element-webview": "^0.3.64",
|
|
59
59
|
"@react-spring/core": "^9.1.1",
|
|
60
60
|
"@react-spring/web": "^9.1.1",
|
|
61
61
|
"@use-gesture/react": "^10.2.4",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"access": "public"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "b0da130454a8615d3fd00a3d380f438863b35334"
|
|
72
72
|
}
|