@micromag/element-call-to-action 0.3.832 → 0.4.6
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/assets/css/styles.css +1 -1
- package/es/index.d.ts +3 -0
- package/es/index.js +46 -84
- package/es/styles.css +1 -0
- package/package.json +21 -20
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@-webkit-keyframes micromag-element-call-to-action-appear{0%{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes micromag-element-call-to-action-appear{0%{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.micromag-element-call-to-action-container{opacity:1;position:relative;text-align:center;-webkit-transition:opacity .3s ease;transition:opacity .3s ease;z-index:100}.micromag-element-call-to-action-container .micromag-element-call-to-action-arrow{-webkit-animation:micromag-element-call-to-action-upAndDown .5s ease-in-out infinite alternate;animation:micromag-element-call-to-action-upAndDown .5s ease-in-out infinite alternate;display:block;margin:0 auto 3px}.micromag-element-call-to-action-container .micromag-element-call-to-action-button{background-color:rgba(0,0,0,0);display:block;margin:0 auto;padding:5px 10px;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none
|
|
1
|
+
@-webkit-keyframes micromag-element-call-to-action-appear{0%{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes micromag-element-call-to-action-appear{0%{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.micromag-element-call-to-action-container{opacity:1;position:relative;text-align:center;-webkit-transition:opacity .3s ease;transition:opacity .3s ease;z-index:100}.micromag-element-call-to-action-container .micromag-element-call-to-action-arrow{-webkit-animation:micromag-element-call-to-action-upAndDown .5s ease-in-out infinite alternate;animation:micromag-element-call-to-action-upAndDown .5s ease-in-out infinite alternate;display:block;margin:0 auto 3px}.micromag-element-call-to-action-container .micromag-element-call-to-action-button{background-color:rgba(0,0,0,0);display:block;margin:0 auto;padding:5px 10px;-ms-touch-action:none;touch-action:none;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.micromag-element-call-to-action-container .micromag-element-call-to-action-button.micromag-element-call-to-action-withoutLinkStyle{-webkit-text-decoration:none;text-decoration:none}.micromag-element-call-to-action-container .micromag-element-call-to-action-button:hover{-webkit-text-decoration:none;text-decoration:none}.micromag-element-call-to-action-container .micromag-element-call-to-action-button:focus{-webkit-box-shadow:0 0 2px 2px #fff;box-shadow:0 0 2px 2px #fff;-webkit-box-shadow:0 0 2px 2px var(--micromag-focus-color,#fff);box-shadow:0 0 2px 2px var(--micromag-focus-color,#fff)}.micromag-element-call-to-action-container .micromag-element-call-to-action-label{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.micromag-element-call-to-action-container .micromag-element-call-to-action-icon{display:block}.micromag-element-call-to-action-container .micromag-element-call-to-action-text *{display:inline}.micromag-element-call-to-action-container .micromag-element-call-to-action-selfTargetLink{display:none}.micromag-element-call-to-action-container .micromag-element-call-to-action-leavingFrame{-webkit-animation:micromag-element-call-to-action-appear .5s ease both;animation:micromag-element-call-to-action-appear .5s ease both;background-color:#fff;height:100vh;left:0;opacity:0;position:fixed;top:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);width:100vw}.micromag-element-call-to-action-container.micromag-element-call-to-action-animationDisabled .micromag-element-call-to-action-arrow{-webkit-animation:none;animation:none}.micromag-element-call-to-action-container.micromag-element-call-to-action-invalidUrl{opacity:.5;pointer-events:none}.micromag-element-call-to-action-container.micromag-element-call-to-action-invalidUrl .micromag-element-call-to-action-arrow{-webkit-animation:none;animation:none}.micromag-element-call-to-action-container.micromag-element-call-to-action-withMargin{margin-bottom:5px}
|
package/es/index.d.ts
ADDED
package/es/index.js
CHANGED
|
@@ -4,25 +4,17 @@ import _objectSpread from '@babel/runtime/helpers/objectSpread2';
|
|
|
4
4
|
import { useGesture } from '@use-gesture/react';
|
|
5
5
|
import classNames from 'classnames';
|
|
6
6
|
import isString from 'lodash/isString';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
7
|
import React, { useMemo, useRef, useState, useCallback, useEffect } from 'react';
|
|
9
|
-
import { PropTypes as PropTypes$1 } from '@micromag/core';
|
|
10
8
|
import { useTrackEvent } from '@micromag/core/hooks';
|
|
11
9
|
import { isValidUrl, getStyleFromColor, isIos } from '@micromag/core/utils';
|
|
12
10
|
import Button from '@micromag/element-button';
|
|
13
11
|
import Text from '@micromag/element-text';
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
color
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
color: 'currentColor',
|
|
21
|
-
className: null
|
|
22
|
-
};
|
|
23
|
-
var Arrow = function Arrow(_ref) {
|
|
24
|
-
var color = _ref.color,
|
|
25
|
-
className = _ref.className;
|
|
13
|
+
function Arrow(_ref) {
|
|
14
|
+
var _ref$color = _ref.color,
|
|
15
|
+
color = _ref$color === void 0 ? 'currentColor' : _ref$color,
|
|
16
|
+
_ref$className = _ref.className,
|
|
17
|
+
className = _ref$className === void 0 ? null : _ref$className;
|
|
26
18
|
return /*#__PURE__*/React.createElement("svg", {
|
|
27
19
|
version: "1.1",
|
|
28
20
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -45,79 +37,51 @@ var Arrow = function Arrow(_ref) {
|
|
|
45
37
|
strokeLinecap: "round",
|
|
46
38
|
d: "M1.5,10.88L24.26,1.5l22.77,9.38"
|
|
47
39
|
})));
|
|
48
|
-
}
|
|
49
|
-
Arrow.propTypes = propTypes$1;
|
|
50
|
-
Arrow.defaultProps = defaultProps$1;
|
|
40
|
+
}
|
|
51
41
|
|
|
52
42
|
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"};
|
|
53
43
|
|
|
54
|
-
var propTypes = {
|
|
55
|
-
type: PropTypes.oneOf(['click', 'swipe-up', null]),
|
|
56
|
-
url: PropTypes.string,
|
|
57
|
-
label: PropTypes$1.textElement,
|
|
58
|
-
boxStyle: PropTypes$1.boxStyle,
|
|
59
|
-
inWebView: PropTypes.bool,
|
|
60
|
-
elRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
|
|
61
|
-
current: PropTypes.any // eslint-disable-line
|
|
62
|
-
})]),
|
|
63
|
-
disabled: PropTypes.bool,
|
|
64
|
-
animationDisabled: PropTypes.bool,
|
|
65
|
-
icon: PropTypes.node,
|
|
66
|
-
arrow: PropTypes.node,
|
|
67
|
-
dragAmount: PropTypes.number,
|
|
68
|
-
className: PropTypes.string,
|
|
69
|
-
buttonClassName: PropTypes.string,
|
|
70
|
-
buttonBorderClassName: PropTypes.string,
|
|
71
|
-
labelClassName: PropTypes.string,
|
|
72
|
-
arrowClassName: PropTypes.string,
|
|
73
|
-
focusable: PropTypes.bool,
|
|
74
|
-
external: PropTypes.bool,
|
|
75
|
-
openWebView: PropTypes.func,
|
|
76
|
-
onClick: PropTypes.func
|
|
77
|
-
};
|
|
78
|
-
var defaultProps = {
|
|
79
|
-
type: null,
|
|
80
|
-
url: null,
|
|
81
|
-
label: null,
|
|
82
|
-
boxStyle: null,
|
|
83
|
-
inWebView: false,
|
|
84
|
-
elRef: null,
|
|
85
|
-
disabled: false,
|
|
86
|
-
animationDisabled: false,
|
|
87
|
-
icon: null,
|
|
88
|
-
arrow: null,
|
|
89
|
-
dragAmount: 50,
|
|
90
|
-
className: null,
|
|
91
|
-
buttonClassName: null,
|
|
92
|
-
buttonBorderClassName: null,
|
|
93
|
-
labelClassName: null,
|
|
94
|
-
arrowClassName: null,
|
|
95
|
-
focusable: true,
|
|
96
|
-
external: true,
|
|
97
|
-
openWebView: null,
|
|
98
|
-
onClick: null
|
|
99
|
-
};
|
|
100
44
|
function CallToAction(_ref) {
|
|
101
|
-
var type = _ref.type,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
45
|
+
var _ref$type = _ref.type,
|
|
46
|
+
type = _ref$type === void 0 ? null : _ref$type,
|
|
47
|
+
_ref$url = _ref.url,
|
|
48
|
+
url = _ref$url === void 0 ? null : _ref$url,
|
|
49
|
+
_ref$label = _ref.label,
|
|
50
|
+
label = _ref$label === void 0 ? null : _ref$label,
|
|
51
|
+
_ref$boxStyle = _ref.boxStyle,
|
|
52
|
+
boxStyle = _ref$boxStyle === void 0 ? null : _ref$boxStyle,
|
|
53
|
+
_ref$inWebView = _ref.inWebView,
|
|
54
|
+
inWebView = _ref$inWebView === void 0 ? false : _ref$inWebView,
|
|
55
|
+
_ref$elRef = _ref.elRef,
|
|
56
|
+
elRef = _ref$elRef === void 0 ? null : _ref$elRef,
|
|
57
|
+
_ref$disabled = _ref.disabled,
|
|
58
|
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
|
59
|
+
_ref$animationDisable = _ref.animationDisabled,
|
|
60
|
+
animationDisabled = _ref$animationDisable === void 0 ? false : _ref$animationDisable,
|
|
61
|
+
_ref$icon = _ref.icon,
|
|
62
|
+
icon = _ref$icon === void 0 ? null : _ref$icon,
|
|
63
|
+
_ref$arrow = _ref.arrow,
|
|
64
|
+
arrow = _ref$arrow === void 0 ? null : _ref$arrow,
|
|
65
|
+
_ref$dragAmount = _ref.dragAmount,
|
|
66
|
+
dragAmount = _ref$dragAmount === void 0 ? 50 : _ref$dragAmount,
|
|
67
|
+
_ref$className = _ref.className,
|
|
68
|
+
className = _ref$className === void 0 ? null : _ref$className,
|
|
69
|
+
_ref$buttonClassName = _ref.buttonClassName,
|
|
70
|
+
buttonClassName = _ref$buttonClassName === void 0 ? null : _ref$buttonClassName,
|
|
71
|
+
_ref$buttonBorderClas = _ref.buttonBorderClassName,
|
|
72
|
+
buttonBorderClassName = _ref$buttonBorderClas === void 0 ? null : _ref$buttonBorderClas,
|
|
73
|
+
_ref$labelClassName = _ref.labelClassName,
|
|
74
|
+
labelClassName = _ref$labelClassName === void 0 ? null : _ref$labelClassName,
|
|
75
|
+
_ref$arrowClassName = _ref.arrowClassName,
|
|
76
|
+
arrowClassName = _ref$arrowClassName === void 0 ? null : _ref$arrowClassName,
|
|
77
|
+
_ref$focusable = _ref.focusable,
|
|
78
|
+
focusable = _ref$focusable === void 0 ? true : _ref$focusable,
|
|
79
|
+
_ref$external = _ref.external,
|
|
80
|
+
external = _ref$external === void 0 ? true : _ref$external,
|
|
81
|
+
_ref$openWebView = _ref.openWebView,
|
|
82
|
+
openWebView = _ref$openWebView === void 0 ? null : _ref$openWebView,
|
|
83
|
+
_ref$onClick = _ref.onClick,
|
|
84
|
+
onClick = _ref$onClick === void 0 ? null : _ref$onClick;
|
|
121
85
|
var trackEvent = useTrackEvent();
|
|
122
86
|
var swipeUpEnabled = type === null || type === 'swipe-up';
|
|
123
87
|
var validUrl = useMemo(function () {
|
|
@@ -241,8 +205,6 @@ function CallToAction(_ref) {
|
|
|
241
205
|
inline: true
|
|
242
206
|
}))))));
|
|
243
207
|
}
|
|
244
|
-
CallToAction.propTypes = propTypes;
|
|
245
|
-
CallToAction.defaultProps = defaultProps;
|
|
246
208
|
var CallToAction_default = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
247
209
|
return /*#__PURE__*/React.createElement(CallToAction, Object.assign({
|
|
248
210
|
elRef: ref
|
package/es/styles.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@-webkit-keyframes micromag-element-call-to-action-appear{0%{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}@keyframes micromag-element-call-to-action-appear{0%{opacity:1;-webkit-transform:scale(0);transform:scale(0)}to{opacity:1;-webkit-transform:scale(1);transform:scale(1)}}.micromag-element-call-to-action-container{opacity:1;position:relative;text-align:center;-webkit-transition:opacity .3s ease;transition:opacity .3s ease;z-index:100}.micromag-element-call-to-action-container .micromag-element-call-to-action-arrow{-webkit-animation:micromag-element-call-to-action-upAndDown .5s ease-in-out infinite alternate;animation:micromag-element-call-to-action-upAndDown .5s ease-in-out infinite alternate;display:block;margin:0 auto 3px}.micromag-element-call-to-action-container .micromag-element-call-to-action-button{background-color:rgba(0,0,0,0);display:block;margin:0 auto;padding:5px 10px;-ms-touch-action:none;touch-action:none;-webkit-user-drag:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.micromag-element-call-to-action-container .micromag-element-call-to-action-button.micromag-element-call-to-action-withoutLinkStyle{-webkit-text-decoration:none;text-decoration:none}.micromag-element-call-to-action-container .micromag-element-call-to-action-button:hover{-webkit-text-decoration:none;text-decoration:none}.micromag-element-call-to-action-container .micromag-element-call-to-action-button:focus{-webkit-box-shadow:0 0 2px 2px #fff;box-shadow:0 0 2px 2px #fff;-webkit-box-shadow:0 0 2px 2px var(--micromag-focus-color,#fff);box-shadow:0 0 2px 2px var(--micromag-focus-color,#fff)}.micromag-element-call-to-action-container .micromag-element-call-to-action-label{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row;-ms-flex-align:center;align-items:center;-ms-flex-pack:center;justify-content:center}.micromag-element-call-to-action-container .micromag-element-call-to-action-icon{display:block}.micromag-element-call-to-action-container .micromag-element-call-to-action-text *{display:inline}.micromag-element-call-to-action-container .micromag-element-call-to-action-selfTargetLink{display:none}.micromag-element-call-to-action-container .micromag-element-call-to-action-leavingFrame{-webkit-animation:micromag-element-call-to-action-appear .5s ease both;animation:micromag-element-call-to-action-appear .5s ease both;background-color:#fff;height:100vh;left:0;opacity:0;position:fixed;top:0;-webkit-transform:scale(0);-ms-transform:scale(0);transform:scale(0);width:100vw}.micromag-element-call-to-action-container.micromag-element-call-to-action-animationDisabled .micromag-element-call-to-action-arrow{-webkit-animation:none;animation:none}.micromag-element-call-to-action-container.micromag-element-call-to-action-invalidUrl{opacity:.5;pointer-events:none}.micromag-element-call-to-action-container.micromag-element-call-to-action-invalidUrl .micromag-element-call-to-action-arrow{-webkit-animation:none;animation:none}.micromag-element-call-to-action-container.micromag-element-call-to-action-withMargin{margin-bottom:5px}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-call-to-action",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.6",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"module": "es/index.js",
|
|
35
35
|
"exports": {
|
|
36
36
|
".": {
|
|
37
|
+
"types": "./es/index.d.ts",
|
|
37
38
|
"import": "./es/index.js"
|
|
38
39
|
},
|
|
39
40
|
"./assets/css/styles": "./assets/css/styles.css",
|
|
@@ -47,37 +48,37 @@
|
|
|
47
48
|
"scripts": {
|
|
48
49
|
"clean": "rm -rf es && rm -rf lib && rm -rf assets",
|
|
49
50
|
"prepublishOnly": "npm run build",
|
|
50
|
-
"build": "../../scripts/prepare-package.sh"
|
|
51
|
+
"build": "../../scripts/prepare-package.sh --types"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"react": "^
|
|
54
|
-
"react-dom": "^
|
|
54
|
+
"react": "^19.2.0",
|
|
55
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
55
56
|
},
|
|
56
57
|
"peerDependencies": {
|
|
57
|
-
"react": "^
|
|
58
|
-
"react-dom": "^
|
|
58
|
+
"react": "^19.2.0",
|
|
59
|
+
"react-dom": "^18.3.0 || ^19.0.0"
|
|
59
60
|
},
|
|
60
61
|
"dependencies": {
|
|
61
|
-
"@babel/runtime": "^7.
|
|
62
|
-
"@fortawesome/fontawesome-svg-core": "^
|
|
63
|
-
"@fortawesome/free-solid-svg-icons": "^
|
|
64
|
-
"@fortawesome/react-fontawesome": "^
|
|
65
|
-
"@micromag/core": "^0.
|
|
66
|
-
"@micromag/element-button": "^0.
|
|
67
|
-
"@micromag/element-text": "^0.
|
|
68
|
-
"@micromag/element-webview": "^0.
|
|
69
|
-
"@react-spring/core": "^
|
|
70
|
-
"@react-spring/web": "^
|
|
62
|
+
"@babel/runtime": "^7.28.6",
|
|
63
|
+
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
64
|
+
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
65
|
+
"@fortawesome/react-fontawesome": "^3.2.0",
|
|
66
|
+
"@micromag/core": "^0.4.6",
|
|
67
|
+
"@micromag/element-button": "^0.4.6",
|
|
68
|
+
"@micromag/element-text": "^0.4.6",
|
|
69
|
+
"@micromag/element-webview": "^0.4.6",
|
|
70
|
+
"@react-spring/core": "^10.0.3",
|
|
71
|
+
"@react-spring/web": "^10.0.3",
|
|
71
72
|
"@use-gesture/react": "^10.3.0",
|
|
72
73
|
"classnames": "^2.2.6",
|
|
73
|
-
"lodash": "^4.17.
|
|
74
|
-
"
|
|
75
|
-
"react-intl": "^6.6.4",
|
|
74
|
+
"lodash": "^4.17.23",
|
|
75
|
+
"react-intl": "^8.1.3",
|
|
76
76
|
"uuid": "^9.0.0"
|
|
77
77
|
},
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public",
|
|
80
80
|
"registry": "https://registry.npmjs.org/"
|
|
81
81
|
},
|
|
82
|
-
"gitHead": "
|
|
82
|
+
"gitHead": "cf8440c2851b864167a1f545aa56551d55473263",
|
|
83
|
+
"types": "es/index.d.ts"
|
|
83
84
|
}
|