@semcore/feedback-form 6.43.0-prerelease.0 → 6.43.0-prerelease.1

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.
Files changed (60) hide show
  1. package/lib/cjs/FeedbackForm.js +28 -22
  2. package/lib/cjs/FeedbackForm.js.map +1 -1
  3. package/lib/cjs/component/checkbox-button/CheckboxButton.js +22 -34
  4. package/lib/cjs/component/checkbox-button/CheckboxButton.js.map +1 -1
  5. package/lib/cjs/component/feedback-item/FeedbackItem.js +8 -8
  6. package/lib/cjs/component/feedback-item/FeedbackItem.js.map +1 -1
  7. package/lib/cjs/component/feedback-rating/FeedbackRating.js +71 -63
  8. package/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -1
  9. package/lib/cjs/component/feedback-rating/FeedbackRating.type.js.map +1 -1
  10. package/lib/cjs/component/slider-rating/SliderRating.js +47 -37
  11. package/lib/cjs/component/slider-rating/SliderRating.js.map +1 -1
  12. package/lib/cjs/component/submit-button/SubmitButton.js +1 -1
  13. package/lib/cjs/component/submit-button/SubmitButton.js.map +1 -1
  14. package/lib/cjs/index.d.js +1 -1
  15. package/lib/cjs/index.d.js.map +1 -1
  16. package/lib/cjs/index.js +1 -1
  17. package/lib/cjs/index.js.map +1 -1
  18. package/lib/cjs/style/feedback-form.shadow.css +1 -1
  19. package/lib/cjs/style/feedback-rating.shadow.css +0 -8
  20. package/lib/cjs/style/slider-rating.shadow.css +6 -1
  21. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +5 -4
  22. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
  23. package/lib/es6/FeedbackForm.js +22 -19
  24. package/lib/es6/FeedbackForm.js.map +1 -1
  25. package/lib/es6/component/checkbox-button/CheckboxButton.js +16 -31
  26. package/lib/es6/component/checkbox-button/CheckboxButton.js.map +1 -1
  27. package/lib/es6/component/feedback-item/FeedbackItem.js +7 -7
  28. package/lib/es6/component/feedback-item/FeedbackItem.js.map +1 -1
  29. package/lib/es6/component/feedback-rating/FeedbackRating.js +61 -56
  30. package/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -1
  31. package/lib/es6/component/feedback-rating/FeedbackRating.type.js.map +1 -1
  32. package/lib/es6/component/slider-rating/SliderRating.js +40 -33
  33. package/lib/es6/component/slider-rating/SliderRating.js.map +1 -1
  34. package/lib/es6/component/submit-button/SubmitButton.js +1 -1
  35. package/lib/es6/component/submit-button/SubmitButton.js.map +1 -1
  36. package/lib/es6/index.d.js +3 -0
  37. package/lib/es6/index.d.js.map +1 -1
  38. package/lib/es6/index.js.map +1 -1
  39. package/lib/es6/style/feedback-form.shadow.css +1 -1
  40. package/lib/es6/style/feedback-rating.shadow.css +0 -8
  41. package/lib/es6/style/slider-rating.shadow.css +6 -1
  42. package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
  43. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
  44. package/lib/esm/FeedbackForm.mjs +31 -27
  45. package/lib/esm/component/checkbox-button/CheckboxButton.mjs +22 -34
  46. package/lib/esm/component/feedback-item/FeedbackItem.mjs +6 -6
  47. package/lib/esm/component/feedback-rating/FeedbackRating.mjs +64 -52
  48. package/lib/esm/component/slider-rating/SliderRating.mjs +45 -37
  49. package/lib/esm/style/feedback-form.shadow.css +1 -1
  50. package/lib/esm/style/feedback-rating.shadow.css +0 -8
  51. package/lib/esm/style/slider-rating.shadow.css +6 -1
  52. package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
  53. package/lib/types/component/checkbox-button/CheckboxButton.d.ts +3 -1
  54. package/lib/types/component/feedback-item/FeedbackItem.d.ts +3 -3
  55. package/lib/types/component/feedback-rating/FeedbackRating.d.ts +184 -19
  56. package/lib/types/component/feedback-rating/FeedbackRating.type.d.ts +26 -35
  57. package/lib/types/component/slider-rating/SliderRating.d.ts +3 -3
  58. package/lib/types/component/submit-button/SubmitButton.d.ts +1 -1
  59. package/lib/types/index.d.ts +15 -6
  60. package/package.json +17 -17
@@ -2,48 +2,31 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
3
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
4
4
  import _createClass from "@babel/runtime/helpers/createClass";
5
- import _callSuper from "@babel/runtime/helpers/callSuper";
6
5
  import _inherits from "@babel/runtime/helpers/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/createSuper";
7
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- import { sstyled as _sstyled } from "@semcore/core";
8
+ import { sstyled as _sstyled } from "@semcore/utils/lib/core/index";
9
9
  import { assignProps as _assignProps } from "@semcore/core";
10
10
  var _excluded = ["styles", "id", "label", "type", "focused"];
11
- import { Box } from '@semcore/base-components';
12
- import Checkbox from '@semcore/checkbox';
13
- import { createComponent, Component, Root, sstyled } from '@semcore/core';
14
11
  import React from 'react';
12
+ import createComponent, { Component, Root, sstyled } from '@semcore/core';
13
+ import { Box } from '@semcore/flex-box';
15
14
  /*!__reshadow-styles__:"../../style/checkbox-button.shadow.css"*/
16
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SCheckboxButton_hai4d_gg_{margin-top:var(--intergalactic-spacing-2x, 8px);border:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161));border-radius:var(--intergalactic-rounded-medium, 6px)}@supports (color:color(display-p3 0 0 0%)){.___SCheckboxButton_hai4d_gg_{border:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SCheckboxButton_hai4d_gg_{border:1px solid var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___SCheckboxButton_hai4d_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x, 12px);box-sizing:border-box}.___SCheckboxButton_hai4d_gg_.__checked_hai4d_gg_{cursor:pointer;border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386));background-color:rgba(0,143,248,.1)}@supports (color:color(display-p3 0 0 0%)){.___SCheckboxButton_hai4d_gg_.__checked_hai4d_gg_{border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386))}@media (color-gamut:p3){.___SCheckboxButton_hai4d_gg_.__checked_hai4d_gg_{border-color:var(--intergalactic-border-info-active, color(display-p3 0.01805 0.08334 0.73488 / 0.386))}}}@media (hover:hover){.___SCheckboxButton_hai4d_gg_:hover{cursor:pointer;border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386));background-color:rgba(0,143,248,.1)}@supports (color:color(display-p3 0 0 0%)){.___SCheckboxButton_hai4d_gg_:hover{border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386))}@media (color-gamut:p3){.___SCheckboxButton_hai4d_gg_:hover{border-color:var(--intergalactic-border-info-active, color(display-p3 0.01805 0.08334 0.73488 / 0.386))}}}.___SCheckboxButton_hai4d_gg_.__checked_hai4d_gg_:hover{background-color:rgba(0,143,248,.2)}}", /*__inner_css_end__*/"hai4d_gg_"),
15
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SCheckboxButton_1jr0a_gg_{margin-top:var(--intergalactic-spacing-2x, 8px);border:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161));border-radius:var(--intergalactic-rounded-medium, 6px)}@supports (color:color(display-p3 0 0 0)){.___SCheckboxButton_1jr0a_gg_{border:1px solid var(--intergalactic-border-primary, rgba(0, 12, 8, 0.161))}@media (color-gamut:p3){.___SCheckboxButton_1jr0a_gg_{border:1px solid var(--intergalactic-border-primary, color(display-p3 0.00798 0.04498 0.03219 / 0.161))}}}.___SCheckboxButton_1jr0a_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x, 12px);box-sizing:border-box}.___SCheckboxButton_1jr0a_gg_.__checked_1jr0a_gg_{cursor:pointer;border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386));background-color:rgba(0,143,248,.1)}@supports (color:color(display-p3 0 0 0)){.___SCheckboxButton_1jr0a_gg_.__checked_1jr0a_gg_{border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386))}@media (color-gamut:p3){.___SCheckboxButton_1jr0a_gg_.__checked_1jr0a_gg_{border-color:var(--intergalactic-border-info-active, color(display-p3 0.01805 0.08333 0.73488 / 0.386))}}}@media (hover:hover){.___SCheckboxButton_1jr0a_gg_:hover{cursor:pointer;border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386));background-color:rgba(0,143,248,.1)}@supports (color:color(display-p3 0 0 0)){.___SCheckboxButton_1jr0a_gg_:hover{border-color:var(--intergalactic-border-info-active, rgba(0, 22, 195, 0.386))}@media (color-gamut:p3){.___SCheckboxButton_1jr0a_gg_:hover{border-color:var(--intergalactic-border-info-active, color(display-p3 0.01805 0.08333 0.73488 / 0.386))}}}.___SCheckboxButton_1jr0a_gg_.__checked_1jr0a_gg_:hover{background-color:rgba(0,143,248,.2)}}", /*__inner_css_end__*/"1jr0a_gg_"),
17
16
  /*__reshadow_css_end__*/
18
17
  {
19
- "__SCheckboxButton": "___SCheckboxButton_hai4d_gg_",
20
- "_checked": "__checked_hai4d_gg_"
18
+ "__SCheckboxButton": "___SCheckboxButton_1jr0a_gg_",
19
+ "_checked": "__checked_1jr0a_gg_"
21
20
  });
21
+ import Checkbox from '@semcore/checkbox';
22
22
  var CheckboxButtonRoot = /*#__PURE__*/function (_Component) {
23
+ _inherits(CheckboxButtonRoot, _Component);
24
+ var _super = _createSuper(CheckboxButtonRoot);
23
25
  function CheckboxButtonRoot() {
24
- var _this;
25
26
  _classCallCheck(this, CheckboxButtonRoot);
26
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
27
- args[_key] = arguments[_key];
28
- }
29
- _this = _callSuper(this, CheckboxButtonRoot, [].concat(args));
30
- _defineProperty(_this, "checkboxRef", /*#__PURE__*/React.createRef());
31
- return _this;
27
+ return _super.apply(this, arguments);
32
28
  }
33
- _inherits(CheckboxButtonRoot, _Component);
34
- return _createClass(CheckboxButtonRoot, [{
35
- key: "componentDidMount",
36
- value: function componentDidMount() {
37
- var _this2 = this;
38
- var focused = this.asProps.focused;
39
- if (focused) {
40
- setTimeout(function () {
41
- var _this2$checkboxRef$cu;
42
- (_this2$checkboxRef$cu = _this2.checkboxRef.current) === null || _this2$checkboxRef$cu === void 0 || _this2$checkboxRef$cu.focus();
43
- }, 20);
44
- }
45
- }
46
- }, {
29
+ _createClass(CheckboxButtonRoot, [{
47
30
  key: "render",
48
31
  value: function render() {
49
32
  var _ref = this.asProps,
@@ -52,20 +35,22 @@ var CheckboxButtonRoot = /*#__PURE__*/function (_Component) {
52
35
  styles = _this$asProps.styles,
53
36
  id = _this$asProps.id,
54
37
  label = _this$asProps.label,
55
- _type = _this$asProps.type,
38
+ type = _this$asProps.type,
56
39
  focused = _this$asProps.focused,
57
40
  other = _objectWithoutProperties(_this$asProps, _excluded);
41
+ var autoFocus = focused ? 20 : false;
58
42
  var SCheckboxButton = Box;
59
43
  return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SCheckboxButton, _ref2.cn("SCheckboxButton", _objectSpread({}, _assignProps({
60
44
  "__excludeProps": ['onChange', 'id', 'type']
61
45
  }, _ref))), /*#__PURE__*/React.createElement(Checkbox, _ref2.cn("Checkbox", _objectSpread({}, other)), /*#__PURE__*/React.createElement(Checkbox.Value, {
62
- ref: this.checkboxRef,
46
+ autoFocus: autoFocus,
63
47
  "aria-labelledby": id
64
48
  }), /*#__PURE__*/React.createElement(Checkbox.Text, {
65
49
  id: id
66
50
  }, label)));
67
51
  }
68
52
  }]);
53
+ return CheckboxButtonRoot;
69
54
  }(Component);
70
55
  _defineProperty(CheckboxButtonRoot, "style", style);
71
56
  var CheckboxButton = createComponent(CheckboxButtonRoot);
@@ -1 +1 @@
1
- {"version":3,"file":"CheckboxButton.js","names":["Box","Checkbox","createComponent","Component","Root","sstyled","React","style","_sstyled","insert","CheckboxButtonRoot","_Component","_this","_classCallCheck","_len","arguments","length","args","Array","_key","_callSuper","concat","_defineProperty","createRef","_inherits","_createClass","key","value","componentDidMount","_this2","focused","asProps","setTimeout","_this2$checkboxRef$cu","checkboxRef","current","focus","render","_ref","_ref2","_this$asProps","styles","id","label","_type","type","other","_objectWithoutProperties","_excluded","SCheckboxButton","createElement","cn","_objectSpread","_assignProps","Value","ref","Text","CheckboxButton"],"sources":["../../../../src/component/checkbox-button/CheckboxButton.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport Checkbox from '@semcore/checkbox';\nimport { createComponent, Component, Root, sstyled } from '@semcore/core';\nimport React from 'react';\n\nimport style from '../../style/checkbox-button.shadow.css';\nimport type { FeedbackRatingCheckboxProps } from '../feedback-rating/FeedbackRating.type';\n\nclass CheckboxButtonRoot extends Component<FeedbackRatingCheckboxProps> {\n static style = style;\n\n checkboxRef = React.createRef<HTMLInputElement>();\n\n componentDidMount() {\n const { focused } = this.asProps;\n\n if (focused) {\n setTimeout(() => {\n this.checkboxRef.current?.focus();\n }, 20);\n }\n }\n\n render() {\n const { styles, id, label, type: _type, focused, ...other } = this.asProps;\n\n const SCheckboxButton = Root;\n return sstyled(styles)(\n <SCheckboxButton render={Box} __excludeProps={['onChange', 'id', 'type']}>\n <Checkbox {...other}>\n <Checkbox.Value ref={this.checkboxRef} aria-labelledby={id} />\n <Checkbox.Text id={id}>{label}</Checkbox.Text>\n </Checkbox>\n </SCheckboxButton>,\n );\n }\n}\n\nconst CheckboxButton = createComponent(CheckboxButtonRoot);\n\nexport default CheckboxButton;\n"],"mappings":";;;;;;;;;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,QAAQ,MAAM,mBAAmB;AACxC,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACzE,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,IAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EA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I;QAASf,OAAO,GAAAU,aAAA,CAAPV,OAAO;QAAKgB,KAAK,GAAAC,wBAAA,CAAAP,aAAA,EAAAQ,SAAA;MAEzD,IAAMC,eAAe,GAEMjD,GAAG;MAD9B,OAAAuC,KAAA,GAAOlC,OAAO,CAACoC,MAAM,CAAC,eACpBnC,KAAA,CAAA4C,aAAA,CAACD,eAAe,EAAAV,KAAA,CAAAY,EAAA,oBAAAC,aAAA,KAAAC,YAAA;QAAA,kBAA8B,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM;MAAC,GAAAf,IAAA,kBACtEhC,KAAA,CAAA4C,aAAA,CAACjD,QAAQ,EAAAsC,KAAA,CAAAY,EAAA,aAAAC,aAAA,KAAKN,KAAK,iBACjBxC,KAAA,CAAA4C,aAAA,CAACjD,QAAQ,CAACqD,KAAK;QAACC,GAAG,EAAE,IAAI,CAACrB,WAAY;QAAC,mBAAiBQ;MAAG,CAAE,CAAC,eAC9DpC,KAAA,CAAA4C,aAAA,CAACjD,QAAQ,CAACuD,IAAI;QAACd,EAAE,EAAEA;MAAG,GAAEC,KAAqB,CACrC,CACK,CAAC;IAEtB;EAAC;AAAA,EA3B8BxC,SAAS;AAAAmB,eAAA,CAApCZ,kBAAkB,WACPH,KAAK;AA6BtB,IAAMkD,cAAc,GAAGvD,eAAe,CAACQ,kBAAkB,CAAC;AAE1D,eAAe+C,cAAc","ignoreList":[]}
1
+ {"version":3,"file":"CheckboxButton.js","names":["React","createComponent","Component","Root","sstyled","Box","style","_sstyled","insert","Checkbox","CheckboxButtonRoot","_Component","_inherits","_super","_createSuper","_classCallCheck","apply","arguments","_createClass","key","value","render","_ref","asProps","_ref2","_this$asProps","styles","id","label","type","focused","other","_objectWithoutProperties","_excluded","autoFocus","SCheckboxButton","createElement","cn","_objectSpread","_assignProps","Value","Text","_defineProperty","CheckboxButton"],"sources":["../../../../src/component/checkbox-button/CheckboxButton.tsx"],"sourcesContent":["import React from 'react';\nimport createComponent, { Component, Root, sstyled } from '@semcore/core';\nimport { Box } from '@semcore/flex-box';\n\nimport style from '../../style/checkbox-button.shadow.css';\nimport Checkbox from '@semcore/checkbox';\nimport { FeedbackRatingCheckboxProps } from '../feedback-rating/FeedbackRating.type';\n\nclass CheckboxButtonRoot extends Component<FeedbackRatingCheckboxProps> {\n static style = style;\n\n render() {\n const { styles, id, label, type, focused, ...other } = this.asProps;\n const autoFocus = focused ? 20 : false;\n\n const SCheckboxButton = Root;\n return sstyled(styles)(\n <SCheckboxButton render={Box} __excludeProps={['onChange', 'id', 'type']}>\n <Checkbox {...other}>\n <Checkbox.Value autoFocus={autoFocus} aria-labelledby={id} />\n <Checkbox.Text id={id}>{label}</Checkbox.Text>\n </Checkbox>\n </SCheckboxButton>,\n );\n }\n}\n\nconst CheckboxButton = createComponent(CheckboxButtonRoot);\n\nexport default CheckboxButton;\n"],"mappings":";;;;;;;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,eAAe,IAAIC,SAAS,EAAEC,IAAI,EAAEC,OAAO,QAAQ,eAAe;AACzE,SAASC,GAAG,QAAQ,mBAAmB;AAAC;AAAA,IAAAC,KAAA,+BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;AAAA;AAGxC,OAAOC,QAAQ,MAAM,mBAAmB;AAAC,IAGnCC,kBAAkB,0BAAAC,UAAA;EAAAC,SAAA,CAAAF,kBAAA,EAAAC,UAAA;EAAA,IAAAE,MAAA,GAAAC,YAAA,CAAAJ,kBAAA;EAAA,SAAAA,mBAAA;IAAAK,eAAA,OAAAL,kBAAA;IAAA,OAAAG,MAAA,CAAAG,KAAA,OAAAC,SAAA;EAAA;EAAAC,YAAA,CAAAR,kBAAA;IAAAS,GAAA;IAAAC,KAAA,EAGtB,SAAAC,OAAA,EAAS;MAAA,IAAAC,IAAA,QAAAC,OAAA;QAAAC,KAAA;MACP,IAAAC,aAAA,GAAuD,IAAI,CAACF,OAAO;QAA3DG,MAAM,GAAAD,aAAA,CAANC,MAAM;QAAEC,EAAE,GAAAF,aAAA,CAAFE,EAAE;QAAEC,KAAK,GAAAH,aAAA,CAALG,KAAK;QAAEC,IAAI,GAAAJ,aAAA,CAAJI,IAAI;QAAEC,OAAO,GAAAL,aAAA,CAAPK,OAAO;QAAKC,KAAK,GAAAC,wBAAA,CAAAP,aAAA,EAAAQ,SAAA;MAClD,IAAMC,SAAS,GAAGJ,OAAO,GAAG,EAAE,GAAG,KAAK;MAEtC,IAAMK,eAAe,GAEM9B,GAAG;MAD9B,OAAAmB,KAAA,GAAOpB,OAAO,CAACsB,MAAM,CAAC,eACpB1B,KAAA,CAAAoC,aAAA,CAACD,eAAe,EAAAX,KAAA,CAAAa,EAAA,oBAAAC,aAAA,KAAAC,YAAA;QAAA,kBAA8B,CAAC,UAAU,EAAE,IAAI,EAAE,MAAM;MAAC,GAAAjB,IAAA,kBACtEtB,KAAA,CAAAoC,aAAA,CAAC3B,QAAQ,EAAAe,KAAA,CAAAa,EAAA,aAAAC,aAAA,KAAKP,KAAK,iBACjB/B,KAAA,CAAAoC,aAAA,CAAC3B,QAAQ,CAAC+B,KAAK;QAACN,SAAS,EAAEA,SAAU;QAAC,mBAAiBP;MAAG,EAAG,eAC7D3B,KAAA,CAAAoC,aAAA,CAAC3B,QAAQ,CAACgC,IAAI;QAACd,EAAE,EAAEA;MAAG,GAAEC,KAAK,CAAiB,CACrC,CACK;IAEtB;EAAC;EAAA,OAAAlB,kBAAA;AAAA,EAhB8BR,SAAS;AAAAwC,eAAA,CAApChC,kBAAkB,WACPJ,KAAK;AAkBtB,IAAMqC,cAAc,GAAG1C,eAAe,CAACS,kBAAkB,CAAC;AAE1D,eAAeiC,cAAc"}
@@ -3,13 +3,13 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
3
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
4
4
  var _excluded = ["Children", "tag", "uid", "tooltipProps"],
5
5
  _excluded2 = ["input", "meta"];
6
- import { assignProps } from '@semcore/core';
7
- import pick from '@semcore/core/lib/utils/pick';
8
- import propsForElement from '@semcore/core/lib/utils/propsForElement';
9
- import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
10
- import Tooltip from '@semcore/tooltip';
11
6
  import React from 'react';
12
7
  import { Field } from 'react-final-form';
8
+ import Tooltip from '@semcore/tooltip';
9
+ import pick from '@semcore/utils/lib/pick';
10
+ import uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';
11
+ import { assignProps } from '@semcore/utils/lib/core';
12
+ import propsForElement from '@semcore/utils/lib/propsForElement';
13
13
  var deafultTooltipPropsList = ['title', 'theme', 'strategy', 'modifiers', 'placement', 'interaction', 'timeout', 'visible', 'defaultVisible', 'onVisibleChange', 'offset', 'preventOverflow', 'arrow', 'flip', 'computeStyles', 'eventListeners', 'onFirstUpdate'];
14
14
  export function FeedbackItem(_ref) {
15
15
  var Children = _ref.Children,
@@ -31,7 +31,7 @@ export function FeedbackItem(_ref) {
31
31
  var popperId = "".concat(uid, "-error-description");
32
32
  var ariaDescribedBy = props['aria-describedby'];
33
33
  var inputProps = assignProps(_objectSpread(_objectSpread({}, propsForElement(other)), {}, {
34
- 'state': errorState ? 'invalid' : 'normal',
34
+ state: errorState ? 'invalid' : 'normal',
35
35
  'aria-invalid': errorState ? true : false,
36
36
  'aria-describedby': meta.active ? errorState ? popperId : ariaDescribedBy : undefined
37
37
  }), input);
@@ -53,7 +53,7 @@ export function FeedbackItem(_ref) {
53
53
  input: inputProps,
54
54
  meta: meta
55
55
  }, other))), /*#__PURE__*/React.createElement(Tooltip.Popper, {
56
- w: "100%",
56
+ w: '100%',
57
57
  id: popperId
58
58
  }, (_meta$error = meta.error) !== null && _meta$error !== void 0 ? _meta$error : lastErrorRef.current));
59
59
  });
@@ -1 +1 @@
1
- {"version":3,"file":"FeedbackItem.js","names":["assignProps","pick","propsForElement","uniqueIDEnhancement","Tooltip","React","Field","deafultTooltipPropsList","FeedbackItem","_ref","Children","tag","uid","_ref$tooltipProps","tooltipProps","tooltipPropsList","props","_objectWithoutProperties","_excluded","lastErrorRef","useRef","undefined","createElement","_ref2","_meta$error","input","meta","other","_excluded2","showError","validateOnBlur","submitFailed","invalid","touched","errorState","popperId","concat","ariaDescribedBy","inputProps","_objectSpread","active","error","current","_extends","visible","theme","placement","flip","fallbackPlacements","Trigger","inline","role","__excludeProps","origin","Popper","w","id","enhance"],"sources":["../../../../src/component/feedback-item/FeedbackItem.tsx"],"sourcesContent":["import { assignProps } from '@semcore/core';\nimport pick from '@semcore/core/lib/utils/pick';\nimport propsForElement from '@semcore/core/lib/utils/propsForElement';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport Tooltip from '@semcore/tooltip';\nimport React from 'react';\nimport { Field } from 'react-final-form';\n\nconst deafultTooltipPropsList = [\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\nexport function FeedbackItem({\n Children,\n tag,\n uid,\n tooltipProps: tooltipPropsList = deafultTooltipPropsList,\n ...props\n}: any) {\n const tooltipProps = pick(props, tooltipPropsList);\n const lastErrorRef = React.useRef(undefined);\n\n return (\n <Field {...props}>\n {({ input, meta, ...other }) => {\n const showError = other.validateOnBlur === false ? meta.submitFailed : true;\n const invalid = meta.invalid && meta.touched;\n const errorState = showError && invalid;\n const popperId = `${uid}-error-description`;\n const ariaDescribedBy = props['aria-describedby'];\n const inputProps = assignProps(\n {\n ...propsForElement(other),\n 'state': errorState ? 'invalid' : 'normal',\n 'aria-invalid': errorState ? true : false,\n 'aria-describedby': meta.active ? (errorState ? popperId : ariaDescribedBy) : undefined,\n },\n input,\n );\n\n if (meta?.error) lastErrorRef.current = meta.error;\n\n return (\n <Tooltip\n visible={errorState && meta.active}\n theme='warning'\n placement='left'\n flip={{\n fallbackPlacements: ['right', 'bottom'],\n }}\n {...tooltipProps}\n >\n <Tooltip.Trigger\n inline={false}\n role={undefined}\n tag={tag}\n {...(tag ? inputProps : {})}\n __excludeProps={['type', 'aria-describedby']}\n >\n {typeof Children.origin === 'function' &&\n Children.origin({\n input: inputProps,\n meta,\n ...other,\n })}\n </Tooltip.Trigger>\n <Tooltip.Popper w='100%' id={popperId}>\n {meta.error ?? lastErrorRef.current}\n </Tooltip.Popper>\n </Tooltip>\n );\n }}\n </Field>\n );\n}\nFeedbackItem.enhance = [uniqueIDEnhancement()];\n"],"mappings":";;;;;AAAA,SAASA,WAAW,QAAQ,eAAe;AAC3C,OAAOC,IAAI,MAAM,8BAA8B;AAC/C,OAAOC,eAAe,MAAM,yCAAyC;AACrE,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,OAAO,MAAM,kBAAkB;AACtC,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,QAAQ,kBAAkB;AAExC,IAAMC,uBAAuB,GAAG,CAC9B,OAAO,EACP,OAAO,EACP,UAAU,EACV,WAAW,EACX,WAAW,EACX,aAAa,EACb,SAAS,EACT,SAAS,EACT,gBAAgB,EAChB,iBAAiB,EACjB,QAAQ,EACR,iBAAiB,EACjB,OAAO,EACP,MAAM,EACN,eAAe,EACf,gBAAgB,EAChB,eAAe,CAChB;AAED,OAAO,SAASC,YAAYA,CAAAC,IAAA,EAMpB;EAAA,IALNC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IACRC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IACHC,GAAG,GAAAH,IAAA,CAAHG,GAAG;IAAAC,iBAAA,GAAAJ,IAAA,CACHK,YAAY;IAAEC,gBAAgB,GAAAF,iBAAA,cAAGN,uBAAuB,GAAAM,iBAAA;IACrDG,KAAK,GAAAC,wBAAA,CAAAR,IAAA,EAAAS,SAAA;EAER,IAAMJ,YAAY,GAAGb,IAAI,CAACe,KAAK,EAAED,gBAAgB,CAAC;EAClD,IAAM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JC,kBAAkB,EAAE,CAAC,OAAO,EAAE,QAAQ;MACxC;IAAE,GACElC,YAAY,gBAEhBT,KAAA,CAAAiB,aAAA,CAAClB,OAAO,CAAC6C,OAAO,EAAAN,QAAA;MACdO,MAAM,EAAE,KAAM;MACdC,IAAI,EAAE9B,SAAU;MAChBV,GAAG,EAAEA;IAAI,GACJA,GAAG,GAAG2B,UAAU,GAAG,CAAC,CAAC;MAC1Bc,cAAc,EAAE,CAAC,MAAM,EAAE,kBAAkB;IAAE,IAE5C,OAAO1C,QAAQ,CAAC2C,MAAM,KAAK,UAAU,IACpC3C,QAAQ,CAAC2C,MAAM,CAAAd,aAAA;MACbd,KAAK,EAAEa,UAAU;MACjBZ,IAAI,EAAJA;IAAI,GACDC,KAAK,CACT,CACY,CAAC,eAClBtB,KAAA,CAAAiB,aAAA,CAAClB,OAAO,CAACkD,MAAM;MAACC,CAAC,EAAC,MAAM;MAACC,EAAE,EAAErB;IAAS,IAAAX,WAAA,GACnCE,IAAI,CAACe,KAAK,cAAAjB,WAAA,cAAAA,WAAA,GAAIL,YAAY,CAACuB,OACd,CACT,CAAC;EAEd,CACK,CAAC;AAEZ;AACAlC,YAAY,CAACiD,OAAO,GAAG,CAACtD,mBAAmB,CAAC,CAAC,CAAC","ignoreList":[]}
1
+ {"version":3,"file":"FeedbackItem.js","names":["React","Field","Tooltip","pick","uniqueIDEnhancement","assignProps","propsForElement","deafultTooltipPropsList","FeedbackItem","_ref","Children","tag","uid","_ref$tooltipProps","tooltipProps","tooltipPropsList","props","_objectWithoutProperties","_excluded","lastErrorRef","useRef","undefined","createElement","_ref2","_meta$error","input","meta","other","_excluded2","showError","validateOnBlur","submitFailed","invalid","touched","errorState","popperId","concat","ariaDescribedBy","inputProps","_objectSpread","state","active","error","current","_extends","visible","theme","placement","flip","fallbackPlacements","Trigger","inline","role","__excludeProps","origin","Popper","w","id","enhance"],"sources":["../../../../src/component/feedback-item/FeedbackItem.tsx"],"sourcesContent":["import React from 'react';\nimport { Field } from 'react-final-form';\nimport Tooltip from '@semcore/tooltip';\nimport pick from '@semcore/utils/lib/pick';\nimport uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';\nimport { assignProps } from '@semcore/utils/lib/core';\nimport propsForElement from '@semcore/utils/lib/propsForElement';\n\nconst deafultTooltipPropsList = [\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\nexport function FeedbackItem({\n Children,\n tag,\n uid,\n tooltipProps: tooltipPropsList = deafultTooltipPropsList,\n ...props\n}: any) {\n const tooltipProps = pick(props, tooltipPropsList);\n const lastErrorRef = React.useRef(undefined);\n\n return (\n <Field {...props}>\n {({ input, meta, ...other }) => {\n const showError = other.validateOnBlur === false ? meta.submitFailed : true;\n const invalid = meta.invalid && meta.touched;\n const errorState = showError && invalid;\n const popperId = `${uid}-error-description`;\n const ariaDescribedBy = props['aria-describedby'];\n const inputProps = assignProps(\n {\n ...propsForElement(other),\n state: errorState ? 'invalid' : 'normal',\n 'aria-invalid': errorState ? true : false,\n 'aria-describedby': meta.active ? (errorState ? popperId : ariaDescribedBy) : undefined,\n },\n input,\n );\n\n if (meta?.error) lastErrorRef.current = meta.error;\n\n return (\n <Tooltip\n visible={errorState && meta.active}\n theme='warning'\n placement='left'\n flip={{\n fallbackPlacements: ['right', 'bottom'],\n }}\n {...tooltipProps}\n >\n <Tooltip.Trigger\n inline={false}\n role={undefined}\n tag={tag}\n {...(tag ? inputProps : {})}\n __excludeProps={['type', 'aria-describedby']}\n >\n {typeof Children.origin === 'function' &&\n Children.origin({\n input: inputProps,\n meta,\n ...other,\n })}\n </Tooltip.Trigger>\n <Tooltip.Popper w={'100%'} id={popperId}>\n {meta.error ?? lastErrorRef.current}\n </Tooltip.Popper>\n </Tooltip>\n );\n }}\n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EAAE,kBAAkB;IAAE,IAE5C,OAAO3C,QAAQ,CAAC4C,MAAM,KAAK,UAAU,IACpC5C,QAAQ,CAAC4C,MAAM,CAAAf,aAAA;MACbd,KAAK,EAAEa,UAAU;MACjBZ,IAAI,EAAJA;IAAI,GACDC,KAAK,EACR,CACY,eAClB3B,KAAA,CAAAsB,aAAA,CAACpB,OAAO,CAACqD,MAAM;MAACC,CAAC,EAAE,MAAO;MAACC,EAAE,EAAEtB;IAAS,IAAAX,WAAA,GACrCE,IAAI,CAACgB,KAAK,cAAAlB,WAAA,cAAAA,WAAA,GAAIL,YAAY,CAACwB,OAAO,CACpB,CACT;EAEd,CAAC,CACK;AAEZ;AACAnC,YAAY,CAACkD,OAAO,GAAG,CAACtD,mBAAmB,EAAE,CAAC"}
@@ -3,76 +3,78 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  import _extends from "@babel/runtime/helpers/extends";
4
4
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
5
5
  import _createClass from "@babel/runtime/helpers/createClass";
6
- import _callSuper from "@babel/runtime/helpers/callSuper";
6
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
7
7
  import _inherits from "@babel/runtime/helpers/inherits";
8
+ import _createSuper from "@babel/runtime/helpers/createSuper";
8
9
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
9
- import { sstyled as _sstyled } from "@semcore/core";
10
+ import { sstyled as _sstyled } from "@semcore/utils/lib/core/index";
10
11
  import { assignProps as _assignProps3 } from "@semcore/core";
11
12
  import { assignProps as _assignProps2 } from "@semcore/core";
12
13
  import { assignProps as _assignProps } from "@semcore/core";
13
- var _excluded = ["header", "submitText", "formConfig", "notificationText", "notificationTitle", "learnMoreLink", "Children", "styles", "forwardRef", "status", "theme", "background", "rating", "visible", "onVisibleChange", "notificationVisible", "onNotificationClose", "getI18nText", "errorFeedbackEmail", "modalWidth", "Illustration", "Notice"];
14
- import { Box, Flex } from '@semcore/base-components';
15
- import { createComponent, Component, sstyled, Root } from '@semcore/core';
16
- import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
17
- import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
14
+ var _excluded = ["header", "submitText", "formConfig", "notificationText", "notificationTitle", "learnMoreLink", "Children", "styles", "forwardRef", "status", "theme", "background", "rating", "visible", "onVisibleChange", "notificationVisible", "onNotificationClose", "getI18nText", "errorFeedbackEmail", "modalWidth"];
15
+ import React from 'react';
16
+ import createComponent, { Component, sstyled, Root } from '@semcore/core';
17
+ import { Field, Form } from 'react-final-form';
18
+ import createFocusDecorator from 'final-form-focus';
19
+ import SpinContainer from '@semcore/spin-container';
20
+ import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
21
+ import uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';
22
+ import Notice from '@semcore/notice';
18
23
  import CheckM from '@semcore/icon/Check/m';
19
24
  import WarnM from '@semcore/icon/Warning/m';
25
+ import { Text } from '@semcore/typography';
20
26
  import FeedbackIllustration from '@semcore/illustration/Feedback';
21
- import Input from '@semcore/input';
22
27
  import Link from '@semcore/link';
28
+ import SliderRating from '../slider-rating/SliderRating';
23
29
  import Modal from '@semcore/modal';
24
- import { default as SemcoreNotice } from '@semcore/notice';
25
- import { NoticeBubbleContainer, NoticeBubbleManager } from '@semcore/notice-bubble';
26
- import SpinContainer from '@semcore/spin-container';
27
30
  import Textarea from '@semcore/textarea';
28
- import { Text } from '@semcore/typography';
29
- import createFocusDecorator from 'final-form-focus';
30
- import React from 'react';
31
- import { Field, Form } from 'react-final-form';
31
+ import { Box, Flex } from '@semcore/flex-box';
32
+ import { FeedbackItem } from '../feedback-item/FeedbackItem';
33
+ import { SubmitButton } from '../submit-button/SubmitButton';
34
+ import CheckboxButton from '../checkbox-button/CheckboxButton';
35
+ import Input from '@semcore/input';
36
+ import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
37
+ import { NoticeBubbleContainer, NoticeBubbleManager } from '@semcore/notice-bubble';
32
38
  /*!__reshadow-styles__:"../../style/feedback-rating.shadow.css"*/
33
- var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SFeedbackRating_13l9c_gg_ ul{margin:0;padding:0;list-style:none}.___SFeedbackRating_13l9c_gg_ li{list-style:none}.___SFeedbackRating_13l9c_gg_ .___SHeader_13l9c_gg_{font-size:var(--intergalactic-fs-300, 16px);line-height:var(--intergalactic-lh-300, 150%);font-weight:var(--intergalactic-bold, 700);margin:var(--intergalactic-spacing-4x, 16px)0;text-align:center}", /*__inner_css_end__*/"13l9c_gg_"),
39
+ var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SFeedbackRating_edx4s_gg_ ul{margin:0;padding:0;list-style:none}.___SFeedbackRating_edx4s_gg_ li{list-style:none}", /*__inner_css_end__*/"edx4s_gg_"),
34
40
  /*__reshadow_css_end__*/
35
41
  {
36
- "__SFeedbackRating": "___SFeedbackRating_13l9c_gg_",
37
- "__SHeader": "___SHeader_13l9c_gg_"
42
+ "__SFeedbackRating": "___SFeedbackRating_edx4s_gg_"
38
43
  });
39
- import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
40
- import CheckboxButton from '../checkbox-button/CheckboxButton';
41
- import { FeedbackItem } from '../feedback-item/FeedbackItem';
42
- import SliderRating from '../slider-rating/SliderRating';
43
- import { SubmitButton } from '../submit-button/SubmitButton';
44
44
  var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
45
+ _inherits(FeedbackRatingRoot, _Component);
46
+ var _super = _createSuper(FeedbackRatingRoot);
45
47
  function FeedbackRatingRoot() {
46
48
  var _this;
47
49
  _classCallCheck(this, FeedbackRatingRoot);
48
50
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
49
51
  args[_key] = arguments[_key];
50
52
  }
51
- _this = _callSuper(this, FeedbackRatingRoot, [].concat(args));
52
- _defineProperty(_this, "state", {
53
+ _this = _super.call.apply(_super, [this].concat(args));
54
+ _defineProperty(_assertThisInitialized(_this), "state", {
53
55
  error: false
54
56
  });
55
- _defineProperty(_this, "manager", new NoticeBubbleManager());
56
- _defineProperty(_this, "focusDecorator", createFocusDecorator());
57
- _defineProperty(_this, "handleChangeRating", function (rating) {
57
+ _defineProperty(_assertThisInitialized(_this), "manager", new NoticeBubbleManager());
58
+ _defineProperty(_assertThisInitialized(_this), "focusDecorator", createFocusDecorator());
59
+ _defineProperty(_assertThisInitialized(_this), "handleChangeRating", function (rating) {
58
60
  if (rating > 0) {
59
61
  _this.asProps.onVisibleChange(true, rating);
60
62
  }
61
63
  });
62
- _defineProperty(_this, "handelCloseModal", function () {
64
+ _defineProperty(_assertThisInitialized(_this), "handelCloseModal", function () {
63
65
  _this.asProps.onVisibleChange(false, _this.asProps.rating);
64
66
  });
65
- _defineProperty(_this, "handleChange", function (fn) {
66
- return function (_value, e) {
67
+ _defineProperty(_assertThisInitialized(_this), "handleChange", function (fn) {
68
+ return function (value, e) {
67
69
  fn(e);
68
70
  };
69
71
  });
70
- _defineProperty(_this, "renderCheckbox", function (config, index) {
72
+ _defineProperty(_assertThisInitialized(_this), "renderCheckbox", function (config, index) {
71
73
  var initialValue = _this.props.initialValues[config.key];
72
74
  return /*#__PURE__*/React.createElement(Field, {
73
75
  name: config.key,
74
76
  initialValue: initialValue,
75
- type: "checkbox",
77
+ type: 'checkbox',
76
78
  key: config.key
77
79
  }, function (_ref7) {
78
80
  var input = _ref7.input;
@@ -86,7 +88,7 @@ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
86
88
  }));
87
89
  });
88
90
  });
89
- _defineProperty(_this, "renderTextField", function (config) {
91
+ _defineProperty(_assertThisInitialized(_this), "renderTextField", function (config) {
90
92
  var _config$description;
91
93
  var initialValue = _this.props.initialValues[config.key];
92
94
  var label = typeof config.label === 'string' ? /*#__PURE__*/React.createElement(Text, {
@@ -95,12 +97,12 @@ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
95
97
  }, config.label) : config.label;
96
98
  var isDescriptionReactFragment = ((_config$description = config.description) === null || _config$description === void 0 ? void 0 : _config$description.type) === React.Fragment;
97
99
  return /*#__PURE__*/React.createElement(Flex, {
98
- key: config.key,
99
100
  direction: "column"
100
101
  }, /*#__PURE__*/React.createElement(Flex, {
101
102
  tag: "label",
102
103
  mt: 4,
103
- htmlFor: config.key
104
+ htmlFor: config.key,
105
+ key: config.key
104
106
  }, label), /*#__PURE__*/React.createElement(FeedbackRating.Item, {
105
107
  name: config.key,
106
108
  validate: config.validate,
@@ -142,8 +144,7 @@ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
142
144
  });
143
145
  return _this;
144
146
  }
145
- _inherits(FeedbackRatingRoot, _Component);
146
- return _createClass(FeedbackRatingRoot, [{
147
+ _createClass(FeedbackRatingRoot, [{
147
148
  key: "headerId",
148
149
  get: function get() {
149
150
  var uid = this.asProps.uid;
@@ -214,7 +215,7 @@ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
214
215
  notificationText = _this$asProps2.notificationText,
215
216
  notificationTitle = _this$asProps2.notificationTitle,
216
217
  learnMoreLink = _this$asProps2.learnMoreLink,
217
- _Children = _this$asProps2.Children,
218
+ Children = _this$asProps2.Children,
218
219
  styles = _this$asProps2.styles,
219
220
  forwardRef = _this$asProps2.forwardRef,
220
221
  status = _this$asProps2.status,
@@ -222,14 +223,12 @@ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
222
223
  background = _this$asProps2.background,
223
224
  rating = _this$asProps2.rating,
224
225
  visible = _this$asProps2.visible,
225
- _onVisibleChange = _this$asProps2.onVisibleChange,
226
+ onVisibleChange = _this$asProps2.onVisibleChange,
226
227
  notificationVisible = _this$asProps2.notificationVisible,
227
228
  onNotificationClose = _this$asProps2.onNotificationClose,
228
229
  getI18nText = _this$asProps2.getI18nText,
229
230
  errorFeedbackEmail = _this$asProps2.errorFeedbackEmail,
230
231
  modalWidth = _this$asProps2.modalWidth,
231
- Illustration = _this$asProps2.Illustration,
232
- NoticeComponent = _this$asProps2.Notice,
233
232
  other = _objectWithoutProperties(_this$asProps2, _excluded);
234
233
  var SFeedbackRating = Modal;
235
234
  var checkboxFields = formConfig.filter(function (item) {
@@ -239,29 +238,30 @@ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
239
238
  return item.type === 'textarea' || item.type === 'input' || item.type === 'email';
240
239
  });
241
240
  var notificationId = this.getNoticeTextId();
242
- return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(Box, _assignProps2({}, _ref2), /*#__PURE__*/React.createElement(NoticeComponent, _ref4.cn("NoticeComponent", {
241
+ return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(Box, _assignProps2({}, _ref2), /*#__PURE__*/React.createElement(Notice, _ref4.cn("Notice", {
243
242
  "visible": notificationVisible,
244
243
  "aria-label": getI18nText('leaveFeedback'),
245
244
  "tag": Flex,
246
245
  "alignItems": notificationTitle ? 'flex-start' : 'center'
247
- }), /*#__PURE__*/React.createElement(NoticeComponent.Label, {
246
+ }), /*#__PURE__*/React.createElement(Notice.Label, {
248
247
  mr: 3,
249
248
  "aria-hidden": true
250
- }, /*#__PURE__*/React.createElement(Illustration, _ref4.cn("Illustration", {}))), /*#__PURE__*/React.createElement(NoticeComponent.Content, null, notificationTitle ? /*#__PURE__*/React.createElement(NoticeComponent.Title, null, notificationTitle) : null, /*#__PURE__*/React.createElement(NoticeComponent.Text, {
251
- gap: 3,
249
+ }, /*#__PURE__*/React.createElement(FeedbackIllustration, _ref4.cn("FeedbackIllustration", {}))), /*#__PURE__*/React.createElement(Notice.Content, null, notificationTitle ? /*#__PURE__*/React.createElement(Notice.Title, null, notificationTitle) : null, /*#__PURE__*/React.createElement(Notice.Text, {
252
250
  tag: Flex,
253
251
  alignItems: notificationTitle ? 'flex-start' : 'center'
254
252
  }, /*#__PURE__*/React.createElement(Text, _ref4.cn("Text", {
253
+ "mr": 3,
255
254
  "id": notificationId
256
- }), notificationText), /*#__PURE__*/React.createElement(NoticeComponent.Actions, {
255
+ }), notificationText), /*#__PURE__*/React.createElement(Notice.Actions, {
257
256
  mt: 0
258
257
  }, /*#__PURE__*/React.createElement(SliderRating, _ref4.cn("SliderRating", {
259
258
  "value": rating,
260
259
  "onChange": this.handleChangeRating,
261
260
  "aria-labelledby": notificationId
262
261
  }))), learnMoreLink && /*#__PURE__*/React.createElement(Link, _ref4.cn("Link", {
262
+ "ml": 3,
263
263
  "href": learnMoreLink
264
- }), getI18nText('learnMore')))), /*#__PURE__*/React.createElement(NoticeComponent.Close, {
264
+ }), getI18nText('learnMore')))), /*#__PURE__*/React.createElement(Notice.Close, {
265
265
  onClick: onNotificationClose
266
266
  })), /*#__PURE__*/React.createElement(SFeedbackRating, _ref4.cn("SFeedbackRating", _objectSpread({}, _assignProps({
267
267
  "visible": visible,
@@ -307,11 +307,11 @@ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
307
307
  return _this3.renderCheckbox(formConfigItem, index);
308
308
  })), textFields.map(function (formConfigItem) {
309
309
  return _this3.renderTextField(formConfigItem);
310
- }), _this3.state.error && /*#__PURE__*/React.createElement(SemcoreNotice, _ref5.cn("SemcoreNotice", {
310
+ }), _this3.state.error && /*#__PURE__*/React.createElement(Notice, _ref5.cn("Notice", {
311
311
  "theme": 'warning',
312
312
  "mt": 4,
313
313
  "mb": 4
314
- }), /*#__PURE__*/React.createElement(SemcoreNotice.Label, null, /*#__PURE__*/React.createElement(WarnM, _ref5.cn("WarnM", {}))), /*#__PURE__*/React.createElement(SemcoreNotice.Content, null, getI18nText('errorMessage', {
314
+ }), /*#__PURE__*/React.createElement(Notice.Label, null, /*#__PURE__*/React.createElement(WarnM, _ref5.cn("WarnM", {}))), /*#__PURE__*/React.createElement(Notice.Content, null, getI18nText('errorMessage', {
315
315
  // todo: Brauer Ilia - think how to fix type
316
316
  // @ts-ignore
317
317
  email: /*#__PURE__*/React.createElement(Link, _ref5.cn("Link", {
@@ -322,13 +322,14 @@ var FeedbackRatingRoot = /*#__PURE__*/function (_Component) {
322
322
  "justifyContent": 'center'
323
323
  }), /*#__PURE__*/React.createElement(FeedbackRating.Submit, {
324
324
  loading: status !== 'loading' ? api.submitting : status === 'loading',
325
- size: "l"
325
+ size: 'l'
326
326
  }, submitText !== null && submitText !== void 0 ? submitText : getI18nText('submitButton')))));
327
327
  })), /*#__PURE__*/React.createElement(NoticeBubbleContainer, _ref4.cn("NoticeBubbleContainer", {
328
328
  "manager": this.manager
329
329
  })));
330
330
  }
331
331
  }]);
332
+ return FeedbackRatingRoot;
332
333
  }(Component);
333
334
  _defineProperty(FeedbackRatingRoot, "displayName", 'FeedbackRatingForm');
334
335
  _defineProperty(FeedbackRatingRoot, "style", style);
@@ -336,9 +337,7 @@ _defineProperty(FeedbackRatingRoot, "enhance", [i18nEnhance(localizedMessages),
336
337
  _defineProperty(FeedbackRatingRoot, "defaultProps", {
337
338
  onSubmit: function onSubmit() {},
338
339
  i18n: localizedMessages,
339
- locale: 'en',
340
- Illustration: FeedbackIllustration,
341
- Notice: SemcoreNotice
340
+ locale: 'en'
342
341
  });
343
342
  _defineProperty(FeedbackRatingRoot, "validate", {
344
343
  description: function description(error) {
@@ -364,8 +363,14 @@ function Header(props) {
364
363
  var _ref3 = arguments[0],
365
364
  _ref6;
366
365
  var styles = props.styles;
367
- var SHeader = Modal.Title;
368
- return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SHeader, _ref6.cn("SHeader", _objectSpread({}, _assignProps3({}, _ref3))));
366
+ var SHeader = Text;
367
+ return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SHeader, _ref6.cn("SHeader", _objectSpread({}, _assignProps3({
368
+ "size": 300,
369
+ "tag": 'h2',
370
+ "mb": 4,
371
+ "mt": 4,
372
+ "textAlign": 'center'
373
+ }, _ref3))));
369
374
  }
370
375
  var FeedbackRating = createComponent(FeedbackRatingRoot, {
371
376
  Header: Header,