@semcore/feedback-form 3.3.0 → 3.4.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 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
+ ## [3.4.0] - 2022-01-18
6
+
7
+ ### Changed
8
+
9
+ - Up version icons and use new icon.
10
+
11
+ ## [3.3.3] - 2021-8-26
12
+
13
+ ### Changed
14
+
15
+ - Add 'sideEffect=false' for more optimal build via webpack
16
+
17
+ ## [3.3.2] - 2021-08-17
18
+
19
+ ### Fixed
20
+
21
+ - Fixed placement warning tooltip for small screens.
22
+
23
+ ## [3.3.1] - 2021-08-02
24
+
25
+ ### Fixed
26
+
27
+ - [ts] correct types.
28
+
5
29
  ## [3.3.0] - 2021-07-05
6
30
 
7
31
  ### Changed
package/README.md CHANGED
@@ -4,7 +4,7 @@ import Link from '@semcore/link';
4
4
  import Input from '@semcore/input';
5
5
  import Textarea from '@semcore/textarea';
6
6
  import Checkbox from '@semcore/checkbox';
7
- import ChatXS from '@semcore/icon/lib/Chat/xs';
7
+ import Chat from '@semcore/icon/Chat/m';
8
8
  import Dropdown from '@semcore/dropdown';
9
9
  import FeedbackForm from '@semcore/feedback-form';
10
10
  import { Box } from '@semcore/flex-box';
@@ -15,16 +15,14 @@ import If from '@semcore/utils/lib/if';
15
15
  class MyFeedback extends React.PureComponent {
16
16
  render() {
17
17
  const validateDescription = FeedbackForm.validate.description(
18
- `Please tell a few more words about your experience. This will help us improve our service.`,
19
- );
20
- const validateEmail = FeedbackForm.validate.email(
21
- `Please provide us with a valid email address so we could reply to you.`,
18
+ `Your feedback must contain at least 3 words (10 characters).`,
22
19
  );
20
+ const validateEmail = FeedbackForm.validate.email(`Please enter valid email.`);
23
21
 
24
22
  return (
25
23
  <Dropdown>
26
24
  <Dropdown.Trigger>
27
- <Link before={<ChatXS />}>Send feedback</Link>
25
+ <Link before={<Chat />}>Send feedback</Link>
28
26
  </Dropdown.Trigger>
29
27
  <Dropdown.Popper>
30
28
  {({ changeVisible }) => (
@@ -45,8 +45,6 @@ var _notice = require("@semcore/notice");
45
45
 
46
46
  var _flexBox = require("@semcore/flex-box");
47
47
 
48
- var _l = _interopRequireDefault(require("@semcore/icon/lib/MailSent/l"));
49
-
50
48
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
51
49
 
52
50
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
@@ -60,18 +58,18 @@ var style = (
60
58
  /*__reshadow_css_start__*/
61
59
  _core.sstyled.insert(
62
60
  /*__inner_css_start__*/
63
- ".___SFeedbackForm_1cir8_gg_{max-width:300px}.___SCancel_1cir8_gg_,.___SSubmit_1cir8_gg_{display:inline-flex;margin-right:8px}.___SNotice_1cir8_gg_._use_secondary_1cir8_gg_{border:none}.___SSuccess_1cir8_gg_{display:flex;align-items:center;flex-direction:column;width:300px;padding:32px;box-sizing:border-box}.___SEmail_1cir8_gg_{margin-bottom:8px;color:#4fae33}"
61
+ ".___SFeedbackForm_cr9x4_gg_{max-width:300px}.___SCancel_cr9x4_gg_,.___SSubmit_cr9x4_gg_{display:inline-flex;margin-right:8px}.___SNotice_cr9x4_gg_._use_secondary_cr9x4_gg_{border:none}.___SSuccess_cr9x4_gg_{display:flex;align-items:center;flex-direction:column;width:300px;padding:32px;box-sizing:border-box}.___SEmail_cr9x4_gg_{margin-bottom:8px;color:#4fae33;width:80px;height:80px;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='80' height='80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.046a1.583 1.583 0 00-1.121.465L13.909 18.426a34.604 34.604 0 1048.938 48.938l12.915-12.916a1.58 1.58 0 00.464-1.12V5.944a.9.9 0 00-.9-.9l-47.381.002z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751l.2.353c6.141-3.452 24.182-13.678 27.531-10.531-1.138-3.107-17.039.327-27.731 10.178zM28.513 31.03C26.7 37.072 19.3 55.5 15.07 61.342l3.013.912 1.576-1.329c4.219-9.54 9.98-25.953 10.312-31.458-.51-.285-1.024.116-1.458 1.563z' fill='%23fff'/%3E%3Cpath d='M15.07 61.342C19.3 55.5 26.7 37.072 28.513 31.03c1.813-6.042 5.042 6.009 3.23 11.115' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.91 45.411C38.591 35.046 55.182 31.4 56.341 34.573c.688 1.886-13.429 6.259-18.408 12.316' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43c-3.245-1.16-8.592-2.891-11.449-3.689C36.95 15.907 69.787 3.753 72.5 2.5c-.922 4.106-4.924 18.28-6.716 24.933-4.827-1.682-9.728-3.158-12.922-4.193a70.111 70.111 0 00-5.417 8.351c-1.173-3.86-2.329-8.317-3.164-10.161z' fill='%23fff' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43l16.745-11.078M52.864 23.24L72.502 2.5M47.447 31.591l7.852-7.576' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173l3.455-5.641.973-1.127 2.064.61.436-.131-3.355 3.427-2.479 2.27-1.326 1.114.232-.522z' fill='%23000'/%3E%3Cpath d='M34.013 21.451L23.202 26.58M40.905 22.5l-6.892 4.362M62.293 28.365l-4.04 9.85' stroke='%23fff' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849c3.613 2.425-1.869 8.525-3.682 10.118M47.258 43.6c4.142 2.1 1.16 7.764-1.168 10.6M49.023 48.9c5.5 4.476-12.556 23.722-13.864 24.783' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88c13.658-2.117 20.2 10.047 20.459 13.52A116.386 116.386 0 0127.4 87.533' fill='%23000'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88c13.658-2.117 20.2 10.047 20.459 13.52A116.386 116.386 0 0127.4 87.533' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Cpath fill='%23fff' d='M0 0h80v80H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E\")}"
64
62
  /*__inner_css_end__*/
65
- , "1uq9us8_gg_")
63
+ , "jfzeuw_gg_")
66
64
  /*__reshadow_css_end__*/
67
65
  , {
68
- "__SFeedbackForm": "___SFeedbackForm_1cir8_gg_",
69
- "__SCancel": "___SCancel_1cir8_gg_",
70
- "__SSubmit": "___SSubmit_1cir8_gg_",
71
- "__SNotice": "___SNotice_1cir8_gg_",
72
- "_use_secondary": "_use_secondary_1cir8_gg_",
73
- "__SSuccess": "___SSuccess_1cir8_gg_",
74
- "__SEmail": "___SEmail_1cir8_gg_"
66
+ "__SFeedbackForm": "___SFeedbackForm_cr9x4_gg_",
67
+ "__SCancel": "___SCancel_cr9x4_gg_",
68
+ "__SSubmit": "___SSubmit_cr9x4_gg_",
69
+ "__SNotice": "___SNotice_cr9x4_gg_",
70
+ "_use_secondary": "_use_secondary_cr9x4_gg_",
71
+ "__SSuccess": "___SSuccess_cr9x4_gg_",
72
+ "__SEmail": "___SEmail_cr9x4_gg_"
75
73
  });
76
74
 
77
75
  var FeedbackForm = /*#__PURE__*/function (_Component) {
@@ -180,7 +178,10 @@ function Item(props) {
180
178
  visible: invalid && meta.active,
181
179
  inline: false,
182
180
  theme: "warning",
183
- placement: "left"
181
+ placement: "left",
182
+ flip: {
183
+ fallbackPlacements: ['right', 'bottom']
184
+ }
184
185
  }, tag && /*#__PURE__*/_react["default"].createElement("tag", (0, _core.assignProps)(_objectSpread({}, inputProps), _ref2)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
185
186
  input: inputProps,
186
187
  meta: meta
@@ -195,7 +196,7 @@ function Success(props) {
195
196
  var Children = props.Children,
196
197
  styles = props.styles;
197
198
  var SSuccess = _flexBox.Box;
198
- var SEmail = _l["default"];
199
+ var SEmail = 'div';
199
200
  return _ref8 = (0, _core.sstyled)(styles), /*#__PURE__*/_react["default"].createElement(SSuccess, _ref8.cn("SSuccess", _objectSpread({}, (0, _core.assignProps)({}, _ref3))), /*#__PURE__*/_react["default"].createElement(SEmail, _ref8.cn("SEmail", {})), /*#__PURE__*/_react["default"].createElement("span", _ref8.cn("span", {}), /*#__PURE__*/_react["default"].createElement(Children, _ref8.cn("Children", {}))));
200
201
  } // because it is used without a wrapper
201
202
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/FeedbackForm.js"],"names":["FeedbackForm","SFeedbackForm","Box","asProps","Children","styles","loading","forwardRef","other","focusDecorator","api","undefined","submitting","handleSubmit","origin","Component","style","Field","Form","onSubmit","description","error","value","words","split","symbols","join","length","email","test","String","toLowerCase","Item","props","tag","input","meta","invalid","touched","inputProps","state","active","Success","SSuccess","SEmail","MailSentL","Submit","SSubmit","Button","Cancel","SCancel","Notice","SNotice","NoticeSmart","defaultProps","theme","use"],"mappings":";;;;;;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,MADa,GACF4B,KADE,CACb5B,MADa;AAErB,MAAM+C,OAAO,GAC2BC,mBADxC;AACA,kBAAO,mBAAQhD,MAAR,CAAP,eAAuB,gCAAC,OAAD,6EAAvB;AACD;;AAED8C,MAAM,CAACG,YAAP,GAAsB;AACpBC,EAAAA,KAAK,EAAE,QADa;AAEpBC,EAAAA,GAAG,EAAE;AAFe,CAAtB;;eAKe,sBAAgBxD,YAAhB,EAA8B;AAC3CgC,EAAAA,IAAI,EAAJA,IAD2C;AAE3CU,EAAAA,OAAO,EAAPA,OAF2C;AAG3CI,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 MailSentL from '@semcore/icon/lib/MailSent/l';\n\nimport style from './style/feedback-form.shadow.css';\n\nclass FeedbackForm extends Component {\n static displayName = 'FeedbackForm';\n static style = style;\n static FinalForm = {\n Field,\n Form,\n };\n\n static defaultProps = {\n onSubmit: () => {},\n };\n\n static validate = {\n description: (error) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (symbols.length < 10 || words.length < 3) {\n return error;\n }\n },\n email: (error) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, loading, forwardRef, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer size=\"xl\" loading={loading === undefined ? api.submitting : loading}>\n <SFeedbackForm\n tag=\"form\"\n noValidate\n method=\"POST\"\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n {typeof Children.origin === 'function' ? Children.origin(api) : <Children />}\n </SFeedbackForm>\n </SpinContainer>,\n )\n }\n </Form>\n );\n }\n}\n\nfunction Item(props) {\n const { Children, tag } = props;\n\n return (\n <Root render={Field}>\n {({ input, meta, ...other }) => {\n const invalid = meta.invalid && meta.touched;\n const inputProps = {\n ...input,\n state: invalid ? 'invalid' : 'normal',\n };\n return (\n <Tooltip\n title={meta.error}\n visible={invalid && meta.active}\n inline={false}\n theme=\"warning\"\n placement=\"left\"\n >\n {tag && <Root render={tag} {...inputProps} />}\n {typeof Children.origin === 'function' &&\n Children.origin({\n input: inputProps,\n meta,\n ...other,\n })}\n </Tooltip>\n );\n }}\n </Root>\n );\n}\n\nfunction Success(props) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = MailSentL;\n\n return sstyled(styles)(\n <SSuccess render={Box}>\n <SEmail />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Submit(props) {\n const { styles } = props;\n const SSubmit = Root;\n return sstyled(styles)(<SSubmit render={Button} type=\"submit\" use=\"primary\" theme=\"success\" />);\n}\n\nfunction Cancel(props) {\n const { styles } = props;\n const SCancel = Root;\n return sstyled(styles)(<SCancel render={Button} type=\"reset\" use=\"secondary\" theme=\"muted\" />);\n}\n\nfunction Notice(props) {\n const { styles } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} />);\n}\n\nNotice.defaultProps = {\n theme: 'gray94',\n use: 'secondary',\n};\n\nexport default createComponent(FeedbackForm, {\n Item,\n Success,\n Submit,\n Cancel,\n Notice,\n});\n"],"file":"FeedbackForm.js"}
1
+ {"version":3,"sources":["../../src/FeedbackForm.js"],"names":["FeedbackForm","SFeedbackForm","Box","asProps","Children","styles","loading","forwardRef","other","focusDecorator","api","undefined","submitting","handleSubmit","origin","Component","style","Field","Form","onSubmit","description","error","value","words","split","symbols","join","length","email","test","String","toLowerCase","Item","props","tag","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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAIMA,Y;;;;;;;;;;;;;;;uGA2Ba,iC;;;;;;WAEjB,kBAAS;AACP,UAAMC,aAAa,GAAGC,YAAtB;AADO,0BAEqD,KAAKC,OAF1D;AAAA,UAECC,QAFD,iBAECA,QAFD;AAAA,UAEWC,MAFX,iBAEWA,MAFX;AAAA,UAEmBC,OAFnB,iBAEmBA,OAFnB;AAAA,UAE4BC,UAF5B,iBAE4BA,UAF5B;AAAA,UAE2CC,KAF3C;AAIP,0BACE,gCAAC,oBAAD;AAAM,QAAA,UAAU,EAAE,CAAC,KAAKC,cAAN;AAAlB,SAA6CD,KAA7C,GACG,UAACE,GAAD;AAAA;;AAAA,uBACC,mBAAQL,MAAR,CADD,eAEG,gCAAC,yBAAD;AAAA,kBAAoB,IAApB;AAAA,qBAAkCC,OAAO,KAAKK,SAAZ,GAAwBD,GAAG,CAACE,UAA5B,GAAyCN;AAA3E,yBACE,gCAAC,aAAD;AAAA,iBACM,MADN;AAAA;AAAA,oBAGS,MAHT;AAAA,iBAIOC;AAJP,WAKMC,KALN;AAAA,sBAMYE,GAAG,CAACG;AANhB,aAQG,OAAOT,QAAQ,CAACU,MAAhB,KAA2B,UAA3B,GAAwCV,QAAQ,CAACU,MAAT,CAAgBJ,GAAhB,CAAxC,gBAA+D,gCAAC,QAAD,2BARlE,CADF,CAFH;AAAA,OADH,CADF;AAoBD;;;EArDwBK,e;;iCAArBf,Y,iBACiB,c;iCADjBA,Y,WAEWgB,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AuB;AAAA;AAAA;;AAAA,MACb5B,MADa,GACF4B,KADE,CACb5B,MADa;AAErB,MAAM6C,OAAO,GAC2BF,kBADxC;AACA,kBAAO,mBAAQ3C,MAAR,CAAP,eAAuB,gCAAC,OAAD;AAAA,YAA8B,OAA9B;AAAA,WAA0C,WAA1C;AAAA,aAA4D;AAA5D,cAAvB;AACD;;AAED,SAAS8C,MAAT,CAAgBlB,KAAhB,EAAuB;AAAA;AAAA;;AAAA,MACb5B,MADa,GACF4B,KADE,CACb5B,MADa;AAErB,MAAM+C,OAAO,GAC2BC,mBADxC;AACA,kBAAO,mBAAQhD,MAAR,CAAP,eAAuB,gCAAC,OAAD,6EAAvB;AACD;;AAED8C,MAAM,CAACG,YAAP,GAAsB;AACpBC,EAAAA,KAAK,EAAE,QADa;AAEpBC,EAAAA,GAAG,EAAE;AAFe,CAAtB;;eAKe,sBAAgBxD,YAAhB,EAA8B;AAC3CgC,EAAAA,IAAI,EAAJA,IAD2C;AAE3CW,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';\n\nimport style from './style/feedback-form.shadow.css';\n\nclass FeedbackForm extends Component {\n static displayName = 'FeedbackForm';\n static style = style;\n static FinalForm = {\n Field,\n Form,\n };\n\n static defaultProps = {\n onSubmit: () => {},\n };\n\n static validate = {\n description: (error) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (symbols.length < 10 || words.length < 3) {\n return error;\n }\n },\n email: (error) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, loading, forwardRef, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer size=\"xl\" loading={loading === undefined ? api.submitting : loading}>\n <SFeedbackForm\n tag=\"form\"\n noValidate\n method=\"POST\"\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n {typeof Children.origin === 'function' ? Children.origin(api) : <Children />}\n </SFeedbackForm>\n </SpinContainer>,\n )\n }\n </Form>\n );\n }\n}\n\nfunction Item(props) {\n const { Children, tag } = props;\n\n return (\n <Root render={Field}>\n {({ input, meta, ...other }) => {\n const invalid = meta.invalid && meta.touched;\n const inputProps = {\n ...input,\n state: invalid ? 'invalid' : 'normal',\n };\n return (\n <Tooltip\n title={meta.error}\n visible={invalid && meta.active}\n inline={false}\n theme=\"warning\"\n placement=\"left\"\n flip={{\n fallbackPlacements: ['right', 'bottom'],\n }}\n >\n {tag && <Root render={tag} {...inputProps} />}\n {typeof Children.origin === 'function' &&\n Children.origin({\n input: inputProps,\n meta,\n ...other,\n })}\n </Tooltip>\n );\n }}\n </Root>\n );\n}\n\nfunction Success(props) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = 'div';\n\n return sstyled(styles)(\n <SSuccess render={Box}>\n <SEmail />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Submit(props) {\n const { styles } = props;\n const SSubmit = Root;\n return sstyled(styles)(<SSubmit render={Button} type=\"submit\" use=\"primary\" theme=\"success\" />);\n}\n\nfunction Cancel(props) {\n const { styles } = props;\n const SCancel = Root;\n return sstyled(styles)(<SCancel render={Button} type=\"reset\" use=\"secondary\" theme=\"muted\" />);\n}\n\nfunction Notice(props) {\n const { styles } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} />);\n}\n\nNotice.defaultProps = {\n theme: 'gray94',\n use: 'secondary',\n};\n\nexport default createComponent(FeedbackForm, {\n Item,\n Success,\n Submit,\n Cancel,\n Notice,\n});\n"],"file":"FeedbackForm.js"}
@@ -26,4 +26,7 @@ SSuccess {
26
26
  SEmail {
27
27
  margin-bottom: 8px;
28
28
  color: var(--green);
29
+ width: 80px;
30
+ height: 80px;
31
+ background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.04601C27.7367 5.04597 27.5305 5.08702 27.3381 5.16681C27.1458 5.24661 26.971 5.36357 26.8239 5.51101L13.909 18.426C7.41937 24.9156 3.77356 33.7174 3.77356 42.895C3.77356 52.0727 7.41937 60.8744 13.909 67.364C20.3985 73.8536 29.2003 77.4994 38.3779 77.4994C47.5556 77.4994 56.3574 73.8536 62.847 67.364L75.762 54.448C75.9092 54.3011 76.026 54.1265 76.1056 53.9343C76.1853 53.7421 76.2262 53.536 76.226 53.328V5.94401C76.226 5.70531 76.1311 5.47639 75.9623 5.30761C75.7936 5.13883 75.5646 5.04401 75.326 5.04401L27.945 5.04601Z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751L28.815 45.104C34.956 41.652 52.997 31.426 56.346 34.573C55.208 31.466 39.307 34.9 28.615 44.751Z' fill='white'/%3E%3Cpath d='M28.5129 31.03C26.6999 37.072 19.2999 55.5 15.0699 61.342L18.0829 62.254L19.6589 60.925C23.8779 51.385 29.6389 34.972 29.9709 29.467C29.4619 29.182 28.9469 29.583 28.5129 31.03Z' fill='white'/%3E%3Cpath d='M15.0699 61.342C19.2999 55.5 26.6999 37.072 28.5129 31.03C30.3259 24.988 33.5549 37.039 31.7429 42.145' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.9091 45.411C38.5921 35.046 55.1831 31.4 56.3421 34.573C57.0301 36.459 42.9131 40.832 37.9341 46.889' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43C41.036 20.27 35.689 18.539 32.832 17.741C36.95 15.907 69.787 3.753 72.5 2.5C71.578 6.606 67.576 20.78 65.784 27.433C60.957 25.751 56.056 24.275 52.862 23.24C50.8608 25.8918 49.0505 28.6825 47.445 31.591C46.272 27.731 45.116 23.274 44.281 21.43Z' fill='white' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43L61.026 10.352' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M52.864 23.24L72.502 2.5' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.447 31.591L55.299 24.015' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173L51.891 24.532L52.864 23.405L54.928 24.015L55.364 23.884L52.009 27.311L49.53 29.581L48.204 30.695L48.436 30.173Z' fill='black'/%3E%3Cpath d='M34.013 21.451L23.202 26.58' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40.9049 22.5L34.0129 26.862' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M62.2931 28.365L58.2531 38.215' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849C49.703 43.274 44.221 49.374 42.408 50.967' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.258 43.6C51.4 45.7 48.418 51.364 46.09 54.2' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M49.0231 48.9C54.5231 53.376 36.4671 72.622 35.1591 73.683' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' fill='black'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Crect width='80' height='80' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
29
32
  }
@@ -32,25 +32,24 @@ import SpinContainer from '@semcore/spin-container';
32
32
  import Tooltip from '@semcore/tooltip';
33
33
  import { NoticeSmart } from '@semcore/notice';
34
34
  import { Box } from '@semcore/flex-box';
35
- import MailSentL from '@semcore/icon/lib/MailSent/l';
36
35
 
37
36
  /*__reshadow-styles__:"./style/feedback-form.shadow.css"*/
38
37
  var style = (
39
38
  /*__reshadow_css_start__*/
40
39
  _sstyled.insert(
41
40
  /*__inner_css_start__*/
42
- ".___SFeedbackForm_1cir8_gg_{max-width:300px}.___SCancel_1cir8_gg_,.___SSubmit_1cir8_gg_{display:inline-flex;margin-right:8px}.___SNotice_1cir8_gg_._use_secondary_1cir8_gg_{border:none}.___SSuccess_1cir8_gg_{display:flex;align-items:center;flex-direction:column;width:300px;padding:32px;box-sizing:border-box}.___SEmail_1cir8_gg_{margin-bottom:8px;color:#4fae33}"
41
+ ".___SFeedbackForm_cr9x4_gg_{max-width:300px}.___SCancel_cr9x4_gg_,.___SSubmit_cr9x4_gg_{display:inline-flex;margin-right:8px}.___SNotice_cr9x4_gg_._use_secondary_cr9x4_gg_{border:none}.___SSuccess_cr9x4_gg_{display:flex;align-items:center;flex-direction:column;width:300px;padding:32px;box-sizing:border-box}.___SEmail_cr9x4_gg_{margin-bottom:8px;color:#4fae33;width:80px;height:80px;background-image:url(\"data:image/svg+xml;charset=utf-8,%3Csvg width='80' height='80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.046a1.583 1.583 0 00-1.121.465L13.909 18.426a34.604 34.604 0 1048.938 48.938l12.915-12.916a1.58 1.58 0 00.464-1.12V5.944a.9.9 0 00-.9-.9l-47.381.002z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751l.2.353c6.141-3.452 24.182-13.678 27.531-10.531-1.138-3.107-17.039.327-27.731 10.178zM28.513 31.03C26.7 37.072 19.3 55.5 15.07 61.342l3.013.912 1.576-1.329c4.219-9.54 9.98-25.953 10.312-31.458-.51-.285-1.024.116-1.458 1.563z' fill='%23fff'/%3E%3Cpath d='M15.07 61.342C19.3 55.5 26.7 37.072 28.513 31.03c1.813-6.042 5.042 6.009 3.23 11.115' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.91 45.411C38.591 35.046 55.182 31.4 56.341 34.573c.688 1.886-13.429 6.259-18.408 12.316' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43c-3.245-1.16-8.592-2.891-11.449-3.689C36.95 15.907 69.787 3.753 72.5 2.5c-.922 4.106-4.924 18.28-6.716 24.933-4.827-1.682-9.728-3.158-12.922-4.193a70.111 70.111 0 00-5.417 8.351c-1.173-3.86-2.329-8.317-3.164-10.161z' fill='%23fff' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43l16.745-11.078M52.864 23.24L72.502 2.5M47.447 31.591l7.852-7.576' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173l3.455-5.641.973-1.127 2.064.61.436-.131-3.355 3.427-2.479 2.27-1.326 1.114.232-.522z' fill='%23000'/%3E%3Cpath d='M34.013 21.451L23.202 26.58M40.905 22.5l-6.892 4.362M62.293 28.365l-4.04 9.85' stroke='%23fff' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849c3.613 2.425-1.869 8.525-3.682 10.118M47.258 43.6c4.142 2.1 1.16 7.764-1.168 10.6M49.023 48.9c5.5 4.476-12.556 23.722-13.864 24.783' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88c13.658-2.117 20.2 10.047 20.459 13.52A116.386 116.386 0 0127.4 87.533' fill='%23000'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88c13.658-2.117 20.2 10.047 20.459 13.52A116.386 116.386 0 0127.4 87.533' stroke='%23000' stroke-width='.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Cpath fill='%23fff' d='M0 0h80v80H0z'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E\")}"
43
42
  /*__inner_css_end__*/
44
- , "1uq9us8_gg_")
43
+ , "jfzeuw_gg_")
45
44
  /*__reshadow_css_end__*/
46
45
  , {
47
- "__SFeedbackForm": "___SFeedbackForm_1cir8_gg_",
48
- "__SCancel": "___SCancel_1cir8_gg_",
49
- "__SSubmit": "___SSubmit_1cir8_gg_",
50
- "__SNotice": "___SNotice_1cir8_gg_",
51
- "_use_secondary": "_use_secondary_1cir8_gg_",
52
- "__SSuccess": "___SSuccess_1cir8_gg_",
53
- "__SEmail": "___SEmail_1cir8_gg_"
46
+ "__SFeedbackForm": "___SFeedbackForm_cr9x4_gg_",
47
+ "__SCancel": "___SCancel_cr9x4_gg_",
48
+ "__SSubmit": "___SSubmit_cr9x4_gg_",
49
+ "__SNotice": "___SNotice_cr9x4_gg_",
50
+ "_use_secondary": "_use_secondary_cr9x4_gg_",
51
+ "__SSuccess": "___SSuccess_cr9x4_gg_",
52
+ "__SEmail": "___SEmail_cr9x4_gg_"
54
53
  });
55
54
 
56
55
  var FeedbackForm = /*#__PURE__*/function (_Component) {
@@ -169,7 +168,10 @@ function Item(props) {
169
168
  visible: invalid && meta.active,
170
169
  inline: false,
171
170
  theme: "warning",
172
- placement: "left"
171
+ placement: "left",
172
+ flip: {
173
+ fallbackPlacements: ['right', 'bottom']
174
+ }
173
175
  }, tag && /*#__PURE__*/React.createElement("tag", _assignProps2(_objectSpread({}, inputProps), _ref2)), typeof Children.origin === 'function' && Children.origin(_objectSpread({
174
176
  input: inputProps,
175
177
  meta: meta
@@ -184,7 +186,7 @@ function Success(props) {
184
186
  var Children = props.Children,
185
187
  styles = props.styles;
186
188
  var SSuccess = Box;
187
- var SEmail = MailSentL;
189
+ var SEmail = 'div';
188
190
  return _ref8 = sstyled(styles), /*#__PURE__*/React.createElement(SSuccess, _ref8.cn("SSuccess", _objectSpread({}, _assignProps3({}, _ref3))), /*#__PURE__*/React.createElement(SEmail, _ref8.cn("SEmail", {})), /*#__PURE__*/React.createElement("span", _ref8.cn("span", {}), /*#__PURE__*/React.createElement(Children, _ref8.cn("Children", {}))));
189
191
  } // because it is used without a wrapper
190
192
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/FeedbackForm.js"],"names":["React","Field","Form","createFocusDecorator","createComponent","Component","sstyled","Root","Button","SpinContainer","Tooltip","NoticeSmart","Box","MailSentL","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","Item","props","tag","input","meta","invalid","touched","inputProps","state","active","Success","SSuccess","SEmail","Submit","SSubmit","Cancel","SCancel","Notice","SNotice","defaultProps","theme","use"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAOA,KAAP,MAAkB,OAAlB;AACA,SAASC,KAAT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a,GACFyB,KADE,CACbzB,MADa;AAErB,MAAMwC,OAAO,GAC2BlD,MADxC;AACA,kBAAOF,OAAO,CAACY,MAAD,CAAd,eAAuB,oBAAC,OAAD;AAAA,YAA8B,OAA9B;AAAA,WAA0C,WAA1C;AAAA,aAA4D;AAA5D,cAAvB;AACD;;AAED,SAASyC,MAAT,CAAgBhB,KAAhB,EAAuB;AAAA;AAAA;;AAAA,MACbzB,MADa,GACFyB,KADE,CACbzB,MADa;AAErB,MAAM0C,OAAO,GAC2BjD,WADxC;AACA,kBAAOL,OAAO,CAACY,MAAD,CAAd,eAAuB,oBAAC,OAAD,oEAAvB;AACD;;AAEDyC,MAAM,CAACE,YAAP,GAAsB;AACpBC,EAAAA,KAAK,EAAE,QADa;AAEpBC,EAAAA,GAAG,EAAE;AAFe,CAAtB;AAKA,eAAe3D,eAAe,CAACU,YAAD,EAAe;AAC3C4B,EAAAA,IAAI,EAAJA,IAD2C;AAE3CU,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 MailSentL from '@semcore/icon/lib/MailSent/l';\n\nimport style from './style/feedback-form.shadow.css';\n\nclass FeedbackForm extends Component {\n static displayName = 'FeedbackForm';\n static style = style;\n static FinalForm = {\n Field,\n Form,\n };\n\n static defaultProps = {\n onSubmit: () => {},\n };\n\n static validate = {\n description: (error) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (symbols.length < 10 || words.length < 3) {\n return error;\n }\n },\n email: (error) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, loading, forwardRef, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer size=\"xl\" loading={loading === undefined ? api.submitting : loading}>\n <SFeedbackForm\n tag=\"form\"\n noValidate\n method=\"POST\"\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n {typeof Children.origin === 'function' ? Children.origin(api) : <Children />}\n </SFeedbackForm>\n </SpinContainer>,\n )\n }\n </Form>\n );\n }\n}\n\nfunction Item(props) {\n const { Children, tag } = props;\n\n return (\n <Root render={Field}>\n {({ input, meta, ...other }) => {\n const invalid = meta.invalid && meta.touched;\n const inputProps = {\n ...input,\n state: invalid ? 'invalid' : 'normal',\n };\n return (\n <Tooltip\n title={meta.error}\n visible={invalid && meta.active}\n inline={false}\n theme=\"warning\"\n placement=\"left\"\n >\n {tag && <Root render={tag} {...inputProps} />}\n {typeof Children.origin === 'function' &&\n Children.origin({\n input: inputProps,\n meta,\n ...other,\n })}\n </Tooltip>\n );\n }}\n </Root>\n );\n}\n\nfunction Success(props) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = MailSentL;\n\n return sstyled(styles)(\n <SSuccess render={Box}>\n <SEmail />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Submit(props) {\n const { styles } = props;\n const SSubmit = Root;\n return sstyled(styles)(<SSubmit render={Button} type=\"submit\" use=\"primary\" theme=\"success\" />);\n}\n\nfunction Cancel(props) {\n const { styles } = props;\n const SCancel = Root;\n return sstyled(styles)(<SCancel render={Button} type=\"reset\" use=\"secondary\" theme=\"muted\" />);\n}\n\nfunction Notice(props) {\n const { styles } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} />);\n}\n\nNotice.defaultProps = {\n theme: 'gray94',\n use: 'secondary',\n};\n\nexport default createComponent(FeedbackForm, {\n Item,\n Success,\n Submit,\n Cancel,\n Notice,\n});\n"],"file":"FeedbackForm.js"}
1
+ {"version":3,"sources":["../../src/FeedbackForm.js"],"names":["React","Field","Form","createFocusDecorator","createComponent","Component","sstyled","Root","Button","SpinContainer","Tooltip","NoticeSmart","Box","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","Item","props","tag","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;;;;;;;;;;;;;;;;;;;;;IAIMC,Y;;;;;;;;;;;;;;;;qEA2BaV,oBAAoB,E;;;;;;;WAErC,kBAAS;AACP,UAAMW,aAAa,GAAGF,GAAtB;;AADO,0BAEqD,KAAKG,OAF1D;AAAA,UAECC,QAFD,iBAECA,QAFD;AAAA,UAEWC,MAFX,iBAEWA,MAFX;AAAA,UAEmBC,OAFnB,iBAEmBA,OAFnB;AAAA,UAE4BC,UAF5B,iBAE4BA,UAF5B;AAAA,UAE2CC,K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A,IAD2C;AAE3CW,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';\n\nimport style from './style/feedback-form.shadow.css';\n\nclass FeedbackForm extends Component {\n static displayName = 'FeedbackForm';\n static style = style;\n static FinalForm = {\n Field,\n Form,\n };\n\n static defaultProps = {\n onSubmit: () => {},\n };\n\n static validate = {\n description: (error) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (symbols.length < 10 || words.length < 3) {\n return error;\n }\n },\n email: (error) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, loading, forwardRef, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer size=\"xl\" loading={loading === undefined ? api.submitting : loading}>\n <SFeedbackForm\n tag=\"form\"\n noValidate\n method=\"POST\"\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n {typeof Children.origin === 'function' ? Children.origin(api) : <Children />}\n </SFeedbackForm>\n </SpinContainer>,\n )\n }\n </Form>\n );\n }\n}\n\nfunction Item(props) {\n const { Children, tag } = props;\n\n return (\n <Root render={Field}>\n {({ input, meta, ...other }) => {\n const invalid = meta.invalid && meta.touched;\n const inputProps = {\n ...input,\n state: invalid ? 'invalid' : 'normal',\n };\n return (\n <Tooltip\n title={meta.error}\n visible={invalid && meta.active}\n inline={false}\n theme=\"warning\"\n placement=\"left\"\n flip={{\n fallbackPlacements: ['right', 'bottom'],\n }}\n >\n {tag && <Root render={tag} {...inputProps} />}\n {typeof Children.origin === 'function' &&\n Children.origin({\n input: inputProps,\n meta,\n ...other,\n })}\n </Tooltip>\n );\n }}\n </Root>\n );\n}\n\nfunction Success(props) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = 'div';\n\n return sstyled(styles)(\n <SSuccess render={Box}>\n <SEmail />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Submit(props) {\n const { styles } = props;\n const SSubmit = Root;\n return sstyled(styles)(<SSubmit render={Button} type=\"submit\" use=\"primary\" theme=\"success\" />);\n}\n\nfunction Cancel(props) {\n const { styles } = props;\n const SCancel = Root;\n return sstyled(styles)(<SCancel render={Button} type=\"reset\" use=\"secondary\" theme=\"muted\" />);\n}\n\nfunction Notice(props) {\n const { styles } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} />);\n}\n\nNotice.defaultProps = {\n theme: 'gray94',\n use: 'secondary',\n};\n\nexport default createComponent(FeedbackForm, {\n Item,\n Success,\n Submit,\n Cancel,\n Notice,\n});\n"],"file":"FeedbackForm.js"}
@@ -26,4 +26,7 @@ SSuccess {
26
26
  SEmail {
27
27
  margin-bottom: 8px;
28
28
  color: var(--green);
29
+ width: 80px;
30
+ height: 80px;
31
+ background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.04601C27.7367 5.04597 27.5305 5.08702 27.3381 5.16681C27.1458 5.24661 26.971 5.36357 26.8239 5.51101L13.909 18.426C7.41937 24.9156 3.77356 33.7174 3.77356 42.895C3.77356 52.0727 7.41937 60.8744 13.909 67.364C20.3985 73.8536 29.2003 77.4994 38.3779 77.4994C47.5556 77.4994 56.3574 73.8536 62.847 67.364L75.762 54.448C75.9092 54.3011 76.026 54.1265 76.1056 53.9343C76.1853 53.7421 76.2262 53.536 76.226 53.328V5.94401C76.226 5.70531 76.1311 5.47639 75.9623 5.30761C75.7936 5.13883 75.5646 5.04401 75.326 5.04401L27.945 5.04601Z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751L28.815 45.104C34.956 41.652 52.997 31.426 56.346 34.573C55.208 31.466 39.307 34.9 28.615 44.751Z' fill='white'/%3E%3Cpath d='M28.5129 31.03C26.6999 37.072 19.2999 55.5 15.0699 61.342L18.0829 62.254L19.6589 60.925C23.8779 51.385 29.6389 34.972 29.9709 29.467C29.4619 29.182 28.9469 29.583 28.5129 31.03Z' fill='white'/%3E%3Cpath d='M15.0699 61.342C19.2999 55.5 26.6999 37.072 28.5129 31.03C30.3259 24.988 33.5549 37.039 31.7429 42.145' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.9091 45.411C38.5921 35.046 55.1831 31.4 56.3421 34.573C57.0301 36.459 42.9131 40.832 37.9341 46.889' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43C41.036 20.27 35.689 18.539 32.832 17.741C36.95 15.907 69.787 3.753 72.5 2.5C71.578 6.606 67.576 20.78 65.784 27.433C60.957 25.751 56.056 24.275 52.862 23.24C50.8608 25.8918 49.0505 28.6825 47.445 31.591C46.272 27.731 45.116 23.274 44.281 21.43Z' fill='white' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43L61.026 10.352' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M52.864 23.24L72.502 2.5' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.447 31.591L55.299 24.015' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173L51.891 24.532L52.864 23.405L54.928 24.015L55.364 23.884L52.009 27.311L49.53 29.581L48.204 30.695L48.436 30.173Z' fill='black'/%3E%3Cpath d='M34.013 21.451L23.202 26.58' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40.9049 22.5L34.0129 26.862' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M62.2931 28.365L58.2531 38.215' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849C49.703 43.274 44.221 49.374 42.408 50.967' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.258 43.6C51.4 45.7 48.418 51.364 46.09 54.2' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M49.0231 48.9C54.5231 53.376 36.4671 72.622 35.1591 73.683' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' fill='black'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Crect width='80' height='80' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
29
32
  }
@@ -16,7 +16,7 @@ export interface IFeedbackForm extends FormProps {
16
16
  }
17
17
 
18
18
  declare const FeedbackForm: (<T>(props: CProps<IFeedbackForm> & T) => ReturnEl) & {
19
- Item: <T>(props: FieldProps & T) => ReturnEl;
19
+ Item: <T>(props: FieldProps<any, any> & T) => ReturnEl;
20
20
  Success: <T>(props: CProps<ComponentProps<typeof Box>> & T) => ReturnEl;
21
21
  Submit: <T>(props: ComponentProps<typeof Button> & T) => ReturnEl;
22
22
  Cancel: <T>(props: ComponentProps<typeof Button> & T) => ReturnEl;
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@semcore/feedback-form",
3
3
  "description": "SEMRush Feedback Form Component",
4
- "version": "3.3.0",
4
+ "version": "3.4.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
8
+ "sideEffects": false,
8
9
  "author": "Roman Lysov <r.lysov@semrush.com>",
9
10
  "license": "MIT",
10
11
  "scripts": {
@@ -16,7 +17,6 @@
16
17
  "@semcore/flex-box": "^4",
17
18
  "@semcore/tooltip": "^4",
18
19
  "@semcore/spin-container": "^4",
19
- "@semcore/icon": "^2",
20
20
  "@semcore/button": "^3",
21
21
  "@semcore/notice": "^3",
22
22
  "final-form": "^4.19",
@@ -8,7 +8,6 @@ import SpinContainer from '@semcore/spin-container';
8
8
  import Tooltip from '@semcore/tooltip';
9
9
  import { NoticeSmart } from '@semcore/notice';
10
10
  import { Box } from '@semcore/flex-box';
11
- import MailSentL from '@semcore/icon/lib/MailSent/l';
12
11
 
13
12
  import style from './style/feedback-form.shadow.css';
14
13
 
@@ -86,6 +85,9 @@ function Item(props) {
86
85
  inline={false}
87
86
  theme="warning"
88
87
  placement="left"
88
+ flip={{
89
+ fallbackPlacements: ['right', 'bottom'],
90
+ }}
89
91
  >
90
92
  {tag && <Root render={tag} {...inputProps} />}
91
93
  {typeof Children.origin === 'function' &&
@@ -104,7 +106,7 @@ function Item(props) {
104
106
  function Success(props) {
105
107
  const { Children, styles } = props;
106
108
  const SSuccess = Root;
107
- const SEmail = MailSentL;
109
+ const SEmail = 'div';
108
110
 
109
111
  return sstyled(styles)(
110
112
  <SSuccess render={Box}>
package/src/index.d.ts CHANGED
@@ -16,7 +16,7 @@ export interface IFeedbackForm extends FormProps {
16
16
  }
17
17
 
18
18
  declare const FeedbackForm: (<T>(props: CProps<IFeedbackForm> & T) => ReturnEl) & {
19
- Item: <T>(props: FieldProps & T) => ReturnEl;
19
+ Item: <T>(props: FieldProps<any, any> & T) => ReturnEl;
20
20
  Success: <T>(props: CProps<ComponentProps<typeof Box>> & T) => ReturnEl;
21
21
  Submit: <T>(props: ComponentProps<typeof Button> & T) => ReturnEl;
22
22
  Cancel: <T>(props: ComponentProps<typeof Button> & T) => ReturnEl;
@@ -26,4 +26,7 @@ SSuccess {
26
26
  SEmail {
27
27
  margin-bottom: 8px;
28
28
  color: var(--green);
29
+ width: 80px;
30
+ height: 80px;
31
+ background-image: url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cg clip-path='url(%23clip0_11950_117175)'%3E%3Cpath d='M27.945 5.04601C27.7367 5.04597 27.5305 5.08702 27.3381 5.16681C27.1458 5.24661 26.971 5.36357 26.8239 5.51101L13.909 18.426C7.41937 24.9156 3.77356 33.7174 3.77356 42.895C3.77356 52.0727 7.41937 60.8744 13.909 67.364C20.3985 73.8536 29.2003 77.4994 38.3779 77.4994C47.5556 77.4994 56.3574 73.8536 62.847 67.364L75.762 54.448C75.9092 54.3011 76.026 54.1265 76.1056 53.9343C76.1853 53.7421 76.2262 53.536 76.226 53.328V5.94401C76.226 5.70531 76.1311 5.47639 75.9623 5.30761C75.7936 5.13883 75.5646 5.04401 75.326 5.04401L27.945 5.04601Z' fill='%2345E0A8'/%3E%3Cpath d='M28.615 44.751L28.815 45.104C34.956 41.652 52.997 31.426 56.346 34.573C55.208 31.466 39.307 34.9 28.615 44.751Z' fill='white'/%3E%3Cpath d='M28.5129 31.03C26.6999 37.072 19.2999 55.5 15.0699 61.342L18.0829 62.254L19.6589 60.925C23.8779 51.385 29.6389 34.972 29.9709 29.467C29.4619 29.182 28.9469 29.583 28.5129 31.03Z' fill='white'/%3E%3Cpath d='M15.0699 61.342C19.2999 55.5 26.6999 37.072 28.5129 31.03C30.3259 24.988 33.5549 37.039 31.7429 42.145' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M27.9091 45.411C38.5921 35.046 55.1831 31.4 56.3421 34.573C57.0301 36.459 42.9131 40.832 37.9341 46.889' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43C41.036 20.27 35.689 18.539 32.832 17.741C36.95 15.907 69.787 3.753 72.5 2.5C71.578 6.606 67.576 20.78 65.784 27.433C60.957 25.751 56.056 24.275 52.862 23.24C50.8608 25.8918 49.0505 28.6825 47.445 31.591C46.272 27.731 45.116 23.274 44.281 21.43Z' fill='white' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.281 21.43L61.026 10.352' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M52.864 23.24L72.502 2.5' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.447 31.591L55.299 24.015' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.436 30.173L51.891 24.532L52.864 23.405L54.928 24.015L55.364 23.884L52.009 27.311L49.53 29.581L48.204 30.695L48.436 30.173Z' fill='black'/%3E%3Cpath d='M34.013 21.451L23.202 26.58' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40.9049 22.5L34.0129 26.862' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M62.2931 28.365L58.2531 38.215' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.09 40.849C49.703 43.274 44.221 49.374 42.408 50.967' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.258 43.6C51.4 45.7 48.418 51.364 46.09 54.2' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M49.0231 48.9C54.5231 53.376 36.4671 72.622 35.1591 73.683' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' fill='black'/%3E%3Cpath d='M5.177 73.321C7.669 70.98 13.419 62.372 14.7 59.88C28.358 57.763 34.9 69.927 35.159 73.4C32.9025 78.2847 30.3099 83.007 27.4 87.533' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3Cdefs%3E%3CclipPath id='clip0_11950_117175'%3E%3Crect width='80' height='80' fill='white'/%3E%3C/clipPath%3E%3C/defs%3E%3C/svg%3E%0A");
29
32
  }