@semcore/feedback-form 17.2.1 → 17.2.2-prerelease.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.
Files changed (84) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/lib/cjs/FeedbackForm.js +9 -11
  3. package/lib/cjs/FeedbackForm.js.map +1 -1
  4. package/lib/cjs/FeedbackForm.type.js +2 -0
  5. package/lib/cjs/FeedbackForm.type.js.map +1 -0
  6. package/lib/cjs/{component/feedback-rating/FeedbackRating.js → FeedbackRating.js} +11 -12
  7. package/lib/cjs/FeedbackRating.js.map +1 -0
  8. package/lib/cjs/FeedbackRating.type.js.map +1 -0
  9. package/lib/cjs/component/checkbox-button/CheckboxButton.js +3 -3
  10. package/lib/cjs/component/checkbox-button/CheckboxButton.js.map +1 -1
  11. package/lib/cjs/component/checkbox-button/CheckboxButton.type.js +2 -0
  12. package/lib/cjs/component/checkbox-button/CheckboxButton.type.js.map +1 -0
  13. package/lib/cjs/component/feedback-item/FeedbackItem.js +26 -22
  14. package/lib/cjs/component/feedback-item/FeedbackItem.js.map +1 -1
  15. package/lib/cjs/component/feedback-item/FeedbackItem.type.js +2 -0
  16. package/lib/cjs/component/feedback-item/FeedbackItem.type.js.map +1 -0
  17. package/lib/cjs/component/slider-rating/SliderRating.js +6 -6
  18. package/lib/cjs/component/slider-rating/SliderRating.js.map +1 -1
  19. package/lib/cjs/component/slider-rating/SliderRating.type.js +2 -0
  20. package/lib/cjs/component/slider-rating/SliderRating.type.js.map +1 -0
  21. package/lib/cjs/component/submit-button/SubmitButton.js.map +1 -1
  22. package/lib/cjs/component/submit-button/SubmitButton.type.js +2 -0
  23. package/lib/cjs/component/submit-button/SubmitButton.type.js.map +1 -0
  24. package/lib/cjs/index.js +16 -1
  25. package/lib/cjs/index.js.map +1 -1
  26. package/lib/es6/FeedbackForm.js +9 -11
  27. package/lib/es6/FeedbackForm.js.map +1 -1
  28. package/lib/es6/FeedbackForm.type.js +2 -0
  29. package/lib/es6/FeedbackForm.type.js.map +1 -0
  30. package/lib/es6/{component/feedback-rating/FeedbackRating.js → FeedbackRating.js} +11 -12
  31. package/lib/es6/FeedbackRating.js.map +1 -0
  32. package/lib/es6/FeedbackRating.type.js.map +1 -0
  33. package/lib/es6/component/checkbox-button/CheckboxButton.js +3 -3
  34. package/lib/es6/component/checkbox-button/CheckboxButton.js.map +1 -1
  35. package/lib/es6/component/checkbox-button/CheckboxButton.type.js +2 -0
  36. package/lib/es6/component/checkbox-button/CheckboxButton.type.js.map +1 -0
  37. package/lib/es6/component/feedback-item/FeedbackItem.js +26 -22
  38. package/lib/es6/component/feedback-item/FeedbackItem.js.map +1 -1
  39. package/lib/es6/component/feedback-item/FeedbackItem.type.js +2 -0
  40. package/lib/es6/component/feedback-item/FeedbackItem.type.js.map +1 -0
  41. package/lib/es6/component/slider-rating/SliderRating.js +6 -6
  42. package/lib/es6/component/slider-rating/SliderRating.js.map +1 -1
  43. package/lib/es6/component/slider-rating/SliderRating.type.js +2 -0
  44. package/lib/es6/component/slider-rating/SliderRating.type.js.map +1 -0
  45. package/lib/es6/component/submit-button/SubmitButton.js.map +1 -1
  46. package/lib/es6/component/submit-button/SubmitButton.type.js +2 -0
  47. package/lib/es6/component/submit-button/SubmitButton.type.js.map +1 -0
  48. package/lib/es6/index.js +2 -1
  49. package/lib/es6/index.js.map +1 -1
  50. package/lib/esm/FeedbackForm.mjs +10 -12
  51. package/lib/esm/FeedbackForm.type.mjs +1 -0
  52. package/lib/esm/{component/feedback-rating/FeedbackRating.mjs → FeedbackRating.mjs} +11 -13
  53. package/lib/esm/component/checkbox-button/CheckboxButton.mjs +4 -4
  54. package/lib/esm/component/feedback-item/FeedbackItem.mjs +26 -23
  55. package/lib/esm/component/slider-rating/SliderRating.mjs +7 -7
  56. package/lib/esm/index.mjs +2 -1
  57. package/lib/types/FeedbackForm.d.ts +8 -0
  58. package/lib/types/FeedbackForm.type.d.ts +53 -0
  59. package/lib/types/FeedbackRating.d.ts +8 -0
  60. package/lib/types/FeedbackRating.type.d.ts +93 -0
  61. package/lib/types/component/checkbox-button/CheckboxButton.d.ts +2 -2
  62. package/lib/types/component/checkbox-button/CheckboxButton.type.d.ts +11 -0
  63. package/lib/types/component/feedback-item/FeedbackItem.d.ts +5 -1
  64. package/lib/types/component/feedback-item/FeedbackItem.type.d.ts +22 -0
  65. package/lib/types/component/slider-rating/SliderRating.d.ts +2 -14
  66. package/lib/types/component/slider-rating/SliderRating.type.d.ts +28 -0
  67. package/lib/types/component/submit-button/SubmitButton.d.ts +3 -2
  68. package/lib/types/component/submit-button/SubmitButton.type.d.ts +5 -0
  69. package/lib/types/index.d.ts +3 -39
  70. package/package.json +6 -6
  71. package/vite.config.ts +1 -1
  72. package/vitest.config.mts +1 -1
  73. package/lib/cjs/component/feedback-rating/FeedbackRating.js.map +0 -1
  74. package/lib/cjs/component/feedback-rating/FeedbackRating.type.js.map +0 -1
  75. package/lib/cjs/index.d.js +0 -14
  76. package/lib/cjs/index.d.js.map +0 -1
  77. package/lib/es6/component/feedback-rating/FeedbackRating.js.map +0 -1
  78. package/lib/es6/component/feedback-rating/FeedbackRating.type.js.map +0 -1
  79. package/lib/es6/index.d.js +0 -3
  80. package/lib/es6/index.d.js.map +0 -1
  81. package/lib/types/component/feedback-rating/FeedbackRating.d.ts +0 -61
  82. package/lib/types/component/feedback-rating/FeedbackRating.type.d.ts +0 -73
  83. /package/lib/cjs/{component/feedback-rating/FeedbackRating.type.js → FeedbackRating.type.js} +0 -0
  84. /package/lib/es6/{component/feedback-rating/FeedbackRating.type.js → FeedbackRating.type.js} +0 -0
@@ -15,17 +15,17 @@ const style = (
15
15
  /*__reshadow_css_start__*/
16
16
  (sstyled.insert(
17
17
  /*__inner_css_start__*/
18
- `.___SFeedbackForm_18v1z_gg_{max-width:320px}.___SCancel_18v1z_gg_,.___SSubmit_18v1z_gg_{display:inline-flex;margin-right:var(--intergalactic-spacing-2x,8px)}.___SNotice_18v1z_gg_{padding:var(--intergalactic-spacing-3x,12px) var(--intergalactic-spacing-4x,16px);border-width:1px 0 0;border-top-style:solid;border-radius:0 0 var(--intergalactic-surface-rounded,8px) var(--intergalactic-surface-rounded,8px)}.___SSuccess_18v1z_gg_{display:flex;align-items:center;flex-direction:column;width:320px;padding:var(--intergalactic-spacing-10x,40px);box-sizing:border-box;outline-color:#0000}.___SEmail_18v1z_gg_{margin-bottom:calc(var(--intergalactic-spacing-4x, 16px));width:80px;height:80px;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' fill='none' viewBox='0 0 80 80'%3E%3Cpath fill='%2345e0a8' d='M28.163 6a1.57 1.57 0 0 0-1.12.46l-12.91 12.92A34.6 34.6 0 0 0 25.36 75.813a34.6 34.6 0 0 0 37.713-7.503l12.91-12.91a1.58 1.58 0 0 0 .47-1.12V6.89a.9.9 0 0 0-.9-.89z'/%3E%3Cpath fill='%23fff' d='m29 45.285.2.35c6.19-3.45 24.19-13.67 27.53-10.53-1.13-3.1-17.03.33-27.73 10.18M28.44 31.634c-1.81 6-9.21 24.47-13.44 30.31l3 .91 1.58-1.32c4.22-9.55 10-26 10.31-31.46-.5-.26-.96.14-1.45 1.56'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M15 62.008c4.23-5.84 11.63-24.27 13.44-30.34s5.05 6 3.23 11.12'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M28 45.942c10.68-10.36 27.27-14 28.43-10.84.69 1.89-13.43 6.26-18.41 12.32'/%3E%3Cpath fill='%23fff' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M44.45 21.93c-3.24-1.16-8.59-2.89-11.45-3.69 4.12-1.83 37-14 39.67-15.24-.92 4.11-4.92 18.28-6.71 24.93-4.83-1.68-9.73-3.15-12.93-4.19-2 2.65-3.808 5.441-5.41 8.35-1.18-3.86-2.33-8.32-3.17-10.16'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M45 22.08 61.74 11M53 23.73 72.64 3M48 32.58 55.86 25'/%3E%3Cpath fill='%23000' d='m48.23 30.77 3.46-5.64.97-1.13 2.07.61.43-.13-3.36 3.43-2.47 2.27L48 31.29z'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M33.81 22 23 27.12M40.89 23 34 27.37M62.04 29 58 38.85'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M46.68 41c3.61 2.42-1.87 8.52-3.68 10.12'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M47.17 44c4.14 2.09 1.16 7.76-1.17 10.6'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M48.86 49C54.37 53.48 36.31 72.72 35 73.78'/%3E%3Cmask id='a' width='73' height='73' x='4' y='6' maskUnits='userSpaceOnUse' style='mask-type:alpha'%3E%3Cpath fill='%2345dfa7' d='M28.163 6a1.57 1.57 0 0 0-1.12.46l-12.91 12.92A34.6 34.6 0 0 0 25.36 75.813a34.6 34.6 0 0 0 37.713-7.503l12.91-12.91a1.58 1.58 0 0 0 .47-1.12V6.89a.9.9 0 0 0-.9-.89z'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Cpath fill='%23000' d='M5 74.687c2.49-2.34 8.24-11 9.52-13.44 13.66-2.12 20.19 10 20.46 13.52a116 116 0 0 1-7.76 14.13'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M5 74.687c2.49-2.34 8.24-11 9.52-13.44 13.66-2.12 20.19 10 20.46 13.52a116 116 0 0 1-7.76 14.13'/%3E%3C/g%3E%3C/svg%3E")}`,
18
+ `.___SFeedbackForm_183nj_gg_{max-width:320px}.___SCancel_183nj_gg_,.___SSubmit_183nj_gg_{display:inline-flex;margin-right:var(--intergalactic-spacing-2x,8px)}.___SNotice_183nj_gg_{padding:var(--intergalactic-spacing-3x,12px) var(--intergalactic-spacing-4x,16px);border-width:1px 0 0;border-top-style:solid;border-radius:0 0 var(--intergalactic-surface-rounded,8px) var(--intergalactic-surface-rounded,8px)}.___SSuccess_183nj_gg_{display:flex;align-items:center;flex-direction:column;width:320px;padding:var(--intergalactic-spacing-10x,40px);box-sizing:border-box;outline-color:#0000}.___SEmail_183nj_gg_{margin-bottom:calc(var(--intergalactic-spacing-4x, 16px));width:80px;height:80px;background-image:url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' fill='none' viewBox='0 0 80 80'%3E%3Cpath fill='%2345e0a8' d='M28.163 6a1.57 1.57 0 0 0-1.12.46l-12.91 12.92A34.6 34.6 0 0 0 25.36 75.813a34.6 34.6 0 0 0 37.713-7.503l12.91-12.91a1.58 1.58 0 0 0 .47-1.12V6.89a.9.9 0 0 0-.9-.89z'/%3E%3Cpath fill='%23fff' d='m29 45.285.2.35c6.19-3.45 24.19-13.67 27.53-10.53-1.13-3.1-17.03.33-27.73 10.18M28.44 31.634c-1.81 6-9.21 24.47-13.44 30.31l3 .91 1.58-1.32c4.22-9.55 10-26 10.31-31.46-.5-.26-.96.14-1.45 1.56'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M15 62.008c4.23-5.84 11.63-24.27 13.44-30.34s5.05 6 3.23 11.12'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M28 45.942c10.68-10.36 27.27-14 28.43-10.84.69 1.89-13.43 6.26-18.41 12.32'/%3E%3Cpath fill='%23fff' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M44.45 21.93c-3.24-1.16-8.59-2.89-11.45-3.69 4.12-1.83 37-14 39.67-15.24-.92 4.11-4.92 18.28-6.71 24.93-4.83-1.68-9.73-3.15-12.93-4.19-2 2.65-3.808 5.441-5.41 8.35-1.18-3.86-2.33-8.32-3.17-10.16'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M45 22.08 61.74 11M53 23.73 72.64 3M48 32.58 55.86 25'/%3E%3Cpath fill='%23000' d='m48.23 30.77 3.46-5.64.97-1.13 2.07.61.43-.13-3.36 3.43-2.47 2.27L48 31.29z'/%3E%3Cpath stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M33.81 22 23 27.12M40.89 23 34 27.37M62.04 29 58 38.85'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M46.68 41c3.61 2.42-1.87 8.52-3.68 10.12'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M47.17 44c4.14 2.09 1.16 7.76-1.17 10.6'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M48.86 49C54.37 53.48 36.31 72.72 35 73.78'/%3E%3Cmask id='a' width='73' height='73' x='4' y='6' maskUnits='userSpaceOnUse' style='mask-type:alpha'%3E%3Cpath fill='%2345dfa7' d='M28.163 6a1.57 1.57 0 0 0-1.12.46l-12.91 12.92A34.6 34.6 0 0 0 25.36 75.813a34.6 34.6 0 0 0 37.713-7.503l12.91-12.91a1.58 1.58 0 0 0 .47-1.12V6.89a.9.9 0 0 0-.9-.89z'/%3E%3C/mask%3E%3Cg mask='url(%23a)'%3E%3Cpath fill='%23000' d='M5 74.687c2.49-2.34 8.24-11 9.52-13.44 13.66-2.12 20.19 10 20.46 13.52a116 116 0 0 1-7.76 14.13'/%3E%3Cpath stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='.75' d='M5 74.687c2.49-2.34 8.24-11 9.52-13.44 13.66-2.12 20.19 10 20.46 13.52a116 116 0 0 1-7.76 14.13'/%3E%3C/g%3E%3C/svg%3E")}`,
19
19
  /*__inner_css_end__*/
20
- "18v1z_gg_"
20
+ "183nj_gg_"
21
21
  ), /*__reshadow_css_end__*/
22
22
  {
23
- "__SFeedbackForm": "___SFeedbackForm_18v1z_gg_",
24
- "__SSubmit": "___SSubmit_18v1z_gg_",
25
- "__SCancel": "___SCancel_18v1z_gg_",
26
- "__SNotice": "___SNotice_18v1z_gg_",
27
- "__SSuccess": "___SSuccess_18v1z_gg_",
28
- "__SEmail": "___SEmail_18v1z_gg_"
23
+ "__SFeedbackForm": "___SFeedbackForm_183nj_gg_",
24
+ "__SSubmit": "___SSubmit_183nj_gg_",
25
+ "__SCancel": "___SCancel_183nj_gg_",
26
+ "__SNotice": "___SNotice_183nj_gg_",
27
+ "__SSuccess": "___SSuccess_183nj_gg_",
28
+ "__SEmail": "___SEmail_183nj_gg_"
29
29
  })
30
30
  );
31
31
  class FeedbackForm extends Component {
@@ -131,14 +131,12 @@ function Notice(props) {
131
131
  var _ref3 = arguments[0], _ref7;
132
132
  const {
133
133
  styles,
134
- theme = "muted",
135
- use = "secondary"
134
+ theme = "muted"
136
135
  } = props;
137
136
  const SNotice = NoticeSmart;
138
137
  return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SNotice, _ref7.cn("SNotice", {
139
138
  ...assignProps({
140
- "use:theme": theme,
141
- "use:use": use
139
+ "use:theme": theme
142
140
  }, _ref3)
143
141
  }));
144
142
  }
@@ -0,0 +1 @@
1
+
@@ -18,23 +18,23 @@ import { Text } from "@semcore/typography";
18
18
  import createFocusDecorator from "final-form-focus";
19
19
  import React from "react";
20
20
  import { Field, Form } from "react-final-form";
21
- import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
22
- import CheckboxButton from "../checkbox-button/CheckboxButton.mjs";
23
- import { FeedbackItem } from "../feedback-item/FeedbackItem.mjs";
24
- import SliderRating from "../slider-rating/SliderRating.mjs";
25
- import { SubmitButton } from "../submit-button/SubmitButton.mjs";
26
- /*!__reshadow-styles__:"../../style/feedback-rating.shadow.css"*/
21
+ import CheckboxButton from "./component/checkbox-button/CheckboxButton.mjs";
22
+ import { FeedbackItem } from "./component/feedback-item/FeedbackItem.mjs";
23
+ import SliderRating from "./component/slider-rating/SliderRating.mjs";
24
+ import { SubmitButton } from "./component/submit-button/SubmitButton.mjs";
25
+ import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
26
+ /*!__reshadow-styles__:"./style/feedback-rating.shadow.css"*/
27
27
  const style = (
28
28
  /*__reshadow_css_start__*/
29
29
  (sstyled.insert(
30
30
  /*__inner_css_start__*/
31
- ".___SFeedbackRating_yl2ph_gg_ ul{margin:0;padding:0}.___SFeedbackRating_yl2ph_gg_ :is(li,ul){list-style:none}.___SFeedbackRating_yl2ph_gg_ .___SHeader_yl2ph_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}",
31
+ ".___SFeedbackRating_166mb_gg_ ul{margin:0;padding:0}.___SFeedbackRating_166mb_gg_ :is(li,ul){list-style:none}.___SFeedbackRating_166mb_gg_ .___SHeader_166mb_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}",
32
32
  /*__inner_css_end__*/
33
- "yl2ph_gg_"
33
+ "166mb_gg_"
34
34
  ), /*__reshadow_css_end__*/
35
35
  {
36
- "__SFeedbackRating": "___SFeedbackRating_yl2ph_gg_",
37
- "__SHeader": "___SHeader_yl2ph_gg_"
36
+ "__SFeedbackRating": "___SFeedbackRating_166mb_gg_",
37
+ "__SHeader": "___SHeader_166mb_gg_"
38
38
  })
39
39
  );
40
40
  class FeedbackRatingRoot extends Component {
@@ -68,7 +68,7 @@ class FeedbackRatingRoot extends Component {
68
68
  }) => /* @__PURE__ */ React.createElement(FeedbackRating.Checkbox, _extends({}, input, {
69
69
  id: config.key,
70
70
  label: config.label,
71
- onChange: (_checked, e) => input.onChange(e),
71
+ onChange: (_, e) => input.onChange(e),
72
72
  focused: index === 0
73
73
  })));
74
74
  });
@@ -281,8 +281,6 @@ class FeedbackRatingRoot extends Component {
281
281
  "mt": 4,
282
282
  "mb": 4
283
283
  }), /* @__PURE__ */ React.createElement(SemcoreNotice.Label, null, /* @__PURE__ */ React.createElement(WarnM, _ref5.cn("WarnM", {}))), /* @__PURE__ */ React.createElement(SemcoreNotice.Content, null, getI18nText("errorMessage", {
284
- // todo: Brauer Ilia - think how to fix type
285
- // @ts-ignore
286
284
  email: /* @__PURE__ */ React.createElement(Link, _ref5.cn("Link", {
287
285
  "href": `mailto:${errorFeedbackEmail}`
288
286
  }), errorFeedbackEmail)
@@ -8,13 +8,13 @@ const style = (
8
8
  /*__reshadow_css_start__*/
9
9
  (sstyled.insert(
10
10
  /*__inner_css_start__*/
11
- ".___SCheckboxButton_11m4t_gg_{margin-top:var(--intergalactic-spacing-2x,8px);border:1px solid var(--intergalactic-border-primary,#000c0829);border-radius:var(--intergalactic-rounded-medium,6px)}@media (color-gamut:p3){.___SCheckboxButton_11m4t_gg_{border:1px solid var(--intergalactic-border-primary,oklch(.137 .026 175.7/.161))}}.___SCheckboxButton_11m4t_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x,12px);box-sizing:border-box}.___SCheckboxButton_11m4t_gg_.__checked_11m4t_gg_{cursor:pointer;border-color:var(--intergalactic-border-info-active,oklch(.7 .131 275.2));background-color:#008ff81a}@media (hover:hover){.___SCheckboxButton_11m4t_gg_:hover{cursor:pointer;border-color:var(--intergalactic-border-info-active,oklch(.7 .131 275.2));background-color:#008ff81a}.___SCheckboxButton_11m4t_gg_.__checked_11m4t_gg_:hover{background-color:#008ff833}}",
11
+ ".___SCheckboxButton_14mjy_gg_{margin-top:var(--intergalactic-spacing-2x,8px);border:1px solid var(--intergalactic-border-primary,#000c0829);border-radius:var(--intergalactic-rounded-medium,6px)}@media (color-gamut:p3){.___SCheckboxButton_14mjy_gg_{border:1px solid var(--intergalactic-border-primary,oklch(.137 .026 175.7/.161))}}.___SCheckboxButton_14mjy_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x,12px);box-sizing:border-box}.___SCheckboxButton_14mjy_gg_.__checked_14mjy_gg_{cursor:pointer;border-color:var(--intergalactic-border-info-active,oklch(.7 .131 275.2));background-color:#008ff81a}@media (hover:hover){.___SCheckboxButton_14mjy_gg_:hover{cursor:pointer;border-color:var(--intergalactic-border-info-active,oklch(.7 .131 275.2));background-color:#008ff81a}.___SCheckboxButton_14mjy_gg_.__checked_14mjy_gg_:hover{background-color:#008ff833}}",
12
12
  /*__inner_css_end__*/
13
- "11m4t_gg_"
13
+ "14mjy_gg_"
14
14
  ), /*__reshadow_css_end__*/
15
15
  {
16
- "__SCheckboxButton": "___SCheckboxButton_11m4t_gg_",
17
- "_checked": "__checked_11m4t_gg_"
16
+ "__SCheckboxButton": "___SCheckboxButton_14mjy_gg_",
17
+ "_checked": "__checked_14mjy_gg_"
18
18
  })
19
19
  );
20
20
  class CheckboxButtonRoot extends Component {
@@ -33,29 +33,32 @@ function FeedbackItem({
33
33
  "aria-describedby": meta.active ? errorState ? popperId : ariaDescribedBy : void 0
34
34
  }, input);
35
35
  if (meta?.error) lastErrorRef.current = meta.error;
36
- return /* @__PURE__ */ React.createElement(Tooltip, _extends({
37
- visible: errorState && meta.active,
38
- theme: "warning",
39
- placement: "left",
40
- flip: {
41
- fallbackPlacements: ["right", "bottom"]
42
- }
43
- }, tooltipProps), /* @__PURE__ */ React.createElement(Tooltip.Trigger, _extends({
44
- inline: false,
45
- role: void 0,
46
- tag
47
- }, tag ? inputProps : {}, {
48
- __excludeProps: ["type", "aria-describedby"],
49
- onKeyDown: () => false
50
- // as this is controlled tooltip, we shouldn't stopPropagation for keyboard Escape events.
51
- }), typeof Children.origin === "function" && Children.origin({
52
- input: inputProps,
53
- meta,
54
- ...other
55
- })), /* @__PURE__ */ React.createElement(Tooltip.Popper, {
56
- w: "100%",
57
- id: popperId
58
- }, meta.error ?? lastErrorRef.current));
36
+ return (
37
+ // @ts-ignore
38
+ /* @__PURE__ */ React.createElement(Tooltip, _extends({
39
+ visible: errorState && meta.active,
40
+ theme: "warning",
41
+ placement: "left",
42
+ flip: {
43
+ fallbackPlacements: ["right", "bottom"]
44
+ }
45
+ }, tooltipProps), /* @__PURE__ */ React.createElement(Tooltip.Trigger, _extends({
46
+ inline: false,
47
+ role: void 0,
48
+ tag
49
+ }, tag ? inputProps : {}, {
50
+ __excludeProps: ["type", "aria-describedby"],
51
+ onKeyDown: () => false
52
+ // as this is controlled tooltip, we shouldn't stopPropagation for keyboard Escape events.
53
+ }), typeof Children.origin === "function" && Children.origin({
54
+ input: inputProps,
55
+ meta,
56
+ ...other
57
+ })), /* @__PURE__ */ React.createElement(Tooltip.Popper, {
58
+ w: "100%",
59
+ id: popperId
60
+ }, meta.error ?? lastErrorRef.current))
61
+ );
59
62
  });
60
63
  }
61
64
  FeedbackItem.enhance = [uniqueIDEnhancement()];
@@ -10,16 +10,16 @@ const style = (
10
10
  /*__reshadow_css_start__*/
11
11
  (sstyled.insert(
12
12
  /*__inner_css_start__*/
13
- ".___SSliderRating_kfmw6_gg_ .___SStar_kfmw6_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}.___SSliderRating_kfmw6_gg_:focus-visible .___SStar_kfmw6_gg_.__hovered_kfmw6_gg_{cursor:pointer;transform:scale(1.3)}@media (hover:hover){.___SSliderRating_kfmw6_gg_ .___SStar_kfmw6_gg_:hover{cursor:pointer;transform:scale(1.3)}.___SSliderRating_kfmw6_gg_.__readonly_kfmw6_gg_ .___SStar_kfmw6_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_kfmw6_gg_.__filled_kfmw6_gg_:active{animation:wobble .8s ease-in-out}.___SStar_kfmw6_gg_ path{fill:var(--intergalactic-slider-rating-normal,oklch(.7 .003 162.2))}.___SStar_kfmw6_gg_.__filled_kfmw6_gg_ path{stroke-width:0;fill:var(--intergalactic-slider-rating-hover-active,oklch(.66 .212 300.1))}",
13
+ ".___SSliderRating_1pies_gg_ .___SStar_1pies_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}.___SSliderRating_1pies_gg_:focus-visible .___SStar_1pies_gg_.__hovered_1pies_gg_{cursor:pointer;transform:scale(1.3)}@media (hover:hover){.___SSliderRating_1pies_gg_ .___SStar_1pies_gg_:hover{cursor:pointer;transform:scale(1.3)}.___SSliderRating_1pies_gg_.__readonly_1pies_gg_ .___SStar_1pies_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_1pies_gg_.__filled_1pies_gg_:active{animation:wobble .8s ease-in-out}.___SStar_1pies_gg_ path{fill:var(--intergalactic-slider-rating-normal,oklch(.7 .003 162.2))}.___SStar_1pies_gg_.__filled_1pies_gg_ path{stroke-width:0;fill:var(--intergalactic-slider-rating-hover-active,oklch(.66 .212 300.1))}",
14
14
  /*__inner_css_end__*/
15
- "kfmw6_gg_"
15
+ "1pies_gg_"
16
16
  ), /*__reshadow_css_end__*/
17
17
  {
18
- "__SSliderRating": "___SSliderRating_kfmw6_gg_",
19
- "__SStar": "___SStar_kfmw6_gg_",
20
- "_hovered": "__hovered_kfmw6_gg_",
21
- "_readonly": "__readonly_kfmw6_gg_",
22
- "_filled": "__filled_kfmw6_gg_"
18
+ "__SSliderRating": "___SSliderRating_1pies_gg_",
19
+ "__SStar": "___SStar_1pies_gg_",
20
+ "_hovered": "__hovered_1pies_gg_",
21
+ "_readonly": "__readonly_1pies_gg_",
22
+ "_filled": "__filled_1pies_gg_"
23
23
  })
24
24
  );
25
25
  const MIN = 1;
package/lib/esm/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { default as default2 } from "./component/feedback-rating/FeedbackRating.mjs";
1
+ import { default as default2 } from "./FeedbackRating.mjs";
2
2
  import { default as default3 } from "./FeedbackForm.mjs";
3
+ import "./FeedbackForm.type.mjs";
3
4
  export {
4
5
  default2 as FeedbackRating,
5
6
  default3 as default
@@ -0,0 +1,8 @@
1
+ import type { NSFeedbackForm } from './FeedbackForm.type';
2
+ /**
3
+ * FeedbackForm
4
+ *
5
+ * {@link https://developer.semrush.com/intergalactic/components/feedback-form/feedback-form-api/|API} | {@link https://developer.semrush.com/intergalactic/components/feedback-form/feedback-form-code/|Examples}
6
+ */
7
+ declare const _default: NSFeedbackForm.Component;
8
+ export default _default;
@@ -0,0 +1,53 @@
1
+ import type { Box } from '@semcore/base-components';
2
+ import type Button from '@semcore/button';
3
+ import type { Intergalactic } from '@semcore/core';
4
+ import type { NoticeSmart } from '@semcore/notice';
5
+ import type { FormProps } from 'react-final-form';
6
+ import type { NSFeedbackItem } from './component/feedback-item/FeedbackItem.type';
7
+ import type { NSSubmitButton } from './component/submit-button/SubmitButton.type';
8
+ declare namespace NSFeedbackForm {
9
+ type Props = Intergalactic.InternalTypings.RemoveIndexSignature<FormProps> & {
10
+ /** The event is called when the form is submitted */
11
+ onSubmit: (values: any, form: any, callback?: (errors?: {}) => void) => {} | Promise<{}> | void;
12
+ /**
13
+ * The property is in charge of the spinner showing
14
+ * */
15
+ loading?: boolean;
16
+ /**
17
+ * Color of container spinner; you can use your own color
18
+ */
19
+ background?: string;
20
+ /** Spinner theme. There are several default themes or you can use your own color
21
+ * @default dark
22
+ **/
23
+ theme?: 'dark' | 'invert' | string;
24
+ };
25
+ type DefaultProps = {
26
+ onSubmit: () => void;
27
+ };
28
+ namespace Item {
29
+ type Component = NSFeedbackItem.Component;
30
+ }
31
+ namespace Success {
32
+ type Component = typeof Box;
33
+ }
34
+ namespace Submit {
35
+ type Component = NSSubmitButton.Component;
36
+ }
37
+ namespace Cancel {
38
+ type Component = typeof Button;
39
+ }
40
+ namespace Notice {
41
+ type Component = typeof NoticeSmart;
42
+ }
43
+ type Component = Intergalactic.Component<'form', Props> & {
44
+ Item: Item.Component;
45
+ Success: Success.Component;
46
+ Submit: Submit.Component;
47
+ Cancel: Cancel.Component;
48
+ Notice: Notice.Component;
49
+ };
50
+ }
51
+ /** @deprecated It will be removed in v18. */
52
+ export type FeedbackFormProps = NSFeedbackForm.Props;
53
+ export type { NSFeedbackForm };
@@ -0,0 +1,8 @@
1
+ import type { NSFeedbackRating } from './FeedbackRating.type';
2
+ /**
3
+ * FeedbackRating
4
+ *
5
+ * {@link https://developer.semrush.com/intergalactic/components/feedback-form/feedback-form-api#feedbackform-feedbackrating|API} | {@link https://developer.semrush.com/intergalactic/components/feedback-form/feedback-form-code/|Examples}
6
+ */
7
+ declare const FeedbackRating: NSFeedbackRating.Component;
8
+ export default FeedbackRating;
@@ -0,0 +1,93 @@
1
+ import type { Intergalactic } from '@semcore/core';
2
+ import type { IllustrationProps } from '@semcore/illustration';
3
+ import type Notice from '@semcore/notice';
4
+ import type { Text } from '@semcore/typography';
5
+ import type React from 'react';
6
+ import type { NSCheckboxButton } from './component/checkbox-button/CheckboxButton.type';
7
+ import type { NSFeedbackItem } from './component/feedback-item/FeedbackItem.type';
8
+ import type { NSSubmitButton } from './component/submit-button/SubmitButton.type';
9
+ import type { NSFeedbackForm } from './FeedbackForm.type';
10
+ import type { LocalizedMessages } from './translations/__intergalactic-dynamic-locales';
11
+ declare namespace NSFeedbackRating {
12
+ type Props = Intergalactic.InternalTypings.EfficientOmit<NSFeedbackForm.Props, 'initialValues' | 'loading'> & {
13
+ /** Status of form */
14
+ status: 'default' | 'success' | 'error' | 'loading';
15
+ /** Flag for show/hide notification */
16
+ notificationVisible: boolean;
17
+ /** Notification close callback */
18
+ onNotificationClose: () => void;
19
+ /** Text in notification panel */
20
+ notificationText: string;
21
+ /** Title in notification panel */
22
+ notificationTitle?: string;
23
+ /** Optional link in notification panel */
24
+ learnMoreLink?: string;
25
+ /** Rating value */
26
+ rating: number;
27
+ /** Visible modal form flag */
28
+ visible: boolean;
29
+ /** Visibility changes callback */
30
+ onVisibleChange: (visible: boolean, rating: number) => void;
31
+ /** Width for modal with form */
32
+ modalWidth?: number | string;
33
+ /** Header of modal with form */
34
+ header: React.ReactNode;
35
+ /** Text for submit button of form */
36
+ submitText?: string;
37
+ /** Config for form fields */
38
+ formConfig: NSFeedbackRating.FormConfigItem[];
39
+ /** Initial form values including rating */
40
+ initialValues: Record<string, any> & {
41
+ rating: number;
42
+ };
43
+ /** Email address shown in error messages */
44
+ errorFeedbackEmail: string;
45
+ /** Specifies the locale for i18n support */
46
+ locale?: string;
47
+ /** Illustration element */
48
+ Illustration?: Intergalactic.Component<'svg', IllustrationProps>;
49
+ /** Notice component */
50
+ Notice?: typeof Notice;
51
+ };
52
+ type DefaultProps = {
53
+ onSubmit: () => void;
54
+ i18n: LocalizedMessages;
55
+ locale: 'en';
56
+ Illustration: Props['Illustration'];
57
+ Notice: Props['Notice'];
58
+ };
59
+ type State = {
60
+ error: boolean;
61
+ };
62
+ type FormConfigItem = {
63
+ key: string;
64
+ label: React.ReactNode;
65
+ type: 'input' | 'checkbox' | 'textarea' | 'email';
66
+ description?: React.ReactNode;
67
+ validate?: (value: any) => Error | string | undefined;
68
+ };
69
+ namespace Item {
70
+ type Component = NSFeedbackItem.Component;
71
+ }
72
+ namespace Submit {
73
+ type Component = NSSubmitButton.Component;
74
+ }
75
+ namespace Checkbox {
76
+ type Component = NSCheckboxButton.Component;
77
+ }
78
+ namespace Header {
79
+ type Component = typeof Text;
80
+ }
81
+ type Validate = {
82
+ description: (error: string | Error) => (value?: string) => string | Error | undefined;
83
+ email: (error: string | Error) => (value?: string) => string | Error | undefined;
84
+ };
85
+ type Component = Intergalactic.Component<'form', Props> & {
86
+ validate: Validate;
87
+ Item: Item.Component;
88
+ Submit: Submit.Component;
89
+ Checkbox: Checkbox.Component;
90
+ Header: Header.Component;
91
+ };
92
+ }
93
+ export type { NSFeedbackRating };
@@ -1,3 +1,3 @@
1
- import type { FeedbackRatingCheckboxComponent } from '../feedback-rating/FeedbackRating.type';
2
- declare const CheckboxButton: FeedbackRatingCheckboxComponent;
1
+ import type { NSCheckboxButton } from './CheckboxButton.type';
2
+ declare const CheckboxButton: NSCheckboxButton.Component;
3
3
  export default CheckboxButton;
@@ -0,0 +1,11 @@
1
+ import type { NSCheckbox } from '@semcore/checkbox';
2
+ import type { Intergalactic } from '@semcore/core';
3
+ import type React from 'react';
4
+ declare namespace NSCheckboxButton {
5
+ type Props = Omit<NSCheckbox.Props, 'label'> & {
6
+ focused: boolean;
7
+ label: React.ReactNode;
8
+ };
9
+ type Component = Intergalactic.Component<'div', Props>;
10
+ }
11
+ export type { NSCheckboxButton };
@@ -1,5 +1,9 @@
1
+ import type { Intergalactic } from '@semcore/core';
1
2
  import React from 'react';
2
- export declare function FeedbackItem({ Children, tag, uid, tooltipProps: tooltipPropsList, ...props }: any): React.JSX.Element;
3
+ import type { NSFeedbackItem } from './FeedbackItem.type';
4
+ export declare function FeedbackItem({ Children, tag, uid, tooltipProps: tooltipPropsList, ...props }: Intergalactic.InternalTypings.InferComponentProps<NSFeedbackItem.Component> & {
5
+ tag: Intergalactic.InternalTypings.ComponentTag;
6
+ }): React.JSX.Element;
3
7
  export declare namespace FeedbackItem {
4
8
  var enhance: ((props: any) => {
5
9
  uid: ReturnType<typeof import("@semcore/core/lib/utils/uniqueID").useUID>;
@@ -0,0 +1,22 @@
1
+ import type { Intergalactic } from '@semcore/core';
2
+ import type { TooltipProps } from '@semcore/tooltip';
3
+ import type { FieldProps, FieldInputProps, FieldMetaState } from 'react-final-form';
4
+ import type { NSFeedbackForm } from '../../FeedbackForm.type';
5
+ declare namespace NSFeedbackItem {
6
+ type Props = Intergalactic.InternalTypings.RemoveIndexSignature<FieldProps<any, any>> & TooltipProps & {
7
+ /**
8
+ * Allows to override which passed props will be passed to the Tooltip component.
9
+ */
10
+ tooltipProps?: string[];
11
+ /** Defines whether to validate item on blur */
12
+ validateOnBlur?: NSFeedbackForm.Props['validateOnBlur'];
13
+ };
14
+ type Ctx = {
15
+ input: FieldInputProps<any> & {
16
+ state: 'normal' | 'invalid';
17
+ };
18
+ meta: FieldMetaState<any>;
19
+ };
20
+ type Component = Intergalactic.Component<'div', Props, Ctx>;
21
+ }
22
+ export type { NSFeedbackItem };
@@ -1,15 +1,3 @@
1
- import { Flex, Box, type BoxProps } from '@semcore/base-components';
2
- import { type Intergalactic } from '@semcore/core';
3
- type SliderRatingProps = {
4
- value: number;
5
- onChange?: (value: number) => void;
6
- readonly?: boolean;
7
- };
8
- type StarProps = BoxProps & {
9
- filled?: boolean;
10
- };
11
- type SliderRatingComponent = Intergalactic.Component<typeof Flex, SliderRatingProps> & {
12
- Star: Intergalactic.Component<typeof Box, StarProps>;
13
- };
14
- declare const SliderRating: SliderRatingComponent;
1
+ import type { NSSliderRating } from './SliderRating.type';
2
+ declare const SliderRating: NSSliderRating.Component;
15
3
  export default SliderRating;
@@ -0,0 +1,28 @@
1
+ import type { Flex, Box } from '@semcore/base-components';
2
+ import type { Intergalactic } from '@semcore/core';
3
+ import type { LocalizedMessages } from '../../translations/__intergalactic-dynamic-locales';
4
+ declare namespace NSSliderRating {
5
+ type Props = {
6
+ value: number;
7
+ onChange?: (value: number) => void;
8
+ readonly?: boolean;
9
+ };
10
+ type DefaultProps = {
11
+ i18n: LocalizedMessages;
12
+ locale: 'en';
13
+ };
14
+ type State = {
15
+ hoveredIndex: number;
16
+ clickedIndex: number;
17
+ };
18
+ namespace Star {
19
+ type Props = {
20
+ filled?: boolean;
21
+ };
22
+ type Component = Intergalactic.Component<typeof Box, Props>;
23
+ }
24
+ type Component = Intergalactic.Component<typeof Flex, Props> & {
25
+ Star: Star.Component;
26
+ };
27
+ }
28
+ export type { NSSliderRating };
@@ -1,3 +1,4 @@
1
- import { type IRootComponentProps } from '@semcore/core';
1
+ import type { Intergalactic } from '@semcore/core';
2
2
  import React from 'react';
3
- export declare function SubmitButton(props: IRootComponentProps): React.ReactNode;
3
+ import type { NSSubmitButton } from './SubmitButton.type';
4
+ export declare function SubmitButton(props: Intergalactic.InternalTypings.InferComponentProps<NSSubmitButton.Component>): React.ReactNode;
@@ -0,0 +1,5 @@
1
+ import type Button from '@semcore/button';
2
+ declare namespace NSSubmitButton {
3
+ type Component = typeof Button;
4
+ }
5
+ export type { NSSubmitButton };
@@ -1,40 +1,4 @@
1
- import type { Box } from '@semcore/base-components';
2
- import type Button from '@semcore/button';
3
- import type { Intergalactic } from '@semcore/core';
4
- import type { NoticeSmart } from '@semcore/notice';
5
- import type { FormProps, FieldProps, FieldInputProps, FieldMetaState } from 'react-final-form';
6
-
7
- import { default as FeedbackRating } from './component/feedback-rating/FeedbackRating';
8
-
9
- export type FeedbackFormProps = FormProps & {
10
- /** The event is called when the form is submitted */
11
- onSubmit: (values: any, form: any, callback?: (errors?: {}) => void) => {} | Promise<{}> | void;
12
- /**
13
- * The property is in charge of the spinner showing
14
- * */
15
- loading?: boolean;
16
- /**
17
- * Color of container spinner; you can use your own color
18
- */
19
- background?: string;
20
- /** Spinner theme. There are several default themes or you can use your own color
21
- * @default dark
22
- **/
23
- theme?: 'dark' | 'invert' | string;
24
- };
25
-
26
- declare const FeedbackForm: Intergalactic.Component<'form', FeedbackFormProps> & {
27
- Item: Intergalactic.Component<
28
- 'div',
29
- FieldProps<any, any>,
30
- { input: FieldInputProps<any> & { state: 'normal' | 'invalid' }; meta: FieldMetaState<any> }
31
- >;
32
- Success: typeof Box;
33
- Submit: typeof Button;
34
- Cancel: typeof Button;
35
- Notice: typeof NoticeSmart;
36
- };
37
-
38
- export default FeedbackForm;
39
-
1
+ import { default as FeedbackRating } from './FeedbackRating';
2
+ export { default } from './FeedbackForm';
3
+ export * from './FeedbackForm.type';
40
4
  export { FeedbackRating };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/feedback-form",
3
3
  "description": "Semrush Feedback Form Component",
4
- "version": "17.2.1",
4
+ "version": "17.2.2-prerelease.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -18,13 +18,13 @@
18
18
  "@semcore/notice-bubble": "^17.2.1",
19
19
  "@semcore/typography": "^17.2.1",
20
20
  "@semcore/link": "^17.2.1",
21
- "@semcore/modal": "^17.2.1",
21
+ "@semcore/modal": "^17.2.2-prerelease.0",
22
22
  "@semcore/illustration": "^17.0.1",
23
- "@semcore/textarea": "^17.2.1",
24
- "@semcore/input": "^17.2.1",
23
+ "@semcore/textarea": "^17.2.2-prerelease.0",
24
+ "@semcore/input": "^17.2.2-prerelease.0",
25
25
  "final-form": "4.20.7",
26
26
  "@semcore/button": "^17.2.1",
27
- "@semcore/notice": "^17.2.1",
27
+ "@semcore/notice": "^17.2.2-prerelease.0",
28
28
  "@semcore/spin-container": "^17.2.1",
29
29
  "@semcore/tooltip": "^17.2.1",
30
30
  "final-form-focus": "1.1.2",
@@ -55,6 +55,6 @@
55
55
  }
56
56
  },
57
57
  "scripts": {
58
- "build": "pnpm semcore-builder --source=js,ts && pnpm vite build"
58
+ "build": "pnpm semcore-builder && pnpm vite build"
59
59
  }
60
60
  }
package/vite.config.ts CHANGED
@@ -7,7 +7,7 @@ export default mergeConfig(
7
7
  defineConfig({
8
8
  build: {
9
9
  lib: {
10
- entry: './src/index.js',
10
+ entry: './src/index.ts',
11
11
  },
12
12
  rollupOptions: {
13
13
  external: [
package/vitest.config.mts CHANGED
@@ -9,7 +9,7 @@ export default defineConfig({
9
9
  resolve: vitestResolve,
10
10
  test: {
11
11
  include: [
12
- '__tests__/**/*.test.jsx',
12
+ '__tests__/**/*.test.tsx',
13
13
  ],
14
14
  environment: 'jsdom',
15
15
  setupFiles: [resolvePath(__dirname, '../../tools/testing-utils/setupTests')],