@semcore/feedback-form 3.3.3 → 3.6.0-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/CHANGELOG.md +18 -0
- package/README.md +4 -6
- package/lib/cjs/FeedbackForm.js +36 -25
- package/lib/cjs/FeedbackForm.js.map +1 -1
- package/lib/cjs/index.js +5 -1
- package/lib/cjs/style/feedback-form.shadow.css +6 -1
- package/lib/es6/FeedbackForm.js +31 -23
- package/lib/es6/FeedbackForm.js.map +1 -1
- package/lib/es6/style/feedback-form.shadow.css +6 -1
- package/package.json +3 -4
- package/src/FeedbackForm.js +25 -4
- package/src/style/feedback-form.shadow.css +6 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [3.5.1] - 2022-02-07
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- fixed styles for secondary Notice.
|
|
10
|
+
|
|
11
|
+
## [3.5.0] - 2022-01-25
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- Added support Tooltip props for `FeedbackForm.Item`.
|
|
16
|
+
|
|
17
|
+
## [3.4.0] - 2022-01-18
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Up version icons and use new icon.
|
|
22
|
+
|
|
5
23
|
## [3.3.3] - 2021-8-26
|
|
6
24
|
|
|
7
25
|
### Changed
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ import Link from '@semcore/link';
|
|
|
4
4
|
import Input from '@semcore/input';
|
|
5
5
|
import Textarea from '@semcore/textarea';
|
|
6
6
|
import Checkbox from '@semcore/checkbox';
|
|
7
|
-
import
|
|
7
|
+
import Chat from '@semcore/icon/Chat/m';
|
|
8
8
|
import Dropdown from '@semcore/dropdown';
|
|
9
9
|
import FeedbackForm from '@semcore/feedback-form';
|
|
10
10
|
import { Box } from '@semcore/flex-box';
|
|
@@ -15,16 +15,14 @@ import If from '@semcore/utils/lib/if';
|
|
|
15
15
|
class MyFeedback extends React.PureComponent {
|
|
16
16
|
render() {
|
|
17
17
|
const validateDescription = FeedbackForm.validate.description(
|
|
18
|
-
`
|
|
19
|
-
);
|
|
20
|
-
const validateEmail = FeedbackForm.validate.email(
|
|
21
|
-
`Please provide us with a valid email address so we could reply to you.`,
|
|
18
|
+
`Your feedback must contain at least 3 words (10 characters).`,
|
|
22
19
|
);
|
|
20
|
+
const validateEmail = FeedbackForm.validate.email(`Please enter valid email.`);
|
|
23
21
|
|
|
24
22
|
return (
|
|
25
23
|
<Dropdown>
|
|
26
24
|
<Dropdown.Trigger>
|
|
27
|
-
<Link before={<
|
|
25
|
+
<Link before={<Chat />}>Send feedback</Link>
|
|
28
26
|
</Dropdown.Trigger>
|
|
29
27
|
<Dropdown.Popper>
|
|
30
28
|
{({ changeVisible }) => (
|
package/lib/cjs/FeedbackForm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
|
|
4
|
-
|
|
5
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
4
|
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
@@ -45,11 +45,19 @@ var _notice = require("@semcore/notice");
|
|
|
45
45
|
|
|
46
46
|
var _flexBox = require("@semcore/flex-box");
|
|
47
47
|
|
|
48
|
-
var
|
|
48
|
+
var _pick = _interopRequireDefault(require("@semcore/utils/lib/pick"));
|
|
49
|
+
|
|
50
|
+
var _excluded = ["Children", "styles", "loading", "forwardRef"],
|
|
51
|
+
_excluded2 = ["Children", "tag"],
|
|
52
|
+
_excluded3 = ["input", "meta"];
|
|
49
53
|
|
|
50
|
-
function
|
|
54
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
51
55
|
|
|
52
|
-
function
|
|
56
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
57
|
+
|
|
58
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
59
|
+
|
|
60
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
53
61
|
|
|
54
62
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; }
|
|
55
63
|
|
|
@@ -60,18 +68,18 @@ var style = (
|
|
|
60
68
|
/*__reshadow_css_start__*/
|
|
61
69
|
_core.sstyled.insert(
|
|
62
70
|
/*__inner_css_start__*/
|
|
63
|
-
".
|
|
71
|
+
".___SFeedbackForm_1l5by_gg_{max-width:300px}.___SCancel_1l5by_gg_,.___SSubmit_1l5by_gg_{display:inline-flex;margin-right:8px}.___SNotice_1l5by_gg_._use_secondary_1l5by_gg_{border-width:1px 0 0;border-top-style:solid;border-radius:0 0 3px 3px}.___SSuccess_1l5by_gg_{display:flex;align-items:center;flex-direction:column;width:300px;padding:32px;box-sizing:border-box}.___SEmail_1l5by_gg_{margin-bottom:8px;color:#4fae33;width:80px;height:80px;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='80' height='80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.046a1.583 1.583 0 00-1.121.465L13.909 18.426a34.604 34.604 0 1048.938 48.938l12.915-12.916a1.58 1.58 0 00.464-1.12V5.944a.9.9 0 00-.9-.9l-47.381.002z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751l.2.353c6.141-3.452 24.182-13.678 27.531-10.531-1.138-3.107-17.039.327-27.731 10.178zM28.513 31.03C26.7 37.072 19.3 55.5 15.07 61.342l3.013.912 1.576-1.329c4.219-9.54 9.98-25.953 10.312-31.458-.51-.285-1.024.116-1.458 1.563z' fill='%23fff'/%3E%3Cpath d='M15.07 61.342C19.3 55.5 26.7 37.072 28.513 31.03c1.813-6.042 5.042 6.009 3.23 11.115' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.91 45.411C38.591 35.046 55.182 31.4 56.341 34.573c.688 1.886-13.429 6.259-18.408 12.316' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43c-3.245-1.16-8.592-2.891-11.449-3.689C36.95 15.907 69.787 3.753 72.5 2.5c-.922 4.106-4.924 18.28-6.716 24.933-4.827-1.682-9.728-3.158-12.922-4.193a70.111 70.111 0 00-5.417 8.351c-1.173-3.86-2.329-8.317-3.164-10.161z' fill='%23fff' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43l16.745-11.078M52.864 23.24L72.502 2.5M47.447 31.591l7.852-7.576' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173l3.455-5.641.973-1.127 2.064.61.436-.131-3.355 3.427-2.479 2.27-1.326 1.114.232-.522z' fill='%23000'/%3E%3Cpath d='M34.013 21.451L23.202 26.58M40.905 22.5l-6.892 4.362M62.293 28.365l-4.04 9.85' stroke='%23fff' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849c3.613 2.425-1.869 8.525-3.682 10.118M47.258 43.6c4.142 2.1 1.16 7.764-1.168 10.6M49.023 48.9c5.5 4.476-12.556 23.722-13.864 24.783' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88c13.658-2.117 20.2 10.047 20.459 13.52A116.386 116.386 0 0127.4 87.533' fill='%23000'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88c13.658-2.117 20.2 10.047 20.459 13.52A116.386 116.386 0 0127.4 87.533' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Cpath fill='%23fff' d='M0 0h80v80H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E\")}"
|
|
64
72
|
/*__inner_css_end__*/
|
|
65
|
-
, "
|
|
73
|
+
, "fwxdec_gg_")
|
|
66
74
|
/*__reshadow_css_end__*/
|
|
67
75
|
, {
|
|
68
|
-
"__SFeedbackForm": "
|
|
69
|
-
"__SCancel": "
|
|
70
|
-
"__SSubmit": "
|
|
71
|
-
"__SNotice": "
|
|
72
|
-
"_use_secondary": "
|
|
73
|
-
"__SSuccess": "
|
|
74
|
-
"__SEmail": "
|
|
76
|
+
"__SFeedbackForm": "___SFeedbackForm_1l5by_gg_",
|
|
77
|
+
"__SCancel": "___SCancel_1l5by_gg_",
|
|
78
|
+
"__SSubmit": "___SSubmit_1l5by_gg_",
|
|
79
|
+
"__SNotice": "___SNotice_1l5by_gg_",
|
|
80
|
+
"_use_secondary": "_use_secondary_1l5by_gg_",
|
|
81
|
+
"__SSuccess": "___SSuccess_1l5by_gg_",
|
|
82
|
+
"__SEmail": "___SEmail_1l5by_gg_"
|
|
75
83
|
});
|
|
76
84
|
|
|
77
85
|
var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
@@ -102,7 +110,7 @@ var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
|
102
110
|
styles = _this$asProps.styles,
|
|
103
111
|
loading = _this$asProps.loading,
|
|
104
112
|
forwardRef = _this$asProps.forwardRef,
|
|
105
|
-
other = (0, _objectWithoutProperties2["default"])(_this$asProps,
|
|
113
|
+
other = (0, _objectWithoutProperties2["default"])(_this$asProps, _excluded);
|
|
106
114
|
return /*#__PURE__*/_react["default"].createElement(_reactFinalForm.Form, (0, _extends2["default"])({
|
|
107
115
|
decorators: [this.focusDecorator]
|
|
108
116
|
}, other), function (api) {
|
|
@@ -156,26 +164,29 @@ var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
|
156
164
|
};
|
|
157
165
|
}
|
|
158
166
|
});
|
|
167
|
+
var TooltipProps = ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate'];
|
|
159
168
|
|
|
160
|
-
function Item(
|
|
169
|
+
function Item(_ref12) {
|
|
161
170
|
var _ref = this ? this.asProps : arguments[0],
|
|
162
171
|
_this2 = this;
|
|
163
172
|
|
|
164
|
-
var Children =
|
|
165
|
-
tag =
|
|
166
|
-
|
|
173
|
+
var Children = _ref12.Children,
|
|
174
|
+
tag = _ref12.tag,
|
|
175
|
+
props = (0, _objectWithoutProperties2["default"])(_ref12, _excluded2);
|
|
176
|
+
var tooltipProps = (0, _pick["default"])(props, TooltipProps);
|
|
177
|
+
return /*#__PURE__*/_react["default"].createElement(_reactFinalForm.Field, (0, _core.assignProps)({}, _ref), function (_ref13) {
|
|
167
178
|
var _ref2 = _this2 ? _this2.asProps : arguments[0];
|
|
168
179
|
|
|
169
|
-
var input =
|
|
170
|
-
meta =
|
|
171
|
-
other = (0, _objectWithoutProperties2["default"])(
|
|
180
|
+
var input = _ref13.input,
|
|
181
|
+
meta = _ref13.meta,
|
|
182
|
+
other = (0, _objectWithoutProperties2["default"])(_ref13, _excluded3);
|
|
172
183
|
var invalid = meta.invalid && meta.touched;
|
|
173
184
|
|
|
174
185
|
var inputProps = _objectSpread(_objectSpread({}, input), {}, {
|
|
175
186
|
state: invalid ? 'invalid' : 'normal'
|
|
176
187
|
});
|
|
177
188
|
|
|
178
|
-
return /*#__PURE__*/_react["default"].createElement(_tooltip["default"], {
|
|
189
|
+
return /*#__PURE__*/_react["default"].createElement(_tooltip["default"], (0, _extends2["default"])({
|
|
179
190
|
title: meta.error,
|
|
180
191
|
visible: invalid && meta.active,
|
|
181
192
|
inline: false,
|
|
@@ -184,7 +195,7 @@ function Item(props) {
|
|
|
184
195
|
flip: {
|
|
185
196
|
fallbackPlacements: ['right', 'bottom']
|
|
186
197
|
}
|
|
187
|
-
}, tag && /*#__PURE__*/_react["default"].createElement("tag", (0, _core.assignProps)(_objectSpread({}, inputProps), _ref2)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
|
|
198
|
+
}, tooltipProps), tag && /*#__PURE__*/_react["default"].createElement("tag", (0, _core.assignProps)(_objectSpread({}, inputProps), _ref2)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
|
|
188
199
|
input: inputProps,
|
|
189
200
|
meta: meta
|
|
190
201
|
}, other)));
|
|
@@ -198,7 +209,7 @@ function Success(props) {
|
|
|
198
209
|
var Children = props.Children,
|
|
199
210
|
styles = props.styles;
|
|
200
211
|
var SSuccess = _flexBox.Box;
|
|
201
|
-
var SEmail =
|
|
212
|
+
var SEmail = 'div';
|
|
202
213
|
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SSuccess, _ref8.cn("SSuccess", _objectSpread({}, (0, _core.assignProps)({}, _ref3))), /*#__PURE__*/_react["default"].createElement(SEmail, _ref8.cn("SEmail", {})), /*#__PURE__*/_react["default"].createElement("span", _ref8.cn("span", {}), /*#__PURE__*/_react["default"].createElement(Children, _ref8.cn("Children", {}))));
|
|
203
214
|
} // because it is used without a wrapper
|
|
204
215
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/FeedbackForm.js"],"names":["FeedbackForm","SFeedbackForm","Box","asProps","Children","styles","loading","forwardRef","other","focusDecorator","api","undefined","submitting","handleSubmit","origin","Component","style","Field","Form","onSubmit","description","error","value","words","split","symbols","join","length","email","test","String","toLowerCase","Item","props","
|
|
1
|
+
{"version":3,"sources":["../../src/FeedbackForm.js"],"names":["FeedbackForm","SFeedbackForm","Box","asProps","Children","styles","loading","forwardRef","other","focusDecorator","api","undefined","submitting","handleSubmit","origin","Component","style","Field","Form","onSubmit","description","error","value","words","split","symbols","join","length","email","test","String","toLowerCase","TooltipProps","Item","tag","props","tooltipProps","input","meta","invalid","touched","inputProps","state","active","fallbackPlacements","Success","SSuccess","SEmail","Submit","SSubmit","Button","Cancel","SCancel","Notice","SNotice","NoticeSmart","defaultProps","theme","use"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA;;AAJA;;AACA;;AACA;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIMA,Y;;;;;;;;;;;;;;;uGA2Ba,iC;;;;;;WAEjB,kBAAS;AACP,UAAMC,aAAa,GAAGC,YAAtB;AACA,0BAA4D,KAAKC,OAAjE;AAAA,UAAQC,QAAR,iBAAQA,QAAR;AAAA,UAAkBC,MAAlB,iBAAkBA,MAAlB;AAAA,UAA0BC,OAA1B,iBAA0BA,OAA1B;AAAA,UAAmCC,UAAnC,iBAAmCA,UAAnC;AAAA,UAAkDC,KAAlD;AAEA,0BACE,gCAAC,oBAAD;AAAM,QAAA,UAAU,EAAE,CAAC,KAAKC,cAAN;AAAlB,SAA6CD,KAA7C,GACG,UAACE,GAAD;AAAA;;AAAA,uBACC,mBAAQL,MAAR,CADD,eAEG,gCAAC,yBAAD;AAAA,kBAAoB,IAApB;AAAA,qBAAkCC,OAAO,KAAKK,SAAZ,GAAwBD,GAAG,CAACE,UAA5B,GAAyCN;AAA3E,yBACE,gCAAC,aAAD;AAAA,iBACM,MADN;AAAA;AAAA,oBAGS,MAHT;AAAA,iBAIOC;AAJP,WAKMC,KALN;AAAA,sBAMYE,GAAG,CAACG;AANhB,aAQG,OAAOT,QAAQ,CAACU,MAAhB,KAA2B,UAA3B,GAAwCV,QAAQ,CAACU,MAAT,CAAgBJ,GAAhB,CAAxC,gBAA+D,gCAAC,QAAD,2BARlE,CADF,CAFH;AAAA,OADH,CADF;AAoBD;;;EArDwBK,e;;iCAArBf,Y,iBACiB,c;iCADjBA,Y,WAEWgB,K;iCAFXhB,Y,eAGe;AACj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wC,OAAO,CAAC7B,KAAR,GAAgBA,KAAhB;;AAEA,SAASgC,MAAT,CAAgBb,KAAhB,EAAuB;AAAA;AAAA;;AACrB,MAAQ9B,MAAR,GAAmB8B,KAAnB,CAAQ9B,MAAR;AACA,MAAM4C,OAAO,GAC2BC,kBADxC;AACA,iBAAO,mBAAQ7C,MAAR,CAAP,eAAuB,gCAAC,OAAD;AAAA,YAA8B,QAA9B;AAAA,WAA2C,SAA3C;AAAA,aAA2D;AAA3D,cAAvB;AACD;;AAED,SAAS8C,MAAT,CAAgBhB,KAAhB,EAAuB;AAAA;AAAA;;AACrB,MAAQ9B,MAAR,GAAmB8B,KAAnB,CAAQ9B,MAAR;AACA,MAAM+C,OAAO,GAC2BF,kBADxC;AACA,kBAAO,mBAAQ7C,MAAR,CAAP,eAAuB,gCAAC,OAAD;AAAA,YAA8B,OAA9B;AAAA,WAA0C,WAA1C;AAAA,aAA4D;AAA5D,cAAvB;AACD;;AAED,SAASgD,MAAT,CAAgBlB,KAAhB,EAAuB;AAAA;AAAA;;AACrB,MAAQ9B,MAAR,GAAmB8B,KAAnB,CAAQ9B,MAAR;AACA,MAAMiD,OAAO,GAC2BC,mBADxC;AACA,kBAAO,mBAAQlD,MAAR,CAAP,eAAuB,gCAAC,OAAD,6EAAvB;AACD;;AAEDgD,MAAM,CAACG,YAAP,GAAsB;AACpBC,EAAAA,KAAK,EAAE,QADa;AAEpBC,EAAAA,GAAG,EAAE;AAFe,CAAtB;;eAKe,sBAAgB1D,YAAhB,EAA8B;AAC3CiC,EAAAA,IAAI,EAAJA,IAD2C;AAE3CY,EAAAA,OAAO,EAAPA,OAF2C;AAG3CG,EAAAA,MAAM,EAANA,MAH2C;AAI3CG,EAAAA,MAAM,EAANA,MAJ2C;AAK3CE,EAAAA,MAAM,EAANA;AAL2C,CAA9B,C","sourcesContent":["import React from 'react';\nimport { Field, Form } from 'react-final-form';\nimport createFocusDecorator from 'final-form-focus';\n\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport Button from '@semcore/button';\nimport SpinContainer from '@semcore/spin-container';\nimport Tooltip from '@semcore/tooltip';\nimport { NoticeSmart } from '@semcore/notice';\nimport { Box } from '@semcore/flex-box';\nimport pick from '@semcore/utils/lib/pick';\n\nimport style from './style/feedback-form.shadow.css';\n\nclass FeedbackForm extends Component {\n static displayName = 'FeedbackForm';\n static style = style;\n static FinalForm = {\n Field,\n Form,\n };\n\n static defaultProps = {\n onSubmit: () => {},\n };\n\n static validate = {\n description: (error) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (symbols.length < 10 || words.length < 3) {\n return error;\n }\n },\n email: (error) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, loading, forwardRef, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer size=\"xl\" loading={loading === undefined ? api.submitting : loading}>\n <SFeedbackForm\n tag=\"form\"\n noValidate\n method=\"POST\"\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n {typeof Children.origin === 'function' ? Children.origin(api) : <Children />}\n </SFeedbackForm>\n </SpinContainer>,\n )\n }\n </Form>\n );\n }\n}\n\nconst TooltipProps = [\n 'title',\n 'theme',\n 'strategy',\n 'modifiers',\n 'placement',\n 'interaction',\n 'timeout',\n 'visible',\n 'defaultVisible',\n 'onVisibleChange',\n 'offset',\n 'preventOverflow',\n 'arrow',\n 'flip',\n 'computeStyles',\n 'eventListeners',\n 'onFirstUpdate',\n];\n\nfunction Item({ Children, tag, ...props }) {\n const tooltipProps = pick(props, TooltipProps);\n\n return (\n <Root render={Field}>\n {({ input, meta, ...other }) => {\n const invalid = meta.invalid && meta.touched;\n const inputProps = {\n ...input,\n state: invalid ? 'invalid' : 'normal',\n };\n return (\n <Tooltip\n title={meta.error}\n visible={invalid && meta.active}\n inline={false}\n theme=\"warning\"\n placement=\"left\"\n flip={{\n fallbackPlacements: ['right', 'bottom'],\n }}\n {...tooltipProps}\n >\n {tag && <Root render={tag} {...inputProps} />}\n {typeof Children.origin === 'function' &&\n Children.origin({\n input: inputProps,\n meta,\n ...other,\n })}\n </Tooltip>\n );\n }}\n </Root>\n );\n}\n\nfunction Success(props) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = 'div';\n\n return sstyled(styles)(\n <SSuccess render={Box}>\n <SEmail />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Submit(props) {\n const { styles } = props;\n const SSubmit = Root;\n return sstyled(styles)(<SSubmit render={Button} type=\"submit\" use=\"primary\" theme=\"success\" />);\n}\n\nfunction Cancel(props) {\n const { styles } = props;\n const SCancel = Root;\n return sstyled(styles)(<SCancel render={Button} type=\"reset\" use=\"secondary\" theme=\"muted\" />);\n}\n\nfunction Notice(props) {\n const { styles } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} />);\n}\n\nNotice.defaultProps = {\n theme: 'gray94',\n use: 'secondary',\n};\n\nexport default createComponent(FeedbackForm, {\n Item,\n Success,\n Submit,\n Cancel,\n Notice,\n});\n"],"file":"FeedbackForm.js"}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
4
4
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
@@ -26,4 +26,8 @@ Object.keys(_FeedbackForm).forEach(function (key) {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
});
|
|
29
|
+
|
|
30
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
31
|
+
|
|
32
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
29
33
|
//# sourceMappingURL=index.js.map
|
|
@@ -11,7 +11,9 @@ SCancel {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
SNotice[use='secondary'] {
|
|
14
|
-
border:
|
|
14
|
+
border-width: 1px 0 0;
|
|
15
|
+
border-top-style: solid;
|
|
16
|
+
border-radius: 0 0 3px 3px;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
SSuccess {
|
|
@@ -26,4 +28,7 @@ SSuccess {
|
|
|
26
28
|
SEmail {
|
|
27
29
|
margin-bottom: 8px;
|
|
28
30
|
color: var(--green);
|
|
31
|
+
width: 80px;
|
|
32
|
+
height: 80px;
|
|
33
|
+
background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.04601C27.7367 5.04597 27.5305 5.08702 27.3381 5.16681C27.1458 5.24661 26.971 5.36357 26.8239 5.51101L13.909 18.426C7.41937 24.9156 3.77356 33.7174 3.77356 42.895C3.77356 52.0727 7.41937 60.8744 13.909 67.364C20.3985 73.8536 29.2003 77.4994 38.3779 77.4994C47.5556 77.4994 56.3574 73.8536 62.847 67.364L75.762 54.448C75.9092 54.3011 76.026 54.1265 76.1056 53.9343C76.1853 53.7421 76.2262 53.536 76.226 53.328V5.94401C76.226 5.70531 76.1311 5.47639 75.9623 5.30761C75.7936 5.13883 75.5646 5.04401 75.326 5.04401L27.945 5.04601Z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751L28.815 45.104C34.956 41.652 52.997 31.426 56.346 34.573C55.208 31.466 39.307 34.9 28.615 44.751Z' fill='white'/%3E%3Cpath d='M28.5129 31.03C26.6999 37.072 19.2999 55.5 15.0699 61.342L18.0829 62.254L19.6589 60.925C23.8779 51.385 29.6389 34.972 29.9709 29.467C29.4619 29.182 28.9469 29.583 28.5129 31.03Z' fill='white'/%3E%3Cpath d='M15.0699 61.342C19.2999 55.5 26.6999 37.072 28.5129 31.03C30.3259 24.988 33.5549 37.039 31.7429 42.145' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.9091 45.411C38.5921 35.046 55.1831 31.4 56.3421 34.573C57.0301 36.459 42.9131 40.832 37.9341 46.889' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43C41.036 20.27 35.689 18.539 32.832 17.741C36.95 15.907 69.787 3.753 72.5 2.5C71.578 6.606 67.576 20.78 65.784 27.433C60.957 25.751 56.056 24.275 52.862 23.24C50.8608 25.8918 49.0505 28.6825 47.445 31.591C46.272 27.731 45.116 23.274 44.281 21.43Z' fill='white' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43L61.026 10.352' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M52.864 23.24L72.502 2.5' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.447 31.591L55.299 24.015' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173L51.891 24.532L52.864 23.405L54.928 24.015L55.364 23.884L52.009 27.311L49.53 29.581L48.204 30.695L48.436 30.173Z' fill='black'/%3E%3Cpath d='M34.013 21.451L23.202 26.58' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40.9049 22.5L34.0129 26.862' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M62.2931 28.365L58.2531 38.215' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849C49.703 43.274 44.221 49.374 42.408 50.967' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.258 43.6C51.4 45.7 48.418 51.364 46.09 54.2' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M49.0231 48.9C54.5231 53.376 36.4671 72.622 35.1591 73.683' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' fill='black'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Crect width='80' height='80' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
|
|
29
34
|
}
|
package/lib/es6/FeedbackForm.js
CHANGED
|
@@ -14,10 +14,13 @@ import { assignProps as _assignProps4 } from "@semcore/core";
|
|
|
14
14
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
15
15
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
16
16
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
17
|
+
var _excluded = ["Children", "styles", "loading", "forwardRef"],
|
|
18
|
+
_excluded2 = ["Children", "tag"],
|
|
19
|
+
_excluded3 = ["input", "meta"];
|
|
17
20
|
|
|
18
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object);
|
|
21
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19
22
|
|
|
20
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]
|
|
23
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
21
24
|
|
|
22
25
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
23
26
|
|
|
@@ -32,25 +35,25 @@ import SpinContainer from '@semcore/spin-container';
|
|
|
32
35
|
import Tooltip from '@semcore/tooltip';
|
|
33
36
|
import { NoticeSmart } from '@semcore/notice';
|
|
34
37
|
import { Box } from '@semcore/flex-box';
|
|
35
|
-
import
|
|
38
|
+
import pick from '@semcore/utils/lib/pick';
|
|
36
39
|
|
|
37
40
|
/*__reshadow-styles__:"./style/feedback-form.shadow.css"*/
|
|
38
41
|
var style = (
|
|
39
42
|
/*__reshadow_css_start__*/
|
|
40
43
|
_sstyled.insert(
|
|
41
44
|
/*__inner_css_start__*/
|
|
42
|
-
".
|
|
45
|
+
".___SFeedbackForm_1l5by_gg_{max-width:300px}.___SCancel_1l5by_gg_,.___SSubmit_1l5by_gg_{display:inline-flex;margin-right:8px}.___SNotice_1l5by_gg_._use_secondary_1l5by_gg_{border-width:1px 0 0;border-top-style:solid;border-radius:0 0 3px 3px}.___SSuccess_1l5by_gg_{display:flex;align-items:center;flex-direction:column;width:300px;padding:32px;box-sizing:border-box}.___SEmail_1l5by_gg_{margin-bottom:8px;color:#4fae33;width:80px;height:80px;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='80' height='80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.046a1.583 1.583 0 00-1.121.465L13.909 18.426a34.604 34.604 0 1048.938 48.938l12.915-12.916a1.58 1.58 0 00.464-1.12V5.944a.9.9 0 00-.9-.9l-47.381.002z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751l.2.353c6.141-3.452 24.182-13.678 27.531-10.531-1.138-3.107-17.039.327-27.731 10.178zM28.513 31.03C26.7 37.072 19.3 55.5 15.07 61.342l3.013.912 1.576-1.329c4.219-9.54 9.98-25.953 10.312-31.458-.51-.285-1.024.116-1.458 1.563z' fill='%23fff'/%3E%3Cpath d='M15.07 61.342C19.3 55.5 26.7 37.072 28.513 31.03c1.813-6.042 5.042 6.009 3.23 11.115' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.91 45.411C38.591 35.046 55.182 31.4 56.341 34.573c.688 1.886-13.429 6.259-18.408 12.316' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43c-3.245-1.16-8.592-2.891-11.449-3.689C36.95 15.907 69.787 3.753 72.5 2.5c-.922 4.106-4.924 18.28-6.716 24.933-4.827-1.682-9.728-3.158-12.922-4.193a70.111 70.111 0 00-5.417 8.351c-1.173-3.86-2.329-8.317-3.164-10.161z' fill='%23fff' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43l16.745-11.078M52.864 23.24L72.502 2.5M47.447 31.591l7.852-7.576' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173l3.455-5.641.973-1.127 2.064.61.436-.131-3.355 3.427-2.479 2.27-1.326 1.114.232-.522z' fill='%23000'/%3E%3Cpath d='M34.013 21.451L23.202 26.58M40.905 22.5l-6.892 4.362M62.293 28.365l-4.04 9.85' stroke='%23fff' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849c3.613 2.425-1.869 8.525-3.682 10.118M47.258 43.6c4.142 2.1 1.16 7.764-1.168 10.6M49.023 48.9c5.5 4.476-12.556 23.722-13.864 24.783' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88c13.658-2.117 20.2 10.047 20.459 13.52A116.386 116.386 0 0127.4 87.533' fill='%23000'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88c13.658-2.117 20.2 10.047 20.459 13.52A116.386 116.386 0 0127.4 87.533' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Cpath fill='%23fff' d='M0 0h80v80H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E\")}"
|
|
43
46
|
/*__inner_css_end__*/
|
|
44
|
-
, "
|
|
47
|
+
, "fwxdec_gg_")
|
|
45
48
|
/*__reshadow_css_end__*/
|
|
46
49
|
, {
|
|
47
|
-
"__SFeedbackForm": "
|
|
48
|
-
"__SCancel": "
|
|
49
|
-
"__SSubmit": "
|
|
50
|
-
"__SNotice": "
|
|
51
|
-
"_use_secondary": "
|
|
52
|
-
"__SSuccess": "
|
|
53
|
-
"__SEmail": "
|
|
50
|
+
"__SFeedbackForm": "___SFeedbackForm_1l5by_gg_",
|
|
51
|
+
"__SCancel": "___SCancel_1l5by_gg_",
|
|
52
|
+
"__SSubmit": "___SSubmit_1l5by_gg_",
|
|
53
|
+
"__SNotice": "___SNotice_1l5by_gg_",
|
|
54
|
+
"_use_secondary": "_use_secondary_1l5by_gg_",
|
|
55
|
+
"__SSuccess": "___SSuccess_1l5by_gg_",
|
|
56
|
+
"__SEmail": "___SEmail_1l5by_gg_"
|
|
54
57
|
});
|
|
55
58
|
|
|
56
59
|
var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
@@ -84,7 +87,7 @@ var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
|
84
87
|
styles = _this$asProps.styles,
|
|
85
88
|
loading = _this$asProps.loading,
|
|
86
89
|
forwardRef = _this$asProps.forwardRef,
|
|
87
|
-
other = _objectWithoutProperties(_this$asProps,
|
|
90
|
+
other = _objectWithoutProperties(_this$asProps, _excluded);
|
|
88
91
|
|
|
89
92
|
return /*#__PURE__*/React.createElement(Form, _extends({
|
|
90
93
|
decorators: [this.focusDecorator]
|
|
@@ -145,18 +148,23 @@ _defineProperty(FeedbackForm, "validate", {
|
|
|
145
148
|
}
|
|
146
149
|
});
|
|
147
150
|
|
|
148
|
-
|
|
151
|
+
var TooltipProps = ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate'];
|
|
152
|
+
|
|
153
|
+
function Item(_ref12) {
|
|
149
154
|
var _ref = this ? this.asProps : arguments[0],
|
|
150
155
|
_this2 = this;
|
|
151
156
|
|
|
152
|
-
var Children =
|
|
153
|
-
tag =
|
|
154
|
-
|
|
157
|
+
var Children = _ref12.Children,
|
|
158
|
+
tag = _ref12.tag,
|
|
159
|
+
props = _objectWithoutProperties(_ref12, _excluded2);
|
|
160
|
+
|
|
161
|
+
var tooltipProps = pick(props, TooltipProps);
|
|
162
|
+
return /*#__PURE__*/React.createElement(Field, _assignProps({}, _ref), function (_ref13) {
|
|
155
163
|
var _ref2 = _this2 ? _this2.asProps : arguments[0];
|
|
156
164
|
|
|
157
|
-
var input =
|
|
158
|
-
meta =
|
|
159
|
-
other = _objectWithoutProperties(
|
|
165
|
+
var input = _ref13.input,
|
|
166
|
+
meta = _ref13.meta,
|
|
167
|
+
other = _objectWithoutProperties(_ref13, _excluded3);
|
|
160
168
|
|
|
161
169
|
var invalid = meta.invalid && meta.touched;
|
|
162
170
|
|
|
@@ -164,7 +172,7 @@ function Item(props) {
|
|
|
164
172
|
state: invalid ? 'invalid' : 'normal'
|
|
165
173
|
});
|
|
166
174
|
|
|
167
|
-
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
175
|
+
return /*#__PURE__*/React.createElement(Tooltip, _extends({
|
|
168
176
|
title: meta.error,
|
|
169
177
|
visible: invalid && meta.active,
|
|
170
178
|
inline: false,
|
|
@@ -173,7 +181,7 @@ function Item(props) {
|
|
|
173
181
|
flip: {
|
|
174
182
|
fallbackPlacements: ['right', 'bottom']
|
|
175
183
|
}
|
|
176
|
-
}, tag && /*#__PURE__*/React.createElement("tag", _assignProps2(_objectSpread({}, inputProps), _ref2)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
|
|
184
|
+
}, tooltipProps), tag && /*#__PURE__*/React.createElement("tag", _assignProps2(_objectSpread({}, inputProps), _ref2)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
|
|
177
185
|
input: inputProps,
|
|
178
186
|
meta: meta
|
|
179
187
|
}, other)));
|
|
@@ -187,7 +195,7 @@ function Success(props) {
|
|
|
187
195
|
var Children = props.Children,
|
|
188
196
|
styles = props.styles;
|
|
189
197
|
var SSuccess = Box;
|
|
190
|
-
var SEmail =
|
|
198
|
+
var SEmail = 'div';
|
|
191
199
|
return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SSuccess, _ref8.cn("SSuccess", _objectSpread({}, _assignProps3({}, _ref3))), /*#__PURE__*/React.createElement(SEmail, _ref8.cn("SEmail", {})), /*#__PURE__*/React.createElement("span", _ref8.cn("span", {}), /*#__PURE__*/React.createElement(Children, _ref8.cn("Children", {}))));
|
|
192
200
|
} // because it is used without a wrapper
|
|
193
201
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/FeedbackForm.js"],"names":["React","Field","Form","createFocusDecorator","createComponent","Component","sstyled","Root","Button","SpinContainer","Tooltip","NoticeSmart","Box","
|
|
1
|
+
{"version":3,"sources":["../../src/FeedbackForm.js"],"names":["React","Field","Form","createFocusDecorator","createComponent","Component","sstyled","Root","Button","SpinContainer","Tooltip","NoticeSmart","Box","pick","FeedbackForm","SFeedbackForm","asProps","Children","styles","loading","forwardRef","other","focusDecorator","api","undefined","submitting","handleSubmit","origin","style","onSubmit","description","error","value","words","split","symbols","join","length","email","test","String","toLowerCase","TooltipProps","Item","tag","props","tooltipProps","input","meta","invalid","touched","inputProps","state","active","fallbackPlacements","Success","SSuccess","SEmail","Submit","SSubmit","Cancel","SCancel","Notice","SNotice","defaultProps","theme","use"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,KAAT,EAAgBC,IAAhB,QAA4B,kBAA5B;AACA,OAAOC,oBAAP,MAAiC,kBAAjC;AAEA,OAAOC,eAAP,IAA0BC,SAA1B,EAAqCC,OAAr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AR,GAAgBA,KAAhB;;AAEA,SAAS8B,MAAT,CAAgBb,KAAhB,EAAuB;AAAA;AAAA;;AACrB,MAAQ3B,MAAR,GAAmB2B,KAAnB,CAAQ3B,MAAR;AACA,MAAMyC,OAAO,GAC2BnD,MADxC;AACA,iBAAOF,OAAO,CAACY,MAAD,CAAd,eAAuB,oBAAC,OAAD;AAAA,YAA8B,QAA9B;AAAA,WAA2C,SAA3C;AAAA,aAA2D;AAA3D,cAAvB;AACD;;AAED,SAAS0C,MAAT,CAAgBf,KAAhB,EAAuB;AAAA;AAAA;;AACrB,MAAQ3B,MAAR,GAAmB2B,KAAnB,CAAQ3B,MAAR;AACA,MAAM2C,OAAO,GAC2BrD,MADxC;AACA,kBAAOF,OAAO,CAACY,MAAD,CAAd,eAAuB,oBAAC,OAAD;AAAA,YAA8B,OAA9B;AAAA,WAA0C,WAA1C;AAAA,aAA4D;AAA5D,cAAvB;AACD;;AAED,SAAS4C,MAAT,CAAgBjB,KAAhB,EAAuB;AAAA;AAAA;;AACrB,MAAQ3B,MAAR,GAAmB2B,KAAnB,CAAQ3B,MAAR;AACA,MAAM6C,OAAO,GAC2BpD,WADxC;AACA,kBAAOL,OAAO,CAACY,MAAD,CAAd,eAAuB,oBAAC,OAAD,oEAAvB;AACD;;AAED4C,MAAM,CAACE,YAAP,GAAsB;AACpBC,EAAAA,KAAK,EAAE,QADa;AAEpBC,EAAAA,GAAG,EAAE;AAFe,CAAtB;AAKA,eAAe9D,eAAe,CAACU,YAAD,EAAe;AAC3C6B,EAAAA,IAAI,EAAJA,IAD2C;AAE3CY,EAAAA,OAAO,EAAPA,OAF2C;AAG3CG,EAAAA,MAAM,EAANA,MAH2C;AAI3CE,EAAAA,MAAM,EAANA,MAJ2C;AAK3CE,EAAAA,MAAM,EAANA;AAL2C,CAAf,CAA9B","sourcesContent":["import React from 'react';\nimport { Field, Form } from 'react-final-form';\nimport createFocusDecorator from 'final-form-focus';\n\nimport createComponent, { Component, sstyled, Root } from '@semcore/core';\nimport Button from '@semcore/button';\nimport SpinContainer from '@semcore/spin-container';\nimport Tooltip from '@semcore/tooltip';\nimport { NoticeSmart } from '@semcore/notice';\nimport { Box } from '@semcore/flex-box';\nimport pick from '@semcore/utils/lib/pick';\n\nimport style from './style/feedback-form.shadow.css';\n\nclass FeedbackForm extends Component {\n static displayName = 'FeedbackForm';\n static style = style;\n static FinalForm = {\n Field,\n Form,\n };\n\n static defaultProps = {\n onSubmit: () => {},\n };\n\n static validate = {\n description: (error) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (symbols.length < 10 || words.length < 3) {\n return error;\n }\n },\n email: (error) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, loading, forwardRef, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer size=\"xl\" loading={loading === undefined ? api.submitting : loading}>\n <SFeedbackForm\n tag=\"form\"\n noValidate\n method=\"POST\"\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n {typeof Children.origin === 'function' ? Children.origin(api) : <Children />}\n </SFeedbackForm>\n </SpinContainer>,\n )\n }\n </Form>\n );\n }\n}\n\nconst TooltipProps = [\n 'title',\n 'theme',\n 'strategy',\n 'modifiers',\n 'placement',\n 'interaction',\n 'timeout',\n 'visible',\n 'defaultVisible',\n 'onVisibleChange',\n 'offset',\n 'preventOverflow',\n 'arrow',\n 'flip',\n 'computeStyles',\n 'eventListeners',\n 'onFirstUpdate',\n];\n\nfunction Item({ Children, tag, ...props }) {\n const tooltipProps = pick(props, TooltipProps);\n\n return (\n <Root render={Field}>\n {({ input, meta, ...other }) => {\n const invalid = meta.invalid && meta.touched;\n const inputProps = {\n ...input,\n state: invalid ? 'invalid' : 'normal',\n };\n return (\n <Tooltip\n title={meta.error}\n visible={invalid && meta.active}\n inline={false}\n theme=\"warning\"\n placement=\"left\"\n flip={{\n fallbackPlacements: ['right', 'bottom'],\n }}\n {...tooltipProps}\n >\n {tag && <Root render={tag} {...inputProps} />}\n {typeof Children.origin === 'function' &&\n Children.origin({\n input: inputProps,\n meta,\n ...other,\n })}\n </Tooltip>\n );\n }}\n </Root>\n );\n}\n\nfunction Success(props) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = 'div';\n\n return sstyled(styles)(\n <SSuccess render={Box}>\n <SEmail />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Submit(props) {\n const { styles } = props;\n const SSubmit = Root;\n return sstyled(styles)(<SSubmit render={Button} type=\"submit\" use=\"primary\" theme=\"success\" />);\n}\n\nfunction Cancel(props) {\n const { styles } = props;\n const SCancel = Root;\n return sstyled(styles)(<SCancel render={Button} type=\"reset\" use=\"secondary\" theme=\"muted\" />);\n}\n\nfunction Notice(props) {\n const { styles } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} />);\n}\n\nNotice.defaultProps = {\n theme: 'gray94',\n use: 'secondary',\n};\n\nexport default createComponent(FeedbackForm, {\n Item,\n Success,\n Submit,\n Cancel,\n Notice,\n});\n"],"file":"FeedbackForm.js"}
|
|
@@ -11,7 +11,9 @@ SCancel {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
SNotice[use='secondary'] {
|
|
14
|
-
border:
|
|
14
|
+
border-width: 1px 0 0;
|
|
15
|
+
border-top-style: solid;
|
|
16
|
+
border-radius: 0 0 3px 3px;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
SSuccess {
|
|
@@ -26,4 +28,7 @@ SSuccess {
|
|
|
26
28
|
SEmail {
|
|
27
29
|
margin-bottom: 8px;
|
|
28
30
|
color: var(--green);
|
|
31
|
+
width: 80px;
|
|
32
|
+
height: 80px;
|
|
33
|
+
background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.04601C27.7367 5.04597 27.5305 5.08702 27.3381 5.16681C27.1458 5.24661 26.971 5.36357 26.8239 5.51101L13.909 18.426C7.41937 24.9156 3.77356 33.7174 3.77356 42.895C3.77356 52.0727 7.41937 60.8744 13.909 67.364C20.3985 73.8536 29.2003 77.4994 38.3779 77.4994C47.5556 77.4994 56.3574 73.8536 62.847 67.364L75.762 54.448C75.9092 54.3011 76.026 54.1265 76.1056 53.9343C76.1853 53.7421 76.2262 53.536 76.226 53.328V5.94401C76.226 5.70531 76.1311 5.47639 75.9623 5.30761C75.7936 5.13883 75.5646 5.04401 75.326 5.04401L27.945 5.04601Z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751L28.815 45.104C34.956 41.652 52.997 31.426 56.346 34.573C55.208 31.466 39.307 34.9 28.615 44.751Z' fill='white'/%3E%3Cpath d='M28.5129 31.03C26.6999 37.072 19.2999 55.5 15.0699 61.342L18.0829 62.254L19.6589 60.925C23.8779 51.385 29.6389 34.972 29.9709 29.467C29.4619 29.182 28.9469 29.583 28.5129 31.03Z' fill='white'/%3E%3Cpath d='M15.0699 61.342C19.2999 55.5 26.6999 37.072 28.5129 31.03C30.3259 24.988 33.5549 37.039 31.7429 42.145' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.9091 45.411C38.5921 35.046 55.1831 31.4 56.3421 34.573C57.0301 36.459 42.9131 40.832 37.9341 46.889' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43C41.036 20.27 35.689 18.539 32.832 17.741C36.95 15.907 69.787 3.753 72.5 2.5C71.578 6.606 67.576 20.78 65.784 27.433C60.957 25.751 56.056 24.275 52.862 23.24C50.8608 25.8918 49.0505 28.6825 47.445 31.591C46.272 27.731 45.116 23.274 44.281 21.43Z' fill='white' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43L61.026 10.352' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M52.864 23.24L72.502 2.5' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.447 31.591L55.299 24.015' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173L51.891 24.532L52.864 23.405L54.928 24.015L55.364 23.884L52.009 27.311L49.53 29.581L48.204 30.695L48.436 30.173Z' fill='black'/%3E%3Cpath d='M34.013 21.451L23.202 26.58' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40.9049 22.5L34.0129 26.862' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M62.2931 28.365L58.2531 38.215' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849C49.703 43.274 44.221 49.374 42.408 50.967' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.258 43.6C51.4 45.7 48.418 51.364 46.09 54.2' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M49.0231 48.9C54.5231 53.376 36.4671 72.622 35.1591 73.683' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' fill='black'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Crect width='80' height='80' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
|
|
29
34
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/feedback-form",
|
|
3
3
|
"description": "SEMRush Feedback Form Component",
|
|
4
|
-
"version": "3.
|
|
4
|
+
"version": "3.6.0-0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
"@semcore/flex-box": "^4",
|
|
18
18
|
"@semcore/tooltip": "^4",
|
|
19
19
|
"@semcore/spin-container": "^4",
|
|
20
|
-
"@semcore/
|
|
21
|
-
"@semcore/button": "^3",
|
|
20
|
+
"@semcore/button": "^3.3.3-1",
|
|
22
21
|
"@semcore/notice": "^3",
|
|
23
22
|
"final-form": "^4.19",
|
|
24
23
|
"final-form-focus": "^1.1",
|
|
@@ -29,6 +28,6 @@
|
|
|
29
28
|
"react": "16.8 - 17"
|
|
30
29
|
},
|
|
31
30
|
"jest": {
|
|
32
|
-
"preset": "jest-preset-ui"
|
|
31
|
+
"preset": "@semcore/jest-preset-ui"
|
|
33
32
|
}
|
|
34
33
|
}
|
package/src/FeedbackForm.js
CHANGED
|
@@ -8,7 +8,7 @@ import SpinContainer from '@semcore/spin-container';
|
|
|
8
8
|
import Tooltip from '@semcore/tooltip';
|
|
9
9
|
import { NoticeSmart } from '@semcore/notice';
|
|
10
10
|
import { Box } from '@semcore/flex-box';
|
|
11
|
-
import
|
|
11
|
+
import pick from '@semcore/utils/lib/pick';
|
|
12
12
|
|
|
13
13
|
import style from './style/feedback-form.shadow.css';
|
|
14
14
|
|
|
@@ -68,8 +68,28 @@ class FeedbackForm extends Component {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
const TooltipProps = [
|
|
72
|
+
'title',
|
|
73
|
+
'theme',
|
|
74
|
+
'strategy',
|
|
75
|
+
'modifiers',
|
|
76
|
+
'placement',
|
|
77
|
+
'interaction',
|
|
78
|
+
'timeout',
|
|
79
|
+
'visible',
|
|
80
|
+
'defaultVisible',
|
|
81
|
+
'onVisibleChange',
|
|
82
|
+
'offset',
|
|
83
|
+
'preventOverflow',
|
|
84
|
+
'arrow',
|
|
85
|
+
'flip',
|
|
86
|
+
'computeStyles',
|
|
87
|
+
'eventListeners',
|
|
88
|
+
'onFirstUpdate',
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
function Item({ Children, tag, ...props }) {
|
|
92
|
+
const tooltipProps = pick(props, TooltipProps);
|
|
73
93
|
|
|
74
94
|
return (
|
|
75
95
|
<Root render={Field}>
|
|
@@ -89,6 +109,7 @@ function Item(props) {
|
|
|
89
109
|
flip={{
|
|
90
110
|
fallbackPlacements: ['right', 'bottom'],
|
|
91
111
|
}}
|
|
112
|
+
{...tooltipProps}
|
|
92
113
|
>
|
|
93
114
|
{tag && <Root render={tag} {...inputProps} />}
|
|
94
115
|
{typeof Children.origin === 'function' &&
|
|
@@ -107,7 +128,7 @@ function Item(props) {
|
|
|
107
128
|
function Success(props) {
|
|
108
129
|
const { Children, styles } = props;
|
|
109
130
|
const SSuccess = Root;
|
|
110
|
-
const SEmail =
|
|
131
|
+
const SEmail = 'div';
|
|
111
132
|
|
|
112
133
|
return sstyled(styles)(
|
|
113
134
|
<SSuccess render={Box}>
|
|
@@ -11,7 +11,9 @@ SCancel {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
SNotice[use='secondary'] {
|
|
14
|
-
border:
|
|
14
|
+
border-width: 1px 0 0;
|
|
15
|
+
border-top-style: solid;
|
|
16
|
+
border-radius: 0 0 3px 3px;
|
|
15
17
|
}
|
|
16
18
|
|
|
17
19
|
SSuccess {
|
|
@@ -26,4 +28,7 @@ SSuccess {
|
|
|
26
28
|
SEmail {
|
|
27
29
|
margin-bottom: 8px;
|
|
28
30
|
color: var(--green);
|
|
31
|
+
width: 80px;
|
|
32
|
+
height: 80px;
|
|
33
|
+
background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.04601C27.7367 5.04597 27.5305 5.08702 27.3381 5.16681C27.1458 5.24661 26.971 5.36357 26.8239 5.51101L13.909 18.426C7.41937 24.9156 3.77356 33.7174 3.77356 42.895C3.77356 52.0727 7.41937 60.8744 13.909 67.364C20.3985 73.8536 29.2003 77.4994 38.3779 77.4994C47.5556 77.4994 56.3574 73.8536 62.847 67.364L75.762 54.448C75.9092 54.3011 76.026 54.1265 76.1056 53.9343C76.1853 53.7421 76.2262 53.536 76.226 53.328V5.94401C76.226 5.70531 76.1311 5.47639 75.9623 5.30761C75.7936 5.13883 75.5646 5.04401 75.326 5.04401L27.945 5.04601Z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751L28.815 45.104C34.956 41.652 52.997 31.426 56.346 34.573C55.208 31.466 39.307 34.9 28.615 44.751Z' fill='white'/%3E%3Cpath d='M28.5129 31.03C26.6999 37.072 19.2999 55.5 15.0699 61.342L18.0829 62.254L19.6589 60.925C23.8779 51.385 29.6389 34.972 29.9709 29.467C29.4619 29.182 28.9469 29.583 28.5129 31.03Z' fill='white'/%3E%3Cpath d='M15.0699 61.342C19.2999 55.5 26.6999 37.072 28.5129 31.03C30.3259 24.988 33.5549 37.039 31.7429 42.145' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.9091 45.411C38.5921 35.046 55.1831 31.4 56.3421 34.573C57.0301 36.459 42.9131 40.832 37.9341 46.889' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43C41.036 20.27 35.689 18.539 32.832 17.741C36.95 15.907 69.787 3.753 72.5 2.5C71.578 6.606 67.576 20.78 65.784 27.433C60.957 25.751 56.056 24.275 52.862 23.24C50.8608 25.8918 49.0505 28.6825 47.445 31.591C46.272 27.731 45.116 23.274 44.281 21.43Z' fill='white' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43L61.026 10.352' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M52.864 23.24L72.502 2.5' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.447 31.591L55.299 24.015' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173L51.891 24.532L52.864 23.405L54.928 24.015L55.364 23.884L52.009 27.311L49.53 29.581L48.204 30.695L48.436 30.173Z' fill='black'/%3E%3Cpath d='M34.013 21.451L23.202 26.58' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40.9049 22.5L34.0129 26.862' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M62.2931 28.365L58.2531 38.215' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849C49.703 43.274 44.221 49.374 42.408 50.967' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.258 43.6C51.4 45.7 48.418 51.364 46.09 54.2' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M49.0231 48.9C54.5231 53.376 36.4671 72.622 35.1591 73.683' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' fill='black'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Crect width='80' height='80' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
|
|
29
34
|
}
|