@semcore/feedback-form 4.0.5 → 5.0.3
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 +24 -0
- package/lib/cjs/FeedbackForm.js +37 -38
- package/lib/cjs/FeedbackForm.js.map +1 -1
- package/lib/cjs/style/feedback-form.shadow.css +7 -7
- package/lib/es6/FeedbackForm.js +37 -40
- package/lib/es6/FeedbackForm.js.map +1 -1
- package/lib/es6/style/feedback-form.shadow.css +7 -7
- package/package.json +10 -5
- package/src/FeedbackForm.jsx +5 -4
- package/src/style/feedback-form.shadow.css +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [5.0.3] - 2022-05-19
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Fixed Item tag property setting
|
|
10
|
+
|
|
11
|
+
## [5.0.2] - 2022-05-19
|
|
12
|
+
|
|
13
|
+
### Fixed
|
|
14
|
+
|
|
15
|
+
- Synced dependencies versions to remove duplicates in the single export package.
|
|
16
|
+
|
|
17
|
+
## [5.0.1] - 2022-05-18
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Version patch update due to children dependencies update (`@semcore/button` [4.0.0 ~> 4.0.1]).
|
|
22
|
+
|
|
23
|
+
## [5.0.0] - 2022-05-17
|
|
24
|
+
|
|
25
|
+
### BREAK
|
|
26
|
+
|
|
27
|
+
- Updated styles according to the library redesign policy.
|
|
28
|
+
|
|
5
29
|
## [4.0.5] - 2022-04-25
|
|
6
30
|
|
|
7
31
|
### 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,17 @@ 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(
|
|
168
|
+
function Item(_ref11) {
|
|
170
169
|
var _ref = arguments[0];
|
|
171
|
-
var Children =
|
|
172
|
-
tag =
|
|
173
|
-
props = (0, _objectWithoutProperties2["default"])(
|
|
170
|
+
var Children = _ref11.Children,
|
|
171
|
+
tag = _ref11.tag,
|
|
172
|
+
props = (0, _objectWithoutProperties2["default"])(_ref11, _excluded2);
|
|
174
173
|
var tooltipProps = (0, _pick["default"])(props, TooltipProps);
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
var input =
|
|
178
|
-
meta =
|
|
179
|
-
other = (0, _objectWithoutProperties2["default"])(
|
|
174
|
+
var ItemRoot = tag;
|
|
175
|
+
return /*#__PURE__*/_react["default"].createElement(_reactFinalForm.Field, props, function (_ref12) {
|
|
176
|
+
var input = _ref12.input,
|
|
177
|
+
meta = _ref12.meta,
|
|
178
|
+
other = (0, _objectWithoutProperties2["default"])(_ref12, _excluded3);
|
|
180
179
|
var invalid = meta.invalid && meta.touched;
|
|
181
180
|
|
|
182
181
|
var inputProps = _objectSpread(_objectSpread({}, input), {}, {
|
|
@@ -192,7 +191,7 @@ function Item(_ref12) {
|
|
|
192
191
|
flip: {
|
|
193
192
|
fallbackPlacements: ['right', 'bottom']
|
|
194
193
|
}
|
|
195
|
-
}, tooltipProps), tag && /*#__PURE__*/_react["default"].createElement(
|
|
194
|
+
}, tooltipProps), tag && /*#__PURE__*/_react["default"].createElement(ItemRoot, (0, _core.assignProps)(_objectSpread({}, inputProps), _ref)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
|
|
196
195
|
input: inputProps,
|
|
197
196
|
meta: meta
|
|
198
197
|
}, other)));
|
|
@@ -200,56 +199,56 @@ function Item(_ref12) {
|
|
|
200
199
|
}
|
|
201
200
|
|
|
202
201
|
function Success(props) {
|
|
203
|
-
var
|
|
204
|
-
|
|
202
|
+
var _ref2 = arguments[0],
|
|
203
|
+
_ref7;
|
|
205
204
|
|
|
206
205
|
var Children = props.Children,
|
|
207
206
|
styles = props.styles;
|
|
208
207
|
var SSuccess = _flexBox.Box;
|
|
209
208
|
var SEmail = 'div';
|
|
210
|
-
return
|
|
209
|
+
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
210
|
} // because it is used without a wrapper
|
|
212
211
|
|
|
213
212
|
|
|
214
213
|
Success.style = style;
|
|
215
214
|
|
|
216
215
|
function Submit(props) {
|
|
217
|
-
var
|
|
218
|
-
|
|
216
|
+
var _ref3 = arguments[0],
|
|
217
|
+
_ref8;
|
|
219
218
|
|
|
220
219
|
var styles = props.styles;
|
|
221
220
|
var SSubmit = _button["default"];
|
|
222
|
-
return
|
|
221
|
+
return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SSubmit, _ref8.cn("SSubmit", _objectSpread({}, (0, _core.assignProps)({
|
|
223
222
|
"type": "submit",
|
|
224
223
|
"use": "primary",
|
|
225
224
|
"theme": "success"
|
|
226
|
-
},
|
|
225
|
+
}, _ref3))));
|
|
227
226
|
}
|
|
228
227
|
|
|
229
228
|
function Cancel(props) {
|
|
230
|
-
var
|
|
231
|
-
|
|
229
|
+
var _ref4 = arguments[0],
|
|
230
|
+
_ref9;
|
|
232
231
|
|
|
233
232
|
var styles = props.styles;
|
|
234
233
|
var SCancel = _button["default"];
|
|
235
|
-
return
|
|
234
|
+
return _ref9 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SCancel, _ref9.cn("SCancel", _objectSpread({}, (0, _core.assignProps)({
|
|
236
235
|
"type": "reset",
|
|
237
236
|
"use": "secondary",
|
|
238
237
|
"theme": "muted"
|
|
239
|
-
},
|
|
238
|
+
}, _ref4))));
|
|
240
239
|
}
|
|
241
240
|
|
|
242
241
|
function Notice(props) {
|
|
243
|
-
var
|
|
244
|
-
|
|
242
|
+
var _ref5 = arguments[0],
|
|
243
|
+
_ref10;
|
|
245
244
|
|
|
246
245
|
var styles = props.styles;
|
|
247
246
|
var SNotice = _notice.NoticeSmart;
|
|
248
|
-
return
|
|
247
|
+
return _ref10 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SNotice, _ref10.cn("SNotice", _objectSpread({}, (0, _core.assignProps)({}, _ref5))));
|
|
249
248
|
}
|
|
250
249
|
|
|
251
250
|
Notice.defaultProps = {
|
|
252
|
-
theme: '
|
|
251
|
+
theme: 'gray96',
|
|
253
252
|
use: 'secondary'
|
|
254
253
|
};
|
|
255
254
|
|
|
@@ -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","ItemRoot","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,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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O,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 const ItemRoot = Root;\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 && <ItemRoot 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,19 @@ _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(
|
|
151
|
+
function Item(_ref11) {
|
|
154
152
|
var _ref = arguments[0];
|
|
155
153
|
|
|
156
|
-
var Children =
|
|
157
|
-
tag =
|
|
158
|
-
props = _objectWithoutProperties(
|
|
154
|
+
var Children = _ref11.Children,
|
|
155
|
+
tag = _ref11.tag,
|
|
156
|
+
props = _objectWithoutProperties(_ref11, _excluded2);
|
|
159
157
|
|
|
160
158
|
var tooltipProps = pick(props, TooltipProps);
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
other = _objectWithoutProperties(_ref13, _excluded3);
|
|
159
|
+
var ItemRoot = tag;
|
|
160
|
+
return /*#__PURE__*/React.createElement(Field, props, function (_ref12) {
|
|
161
|
+
var input = _ref12.input,
|
|
162
|
+
meta = _ref12.meta,
|
|
163
|
+
other = _objectWithoutProperties(_ref12, _excluded3);
|
|
167
164
|
|
|
168
165
|
var invalid = meta.invalid && meta.touched;
|
|
169
166
|
|
|
@@ -180,7 +177,7 @@ function Item(_ref12) {
|
|
|
180
177
|
flip: {
|
|
181
178
|
fallbackPlacements: ['right', 'bottom']
|
|
182
179
|
}
|
|
183
|
-
}, tooltipProps), tag && /*#__PURE__*/React.createElement(
|
|
180
|
+
}, tooltipProps), tag && /*#__PURE__*/React.createElement(ItemRoot, _assignProps(_objectSpread({}, inputProps), _ref)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
|
|
184
181
|
input: inputProps,
|
|
185
182
|
meta: meta
|
|
186
183
|
}, other)));
|
|
@@ -188,56 +185,56 @@ function Item(_ref12) {
|
|
|
188
185
|
}
|
|
189
186
|
|
|
190
187
|
function Success(props) {
|
|
191
|
-
var
|
|
192
|
-
|
|
188
|
+
var _ref2 = arguments[0],
|
|
189
|
+
_ref7;
|
|
193
190
|
|
|
194
191
|
var Children = props.Children,
|
|
195
192
|
styles = props.styles;
|
|
196
193
|
var SSuccess = Box;
|
|
197
194
|
var SEmail = 'div';
|
|
198
|
-
return
|
|
195
|
+
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
196
|
} // because it is used without a wrapper
|
|
200
197
|
|
|
201
198
|
|
|
202
199
|
Success.style = style;
|
|
203
200
|
|
|
204
201
|
function Submit(props) {
|
|
205
|
-
var
|
|
206
|
-
|
|
202
|
+
var _ref3 = arguments[0],
|
|
203
|
+
_ref8;
|
|
207
204
|
|
|
208
205
|
var styles = props.styles;
|
|
209
206
|
var SSubmit = Button;
|
|
210
|
-
return
|
|
207
|
+
return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SSubmit, _ref8.cn("SSubmit", _objectSpread({}, _assignProps3({
|
|
211
208
|
"type": "submit",
|
|
212
209
|
"use": "primary",
|
|
213
210
|
"theme": "success"
|
|
214
|
-
},
|
|
211
|
+
}, _ref3))));
|
|
215
212
|
}
|
|
216
213
|
|
|
217
214
|
function Cancel(props) {
|
|
218
|
-
var
|
|
219
|
-
|
|
215
|
+
var _ref4 = arguments[0],
|
|
216
|
+
_ref9;
|
|
220
217
|
|
|
221
218
|
var styles = props.styles;
|
|
222
219
|
var SCancel = Button;
|
|
223
|
-
return
|
|
220
|
+
return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(SCancel, _ref9.cn("SCancel", _objectSpread({}, _assignProps4({
|
|
224
221
|
"type": "reset",
|
|
225
222
|
"use": "secondary",
|
|
226
223
|
"theme": "muted"
|
|
227
|
-
},
|
|
224
|
+
}, _ref4))));
|
|
228
225
|
}
|
|
229
226
|
|
|
230
227
|
function Notice(props) {
|
|
231
|
-
var
|
|
232
|
-
|
|
228
|
+
var _ref5 = arguments[0],
|
|
229
|
+
_ref10;
|
|
233
230
|
|
|
234
231
|
var styles = props.styles;
|
|
235
232
|
var SNotice = NoticeSmart;
|
|
236
|
-
return
|
|
233
|
+
return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SNotice, _ref10.cn("SNotice", _objectSpread({}, _assignProps5({}, _ref5))));
|
|
237
234
|
}
|
|
238
235
|
|
|
239
236
|
Notice.defaultProps = {
|
|
240
|
-
theme: '
|
|
237
|
+
theme: 'gray96',
|
|
241
238
|
use: 'secondary'
|
|
242
239
|
};
|
|
243
240
|
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","ItemRoot","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;;;;;;;;;;;;;;;;qEA+BaX,oBAAoB,E;;;;;;;WAErC,kBAAS;AACP,UAAMY,aAAa,GAAGH,GAAtB;;AACA,0BAA4D,KAAKI,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,oBAAC,IAAD;AAAM,QAAA,UAAU,EAAE,CAAC,KAAKC,cAAN;AAAlB,SAA6CD,KAA7C,GACG,UAACE,GAAD;AAAA;;AAAA,uBACCjB,OAAO,CAACY,MAAD,CADR,eAEG,oBAAC,aAAD;AAAA,kBAAoB,IAApB;AAAA,qBAAkCC,OAAO,KAAKK,SAAZ,GAAwBD,GAAG,CAACE,UAA5B,GAAy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OAAD,oEAAvB;AACD;;AAED6C,MAAM,CAACE,YAAP,GAAsB;AACpBC,EAAAA,KAAK,EAAE,QADa;AAEpBC,EAAAA,GAAG,EAAE;AAFe,CAAtB;AAKA,eAAe/D,eAAe,CAACU,YAAD,EAAe;AAC3C6B,EAAAA,IAAI,EAAJA,IAD2C;AAE3Ca,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 const ItemRoot = Root;\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 && <ItemRoot 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.3",
|
|
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"
|
|
@@ -37,5 +37,10 @@
|
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@semcore/jest-preset-ui": "1.0.0"
|
|
40
|
+
},
|
|
41
|
+
"overrides": {
|
|
42
|
+
"final-form": {
|
|
43
|
+
"@babel/runtime": "7.17.9"
|
|
44
|
+
}
|
|
40
45
|
}
|
|
41
46
|
}
|
package/src/FeedbackForm.jsx
CHANGED
|
@@ -94,9 +94,10 @@ const TooltipProps = [
|
|
|
94
94
|
|
|
95
95
|
function Item({ Children, tag, ...props }) {
|
|
96
96
|
const tooltipProps = pick(props, TooltipProps);
|
|
97
|
+
const ItemRoot = Root;
|
|
97
98
|
|
|
98
99
|
return (
|
|
99
|
-
<
|
|
100
|
+
<Field {...props}>
|
|
100
101
|
{({ input, meta, ...other }) => {
|
|
101
102
|
const invalid = meta.invalid && meta.touched;
|
|
102
103
|
const inputProps = {
|
|
@@ -115,7 +116,7 @@ function Item({ Children, tag, ...props }) {
|
|
|
115
116
|
}}
|
|
116
117
|
{...tooltipProps}
|
|
117
118
|
>
|
|
118
|
-
{tag && <
|
|
119
|
+
{tag && <ItemRoot render={tag} {...inputProps} />}
|
|
119
120
|
{typeof Children.origin === 'function' &&
|
|
120
121
|
Children.origin({
|
|
121
122
|
input: inputProps,
|
|
@@ -125,7 +126,7 @@ function Item({ Children, tag, ...props }) {
|
|
|
125
126
|
</Tooltip>
|
|
126
127
|
);
|
|
127
128
|
}}
|
|
128
|
-
</
|
|
129
|
+
</Field>
|
|
129
130
|
);
|
|
130
131
|
}
|
|
131
132
|
|
|
@@ -165,7 +166,7 @@ function Notice(props) {
|
|
|
165
166
|
}
|
|
166
167
|
|
|
167
168
|
Notice.defaultProps = {
|
|
168
|
-
theme: '
|
|
169
|
+
theme: 'gray96',
|
|
169
170
|
use: 'secondary',
|
|
170
171
|
};
|
|
171
172
|
|
|
@@ -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");
|