@semcore/feedback-form 4.0.5 → 5.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 +6 -0
- package/lib/cjs/FeedbackForm.js +37 -39
- package/lib/cjs/FeedbackForm.js.map +1 -1
- package/lib/cjs/style/feedback-form.shadow.css +7 -7
- package/lib/es6/FeedbackForm.js +37 -41
- package/lib/es6/FeedbackForm.js.map +1 -1
- package/lib/es6/style/feedback-form.shadow.css +7 -7
- package/package.json +5 -5
- package/src/FeedbackForm.jsx +3 -3
- package/src/style/feedback-form.shadow.css +7 -7
package/CHANGELOG.md
CHANGED
package/lib/cjs/FeedbackForm.js
CHANGED
|
@@ -68,18 +68,17 @@ var style = (
|
|
|
68
68
|
/*__reshadow_css_start__*/
|
|
69
69
|
_core.sstyled.insert(
|
|
70
70
|
/*__inner_css_start__*/
|
|
71
|
-
".
|
|
71
|
+
".___SFeedbackForm_1tavz_gg_{max-width:320px}.___SCancel_1tavz_gg_,.___SSubmit_1tavz_gg_{display:inline-flex;margin-right:8px}.___SNotice_1tavz_gg_{padding:12px 16px;border-width:1px 0 0;border-top-style:solid;border-radius:0 0 6px 6px}.___SSuccess_1tavz_gg_{display:flex;align-items:center;flex-direction:column;width:320px;padding:46px 32px 32px;box-sizing:border-box}.___SEmail_1tavz_gg_{margin-bottom:18px;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\")}"
|
|
72
72
|
/*__inner_css_end__*/
|
|
73
|
-
, "
|
|
73
|
+
, "16vzj3n_gg_")
|
|
74
74
|
/*__reshadow_css_end__*/
|
|
75
75
|
, {
|
|
76
|
-
"__SFeedbackForm": "
|
|
77
|
-
"__SCancel": "
|
|
78
|
-
"__SSubmit": "
|
|
79
|
-
"__SNotice": "
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"__SEmail": "___SEmail_13cca_gg_"
|
|
76
|
+
"__SFeedbackForm": "___SFeedbackForm_1tavz_gg_",
|
|
77
|
+
"__SCancel": "___SCancel_1tavz_gg_",
|
|
78
|
+
"__SSubmit": "___SSubmit_1tavz_gg_",
|
|
79
|
+
"__SNotice": "___SNotice_1tavz_gg_",
|
|
80
|
+
"__SSuccess": "___SSuccess_1tavz_gg_",
|
|
81
|
+
"__SEmail": "___SEmail_1tavz_gg_"
|
|
83
82
|
});
|
|
84
83
|
|
|
85
84
|
var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
@@ -114,19 +113,19 @@ var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
|
114
113
|
return /*#__PURE__*/_react["default"].createElement(_reactFinalForm.Form, (0, _extends2["default"])({
|
|
115
114
|
decorators: [this.focusDecorator]
|
|
116
115
|
}, other), function (api) {
|
|
117
|
-
var
|
|
116
|
+
var _ref6;
|
|
118
117
|
|
|
119
|
-
return
|
|
118
|
+
return _ref6 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(_spinContainer["default"], _ref6.cn("SpinContainer", {
|
|
120
119
|
"size": "xl",
|
|
121
120
|
"loading": loading === undefined ? api.submitting : loading
|
|
122
|
-
}), /*#__PURE__*/_react["default"].createElement(SFeedbackForm,
|
|
121
|
+
}), /*#__PURE__*/_react["default"].createElement(SFeedbackForm, _ref6.cn("SFeedbackForm", _objectSpread(_objectSpread({
|
|
123
122
|
"tag": "form",
|
|
124
123
|
"noValidate": true,
|
|
125
124
|
"method": "POST",
|
|
126
125
|
"ref": forwardRef
|
|
127
126
|
}, other), {}, {
|
|
128
127
|
"onSubmit": api.handleSubmit
|
|
129
|
-
})), typeof Children.origin === 'function' ? Children.origin(api) : /*#__PURE__*/_react["default"].createElement(Children,
|
|
128
|
+
})), typeof Children.origin === 'function' ? Children.origin(api) : /*#__PURE__*/_react["default"].createElement(Children, _ref6.cn("Children", {}))));
|
|
130
129
|
});
|
|
131
130
|
}
|
|
132
131
|
}]);
|
|
@@ -166,17 +165,16 @@ var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
|
166
165
|
});
|
|
167
166
|
var TooltipProps = ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate'];
|
|
168
167
|
|
|
169
|
-
function Item(
|
|
170
|
-
var
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
props = (0, _objectWithoutProperties2["default"])(_ref12, _excluded2);
|
|
168
|
+
function Item(_ref11) {
|
|
169
|
+
var Children = _ref11.Children,
|
|
170
|
+
tag = _ref11.tag,
|
|
171
|
+
props = (0, _objectWithoutProperties2["default"])(_ref11, _excluded2);
|
|
174
172
|
var tooltipProps = (0, _pick["default"])(props, TooltipProps);
|
|
175
|
-
return /*#__PURE__*/_react["default"].createElement(_reactFinalForm.Field,
|
|
176
|
-
var
|
|
177
|
-
var input =
|
|
178
|
-
meta =
|
|
179
|
-
other = (0, _objectWithoutProperties2["default"])(
|
|
173
|
+
return /*#__PURE__*/_react["default"].createElement(_reactFinalForm.Field, props, function (_ref12) {
|
|
174
|
+
var _ref = arguments[0];
|
|
175
|
+
var input = _ref12.input,
|
|
176
|
+
meta = _ref12.meta,
|
|
177
|
+
other = (0, _objectWithoutProperties2["default"])(_ref12, _excluded3);
|
|
180
178
|
var invalid = meta.invalid && meta.touched;
|
|
181
179
|
|
|
182
180
|
var inputProps = _objectSpread(_objectSpread({}, input), {}, {
|
|
@@ -192,7 +190,7 @@ function Item(_ref12) {
|
|
|
192
190
|
flip: {
|
|
193
191
|
fallbackPlacements: ['right', 'bottom']
|
|
194
192
|
}
|
|
195
|
-
}, tooltipProps), tag && /*#__PURE__*/_react["default"].createElement("tag", (0, _core.assignProps)(_objectSpread({}, inputProps),
|
|
193
|
+
}, tooltipProps), tag && /*#__PURE__*/_react["default"].createElement("tag", (0, _core.assignProps)(_objectSpread({}, inputProps), _ref)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
|
|
196
194
|
input: inputProps,
|
|
197
195
|
meta: meta
|
|
198
196
|
}, other)));
|
|
@@ -200,56 +198,56 @@ function Item(_ref12) {
|
|
|
200
198
|
}
|
|
201
199
|
|
|
202
200
|
function Success(props) {
|
|
203
|
-
var
|
|
204
|
-
|
|
201
|
+
var _ref2 = arguments[0],
|
|
202
|
+
_ref7;
|
|
205
203
|
|
|
206
204
|
var Children = props.Children,
|
|
207
205
|
styles = props.styles;
|
|
208
206
|
var SSuccess = _flexBox.Box;
|
|
209
207
|
var SEmail = 'div';
|
|
210
|
-
return
|
|
208
|
+
return _ref7 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SSuccess, _ref7.cn("SSuccess", _objectSpread({}, (0, _core.assignProps)({}, _ref2))), /*#__PURE__*/_react["default"].createElement(SEmail, _ref7.cn("SEmail", {})), /*#__PURE__*/_react["default"].createElement("span", _ref7.cn("span", {}), /*#__PURE__*/_react["default"].createElement(Children, _ref7.cn("Children", {}))));
|
|
211
209
|
} // because it is used without a wrapper
|
|
212
210
|
|
|
213
211
|
|
|
214
212
|
Success.style = style;
|
|
215
213
|
|
|
216
214
|
function Submit(props) {
|
|
217
|
-
var
|
|
218
|
-
|
|
215
|
+
var _ref3 = arguments[0],
|
|
216
|
+
_ref8;
|
|
219
217
|
|
|
220
218
|
var styles = props.styles;
|
|
221
219
|
var SSubmit = _button["default"];
|
|
222
|
-
return
|
|
220
|
+
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SSubmit, _ref8.cn("SSubmit", _objectSpread({}, (0, _core.assignProps)({
|
|
223
221
|
"type": "submit",
|
|
224
222
|
"use": "primary",
|
|
225
223
|
"theme": "success"
|
|
226
|
-
},
|
|
224
|
+
}, _ref3))));
|
|
227
225
|
}
|
|
228
226
|
|
|
229
227
|
function Cancel(props) {
|
|
230
|
-
var
|
|
231
|
-
|
|
228
|
+
var _ref4 = arguments[0],
|
|
229
|
+
_ref9;
|
|
232
230
|
|
|
233
231
|
var styles = props.styles;
|
|
234
232
|
var SCancel = _button["default"];
|
|
235
|
-
return
|
|
233
|
+
return _ref9 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCancel, _ref9.cn("SCancel", _objectSpread({}, (0, _core.assignProps)({
|
|
236
234
|
"type": "reset",
|
|
237
235
|
"use": "secondary",
|
|
238
236
|
"theme": "muted"
|
|
239
|
-
},
|
|
237
|
+
}, _ref4))));
|
|
240
238
|
}
|
|
241
239
|
|
|
242
240
|
function Notice(props) {
|
|
243
|
-
var
|
|
244
|
-
|
|
241
|
+
var _ref5 = arguments[0],
|
|
242
|
+
_ref10;
|
|
245
243
|
|
|
246
244
|
var styles = props.styles;
|
|
247
245
|
var SNotice = _notice.NoticeSmart;
|
|
248
|
-
return
|
|
246
|
+
return _ref10 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SNotice, _ref10.cn("SNotice", _objectSpread({}, (0, _core.assignProps)({}, _ref5))));
|
|
249
247
|
}
|
|
250
248
|
|
|
251
249
|
Notice.defaultProps = {
|
|
252
|
-
theme: '
|
|
250
|
+
theme: 'gray96',
|
|
253
251
|
use: 'secondary'
|
|
254
252
|
};
|
|
255
253
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/FeedbackForm.jsx"],"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
|
|
1
|
+
{"version":3,"sources":["../../src/FeedbackForm.jsx"],"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;;;;;;;;;;;;;;;uGA+Ba,iC;;;;;;WAEjB,kBAAS;AACP,UAAMC,aAAa,GAAGC,YAAtB;AACA,0BAA4D,KAAKC,OAAjE;AAAA,UAAQC,QAAR,iBAAQA,Q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;AACA,iBAAO,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:\n (error) =>\n (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:\n (error) =>\n (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 <Field {...props}>\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 </Field>\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: 'gray96',\n use: 'secondary',\n};\n\nexport default createComponent(FeedbackForm, {\n Item,\n Success,\n Submit,\n Cancel,\n Notice,\n});\n"],"file":"FeedbackForm.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '@semcore/utils/style/var.css';
|
|
2
2
|
|
|
3
3
|
SFeedbackForm {
|
|
4
|
-
max-width:
|
|
4
|
+
max-width: 320px;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
SSubmit,
|
|
@@ -10,24 +10,24 @@ SCancel {
|
|
|
10
10
|
margin-right: 8px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
SNotice
|
|
13
|
+
SNotice {
|
|
14
|
+
padding: 12px 16px;
|
|
14
15
|
border-width: 1px 0 0;
|
|
15
16
|
border-top-style: solid;
|
|
16
|
-
border-radius: 0 0
|
|
17
|
+
border-radius: 0 0 6px 6px;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
SSuccess {
|
|
20
21
|
display: flex;
|
|
21
22
|
align-items: center;
|
|
22
23
|
flex-direction: column;
|
|
23
|
-
width:
|
|
24
|
-
padding: 32px;
|
|
24
|
+
width: 320px;
|
|
25
|
+
padding: 46px 32px 32px;
|
|
25
26
|
box-sizing: border-box;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
SEmail {
|
|
29
|
-
margin-bottom:
|
|
30
|
-
color: var(--green);
|
|
30
|
+
margin-bottom: 18px;
|
|
31
31
|
width: 80px;
|
|
32
32
|
height: 80px;
|
|
33
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");
|
package/lib/es6/FeedbackForm.js
CHANGED
|
@@ -8,7 +8,6 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
8
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
10
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
11
|
-
import { assignProps as _assignProps6 } from "@semcore/core";
|
|
12
11
|
import { assignProps as _assignProps5 } from "@semcore/core";
|
|
13
12
|
import { assignProps as _assignProps4 } from "@semcore/core";
|
|
14
13
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
@@ -42,18 +41,17 @@ var style = (
|
|
|
42
41
|
/*__reshadow_css_start__*/
|
|
43
42
|
_sstyled.insert(
|
|
44
43
|
/*__inner_css_start__*/
|
|
45
|
-
".
|
|
44
|
+
".___SFeedbackForm_1tavz_gg_{max-width:320px}.___SCancel_1tavz_gg_,.___SSubmit_1tavz_gg_{display:inline-flex;margin-right:8px}.___SNotice_1tavz_gg_{padding:12px 16px;border-width:1px 0 0;border-top-style:solid;border-radius:0 0 6px 6px}.___SSuccess_1tavz_gg_{display:flex;align-items:center;flex-direction:column;width:320px;padding:46px 32px 32px;box-sizing:border-box}.___SEmail_1tavz_gg_{margin-bottom:18px;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\")}"
|
|
46
45
|
/*__inner_css_end__*/
|
|
47
|
-
, "
|
|
46
|
+
, "16vzj3n_gg_")
|
|
48
47
|
/*__reshadow_css_end__*/
|
|
49
48
|
, {
|
|
50
|
-
"__SFeedbackForm": "
|
|
51
|
-
"__SCancel": "
|
|
52
|
-
"__SSubmit": "
|
|
53
|
-
"__SNotice": "
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"__SEmail": "___SEmail_13cca_gg_"
|
|
49
|
+
"__SFeedbackForm": "___SFeedbackForm_1tavz_gg_",
|
|
50
|
+
"__SCancel": "___SCancel_1tavz_gg_",
|
|
51
|
+
"__SSubmit": "___SSubmit_1tavz_gg_",
|
|
52
|
+
"__SNotice": "___SNotice_1tavz_gg_",
|
|
53
|
+
"__SSuccess": "___SSuccess_1tavz_gg_",
|
|
54
|
+
"__SEmail": "___SEmail_1tavz_gg_"
|
|
57
55
|
});
|
|
58
56
|
|
|
59
57
|
var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
@@ -92,19 +90,19 @@ var FeedbackForm = /*#__PURE__*/function (_Component) {
|
|
|
92
90
|
return /*#__PURE__*/React.createElement(Form, _extends({
|
|
93
91
|
decorators: [this.focusDecorator]
|
|
94
92
|
}, other), function (api) {
|
|
95
|
-
var
|
|
93
|
+
var _ref6;
|
|
96
94
|
|
|
97
|
-
return
|
|
95
|
+
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SpinContainer, _ref6.cn("SpinContainer", {
|
|
98
96
|
"size": "xl",
|
|
99
97
|
"loading": loading === undefined ? api.submitting : loading
|
|
100
|
-
}), /*#__PURE__*/React.createElement(SFeedbackForm,
|
|
98
|
+
}), /*#__PURE__*/React.createElement(SFeedbackForm, _ref6.cn("SFeedbackForm", _objectSpread(_objectSpread({
|
|
101
99
|
"tag": "form",
|
|
102
100
|
"noValidate": true,
|
|
103
101
|
"method": "POST",
|
|
104
102
|
"ref": forwardRef
|
|
105
103
|
}, other), {}, {
|
|
106
104
|
"onSubmit": api.handleSubmit
|
|
107
|
-
})), typeof Children.origin === 'function' ? Children.origin(api) : /*#__PURE__*/React.createElement(Children,
|
|
105
|
+
})), typeof Children.origin === 'function' ? Children.origin(api) : /*#__PURE__*/React.createElement(Children, _ref6.cn("Children", {}))));
|
|
108
106
|
});
|
|
109
107
|
}
|
|
110
108
|
}]);
|
|
@@ -150,20 +148,18 @@ _defineProperty(FeedbackForm, "validate", {
|
|
|
150
148
|
|
|
151
149
|
var TooltipProps = ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate'];
|
|
152
150
|
|
|
153
|
-
function Item(
|
|
154
|
-
var
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
tag = _ref12.tag,
|
|
158
|
-
props = _objectWithoutProperties(_ref12, _excluded2);
|
|
151
|
+
function Item(_ref11) {
|
|
152
|
+
var Children = _ref11.Children,
|
|
153
|
+
tag = _ref11.tag,
|
|
154
|
+
props = _objectWithoutProperties(_ref11, _excluded2);
|
|
159
155
|
|
|
160
156
|
var tooltipProps = pick(props, TooltipProps);
|
|
161
|
-
return /*#__PURE__*/React.createElement(Field,
|
|
162
|
-
var
|
|
157
|
+
return /*#__PURE__*/React.createElement(Field, props, function (_ref12) {
|
|
158
|
+
var _ref = arguments[0];
|
|
163
159
|
|
|
164
|
-
var input =
|
|
165
|
-
meta =
|
|
166
|
-
other = _objectWithoutProperties(
|
|
160
|
+
var input = _ref12.input,
|
|
161
|
+
meta = _ref12.meta,
|
|
162
|
+
other = _objectWithoutProperties(_ref12, _excluded3);
|
|
167
163
|
|
|
168
164
|
var invalid = meta.invalid && meta.touched;
|
|
169
165
|
|
|
@@ -180,7 +176,7 @@ function Item(_ref12) {
|
|
|
180
176
|
flip: {
|
|
181
177
|
fallbackPlacements: ['right', 'bottom']
|
|
182
178
|
}
|
|
183
|
-
}, tooltipProps), tag && /*#__PURE__*/React.createElement("tag",
|
|
179
|
+
}, tooltipProps), tag && /*#__PURE__*/React.createElement("tag", _assignProps(_objectSpread({}, inputProps), _ref)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
|
|
184
180
|
input: inputProps,
|
|
185
181
|
meta: meta
|
|
186
182
|
}, other)));
|
|
@@ -188,56 +184,56 @@ function Item(_ref12) {
|
|
|
188
184
|
}
|
|
189
185
|
|
|
190
186
|
function Success(props) {
|
|
191
|
-
var
|
|
192
|
-
|
|
187
|
+
var _ref2 = arguments[0],
|
|
188
|
+
_ref7;
|
|
193
189
|
|
|
194
190
|
var Children = props.Children,
|
|
195
191
|
styles = props.styles;
|
|
196
192
|
var SSuccess = Box;
|
|
197
193
|
var SEmail = 'div';
|
|
198
|
-
return
|
|
194
|
+
return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SSuccess, _ref7.cn("SSuccess", _objectSpread({}, _assignProps2({}, _ref2))), /*#__PURE__*/React.createElement(SEmail, _ref7.cn("SEmail", {})), /*#__PURE__*/React.createElement("span", _ref7.cn("span", {}), /*#__PURE__*/React.createElement(Children, _ref7.cn("Children", {}))));
|
|
199
195
|
} // because it is used without a wrapper
|
|
200
196
|
|
|
201
197
|
|
|
202
198
|
Success.style = style;
|
|
203
199
|
|
|
204
200
|
function Submit(props) {
|
|
205
|
-
var
|
|
206
|
-
|
|
201
|
+
var _ref3 = arguments[0],
|
|
202
|
+
_ref8;
|
|
207
203
|
|
|
208
204
|
var styles = props.styles;
|
|
209
205
|
var SSubmit = Button;
|
|
210
|
-
return
|
|
206
|
+
return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SSubmit, _ref8.cn("SSubmit", _objectSpread({}, _assignProps3({
|
|
211
207
|
"type": "submit",
|
|
212
208
|
"use": "primary",
|
|
213
209
|
"theme": "success"
|
|
214
|
-
},
|
|
210
|
+
}, _ref3))));
|
|
215
211
|
}
|
|
216
212
|
|
|
217
213
|
function Cancel(props) {
|
|
218
|
-
var
|
|
219
|
-
|
|
214
|
+
var _ref4 = arguments[0],
|
|
215
|
+
_ref9;
|
|
220
216
|
|
|
221
217
|
var styles = props.styles;
|
|
222
218
|
var SCancel = Button;
|
|
223
|
-
return
|
|
219
|
+
return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(SCancel, _ref9.cn("SCancel", _objectSpread({}, _assignProps4({
|
|
224
220
|
"type": "reset",
|
|
225
221
|
"use": "secondary",
|
|
226
222
|
"theme": "muted"
|
|
227
|
-
},
|
|
223
|
+
}, _ref4))));
|
|
228
224
|
}
|
|
229
225
|
|
|
230
226
|
function Notice(props) {
|
|
231
|
-
var
|
|
232
|
-
|
|
227
|
+
var _ref5 = arguments[0],
|
|
228
|
+
_ref10;
|
|
233
229
|
|
|
234
230
|
var styles = props.styles;
|
|
235
231
|
var SNotice = NoticeSmart;
|
|
236
|
-
return
|
|
232
|
+
return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SNotice, _ref10.cn("SNotice", _objectSpread({}, _assignProps5({}, _ref5))));
|
|
237
233
|
}
|
|
238
234
|
|
|
239
235
|
Notice.defaultProps = {
|
|
240
|
-
theme: '
|
|
236
|
+
theme: 'gray96',
|
|
241
237
|
use: 'secondary'
|
|
242
238
|
};
|
|
243
239
|
export default createComponent(FeedbackForm, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/FeedbackForm.jsx"],"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":"
|
|
1
|
+
{"version":3,"sources":["../../src/FeedbackForm.jsx"],"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,OAArC,EAA8CC,IAA9C,QAA0D,eAA1D;AACA,OAAOC,MAAP,MAAmB,iBAAnB;AACA,OAAOC,aAAP,MAA0B,yBAA1B;AACA,OAAOC,OAAP,MAAoB,kBAApB;AACA,SAASC,WAAT,QAA4B,iBAA5B;AACA,SAASC,GAAT,QAAoB,mBAApB;AACA,OAAOC,IAAP,MAAiB,yBAAjB;;;;;;;;;;;;;;;;;;;;IAIMC,Y;;;;;;;;;;;;;;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AvB;AACD;;AAED,SAAS0C,MAAT,CAAgBf,KAAhB,EAAuB;AAAA;AAAA;;AACrB,MAAQ3B,MAAR,GAAmB2B,KAAnB,CAAQ3B,MAAR;AACA,MAAM2C,OAAO,GAC2BrD,MADxC;AACA,iBAAOF,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:\n (error) =>\n (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:\n (error) =>\n (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 <Field {...props}>\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 </Field>\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: 'gray96',\n use: 'secondary',\n};\n\nexport default createComponent(FeedbackForm, {\n Item,\n Success,\n Submit,\n Cancel,\n Notice,\n});\n"],"file":"FeedbackForm.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '@semcore/utils/style/var.css';
|
|
2
2
|
|
|
3
3
|
SFeedbackForm {
|
|
4
|
-
max-width:
|
|
4
|
+
max-width: 320px;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
SSubmit,
|
|
@@ -10,24 +10,24 @@ SCancel {
|
|
|
10
10
|
margin-right: 8px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
SNotice
|
|
13
|
+
SNotice {
|
|
14
|
+
padding: 12px 16px;
|
|
14
15
|
border-width: 1px 0 0;
|
|
15
16
|
border-top-style: solid;
|
|
16
|
-
border-radius: 0 0
|
|
17
|
+
border-radius: 0 0 6px 6px;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
SSuccess {
|
|
20
21
|
display: flex;
|
|
21
22
|
align-items: center;
|
|
22
23
|
flex-direction: column;
|
|
23
|
-
width:
|
|
24
|
-
padding: 32px;
|
|
24
|
+
width: 320px;
|
|
25
|
+
padding: 46px 32px 32px;
|
|
25
26
|
box-sizing: border-box;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
SEmail {
|
|
29
|
-
margin-bottom:
|
|
30
|
-
color: var(--green);
|
|
30
|
+
margin-bottom: 18px;
|
|
31
31
|
width: 80px;
|
|
32
32
|
height: 80px;
|
|
33
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");
|
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": "
|
|
4
|
+
"version": "5.0.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -15,10 +15,10 @@
|
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@semcore/utils": "^3.15",
|
|
17
17
|
"@semcore/flex-box": "^4",
|
|
18
|
-
"@semcore/tooltip": "^
|
|
19
|
-
"@semcore/spin-container": "^
|
|
20
|
-
"@semcore/button": "^
|
|
21
|
-
"@semcore/notice": "^
|
|
18
|
+
"@semcore/tooltip": "^5",
|
|
19
|
+
"@semcore/spin-container": "^6.0.0",
|
|
20
|
+
"@semcore/button": "^4",
|
|
21
|
+
"@semcore/notice": "^4",
|
|
22
22
|
"final-form": "4.19.1",
|
|
23
23
|
"final-form-focus": "1.1.2",
|
|
24
24
|
"react-final-form": "6.4.0"
|
package/src/FeedbackForm.jsx
CHANGED
|
@@ -96,7 +96,7 @@ function Item({ Children, tag, ...props }) {
|
|
|
96
96
|
const tooltipProps = pick(props, TooltipProps);
|
|
97
97
|
|
|
98
98
|
return (
|
|
99
|
-
<
|
|
99
|
+
<Field {...props}>
|
|
100
100
|
{({ input, meta, ...other }) => {
|
|
101
101
|
const invalid = meta.invalid && meta.touched;
|
|
102
102
|
const inputProps = {
|
|
@@ -125,7 +125,7 @@ function Item({ Children, tag, ...props }) {
|
|
|
125
125
|
</Tooltip>
|
|
126
126
|
);
|
|
127
127
|
}}
|
|
128
|
-
</
|
|
128
|
+
</Field>
|
|
129
129
|
);
|
|
130
130
|
}
|
|
131
131
|
|
|
@@ -165,7 +165,7 @@ function Notice(props) {
|
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
Notice.defaultProps = {
|
|
168
|
-
theme: '
|
|
168
|
+
theme: 'gray96',
|
|
169
169
|
use: 'secondary',
|
|
170
170
|
};
|
|
171
171
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@import '@semcore/utils/style/var.css';
|
|
2
2
|
|
|
3
3
|
SFeedbackForm {
|
|
4
|
-
max-width:
|
|
4
|
+
max-width: 320px;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
7
|
SSubmit,
|
|
@@ -10,24 +10,24 @@ SCancel {
|
|
|
10
10
|
margin-right: 8px;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
-
SNotice
|
|
13
|
+
SNotice {
|
|
14
|
+
padding: 12px 16px;
|
|
14
15
|
border-width: 1px 0 0;
|
|
15
16
|
border-top-style: solid;
|
|
16
|
-
border-radius: 0 0
|
|
17
|
+
border-radius: 0 0 6px 6px;
|
|
17
18
|
}
|
|
18
19
|
|
|
19
20
|
SSuccess {
|
|
20
21
|
display: flex;
|
|
21
22
|
align-items: center;
|
|
22
23
|
flex-direction: column;
|
|
23
|
-
width:
|
|
24
|
-
padding: 32px;
|
|
24
|
+
width: 320px;
|
|
25
|
+
padding: 46px 32px 32px;
|
|
25
26
|
box-sizing: border-box;
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
SEmail {
|
|
29
|
-
margin-bottom:
|
|
30
|
-
color: var(--green);
|
|
30
|
+
margin-bottom: 18px;
|
|
31
31
|
width: 80px;
|
|
32
32
|
height: 80px;
|
|
33
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");
|