@semcore/feedback-form 18.0.0-prerelease.6 → 18.1.0-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.
- package/CHANGELOG.md +11 -0
- package/lib/cjs/FeedbackForm.js +9 -9
- package/lib/cjs/FeedbackForm.js.map +1 -1
- package/lib/cjs/FeedbackRating.js +5 -5
- package/lib/cjs/FeedbackRating.js.map +1 -1
- package/lib/cjs/component/checkbox-button/CheckboxButton.js +3 -3
- package/lib/cjs/component/slider-rating/SliderRating.js +6 -6
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/utils/createFocusDecorator.js +15 -0
- package/lib/cjs/utils/createFocusDecorator.js.map +1 -0
- package/lib/es6/FeedbackForm.js +8 -8
- package/lib/es6/FeedbackForm.js.map +1 -1
- package/lib/es6/FeedbackRating.js +4 -4
- package/lib/es6/FeedbackRating.js.map +1 -1
- package/lib/es6/component/checkbox-button/CheckboxButton.js +3 -3
- package/lib/es6/component/slider-rating/SliderRating.js +6 -6
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/utils/createFocusDecorator.js +9 -0
- package/lib/es6/utils/createFocusDecorator.js.map +1 -0
- package/lib/esm/FeedbackForm.mjs +9 -9
- package/lib/esm/FeedbackRating.mjs +5 -5
- package/lib/esm/component/checkbox-button/CheckboxButton.mjs +4 -4
- package/lib/esm/component/slider-rating/SliderRating.mjs +7 -7
- package/lib/esm/utils/createFocusDecorator.mjs +5 -0
- package/lib/types/FeedbackForm.d.ts.map +1 -1
- package/lib/types/FeedbackRating.d.ts.map +1 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/utils/createFocusDecorator.d.ts +8 -0
- package/lib/types/utils/createFocusDecorator.d.ts.map +1 -0
- package/package.json +19 -19
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,17 @@
|
|
|
2
2
|
|
|
3
3
|
CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
|
|
4
4
|
|
|
5
|
+
## [18.1.0] - 2026-10-29
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- `final-form-focus.default is not a function` error in SSR environments
|
|
10
|
+
with native ESM (e.g. Astro).
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- `NSFeedbackRating` namespace export.
|
|
15
|
+
|
|
5
16
|
## [18.0.0] - 2026-10-08
|
|
6
17
|
|
|
7
18
|
### BREAK
|
package/lib/cjs/FeedbackForm.js
CHANGED
|
@@ -12,26 +12,26 @@ var _baseComponents = require("@semcore/base-components");
|
|
|
12
12
|
var _button = _interopRequireDefault(require("@semcore/button"));
|
|
13
13
|
var _notice = require("@semcore/notice");
|
|
14
14
|
var _spinContainer = _interopRequireDefault(require("@semcore/spin-container"));
|
|
15
|
-
var _finalFormFocus = _interopRequireDefault(require("final-form-focus"));
|
|
16
15
|
var _react = _interopRequireDefault(require("react"));
|
|
17
16
|
var _reactFinalForm = require("react-final-form");
|
|
18
17
|
var _FeedbackItem = require("./component/feedback-item/FeedbackItem");
|
|
19
18
|
var _SubmitButton = require("./component/submit-button/SubmitButton");
|
|
19
|
+
var _createFocusDecorator = require("./utils/createFocusDecorator");
|
|
20
20
|
/*!__reshadow-styles__:"./style/feedback-form.shadow.css"*/
|
|
21
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
21
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SFeedbackForm_l0n9m_gg_{max-width:320px}.___SCancel_l0n9m_gg_,.___SSubmit_l0n9m_gg_{display:inline-flex;margin-right:var(--intergalactic-spacing-2x,8px)}.___SNotice_l0n9m_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_l0n9m_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_l0n9m_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\")}", /*__inner_css_end__*/"l0n9m_gg_"),
|
|
22
22
|
/*__reshadow_css_end__*/
|
|
23
23
|
{
|
|
24
|
-
"__SFeedbackForm": "
|
|
25
|
-
"__SSubmit": "
|
|
26
|
-
"__SCancel": "
|
|
27
|
-
"__SNotice": "
|
|
28
|
-
"__SSuccess": "
|
|
29
|
-
"__SEmail": "
|
|
24
|
+
"__SFeedbackForm": "___SFeedbackForm_l0n9m_gg_",
|
|
25
|
+
"__SSubmit": "___SSubmit_l0n9m_gg_",
|
|
26
|
+
"__SCancel": "___SCancel_l0n9m_gg_",
|
|
27
|
+
"__SNotice": "___SNotice_l0n9m_gg_",
|
|
28
|
+
"__SSuccess": "___SSuccess_l0n9m_gg_",
|
|
29
|
+
"__SEmail": "___SEmail_l0n9m_gg_"
|
|
30
30
|
});
|
|
31
31
|
class FeedbackForm extends _core.Component {
|
|
32
32
|
constructor(...args) {
|
|
33
33
|
super(...args);
|
|
34
|
-
(0, _defineProperty2.default)(this, "focusDecorator", (0,
|
|
34
|
+
(0, _defineProperty2.default)(this, "focusDecorator", (0, _createFocusDecorator.createFocusDecorator)());
|
|
35
35
|
}
|
|
36
36
|
getItemProps() {
|
|
37
37
|
const {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackForm.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_notice","_spinContainer","
|
|
1
|
+
{"version":3,"file":"FeedbackForm.js","names":["_core","require","_baseComponents","_button","_interopRequireDefault","_notice","_spinContainer","_react","_reactFinalForm","_FeedbackItem","_SubmitButton","_createFocusDecorator","style","sstyled","insert","FeedbackForm","Component","constructor","args","_defineProperty2","default","createFocusDecorator","getItemProps","validateOnBlur","asProps","render","SFeedbackForm","Box","Children","styles","forwardRef","loading","background","theme","other","createElement","Form","_extends2","decorators","focusDecorator","api","_ref4","cn","undefined","submitting","handleSubmit","origin","Field","onSubmit","description","error","value","words","split","symbols","join","length","email","test","String","toLowerCase","Success","props","_ref","arguments[0]","_ref5","SSuccess","SEmail","assignProps","Cancel","_ref2","_ref6","SCancel","Button","Notice","_ref3","_ref7","SNotice","NoticeSmart","_default","exports","createComponent","Item","FeedbackItem","Submit","SubmitButton"],"sources":["../../src/FeedbackForm.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport { NoticeSmart } from '@semcore/notice';\nimport SpinContainer from '@semcore/spin-container';\nimport React from 'react';\nimport { Field, Form } from 'react-final-form';\n\nimport { FeedbackItem } from './component/feedback-item/FeedbackItem';\nimport { SubmitButton } from './component/submit-button/SubmitButton';\nimport type { NSFeedbackForm } from './FeedbackForm.type';\nimport style from './style/feedback-form.shadow.css';\nimport { createFocusDecorator } from './utils/createFocusDecorator';\n\nclass FeedbackForm extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSFeedbackForm.Component>,\n [],\n {},\n {},\n {},\n NSFeedbackForm.DefaultProps\n> {\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: string) => (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: string) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n getItemProps() {\n const { validateOnBlur } = this.asProps;\n\n return {\n validateOnBlur,\n };\n }\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, forwardRef, loading, background, theme, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer\n background={background}\n theme={theme}\n size='xl'\n loading={loading === undefined ? api.submitting : loading}\n >\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 </Form>\n );\n }\n}\n\nfunction Success(props: Intergalactic.InternalTypings.InferComponentProps<NSFeedbackForm.Success.Component>) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = 'div';\n\n return sstyled(styles)(\n <SSuccess render={Box} tabIndex={-1}>\n <SEmail aria-hidden={true} />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Cancel(props: Intergalactic.InternalTypings.InferComponentProps<NSFeedbackForm.Cancel.Component>) {\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: Intergalactic.InternalTypings.InferComponentProps<NSFeedbackForm.Notice.Component>) {\n const { styles, theme = 'muted' } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} use:theme={theme} />);\n}\n\n/**\n * FeedbackForm\n *\n * {@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}\n */\nexport default createComponent<\n NSFeedbackForm.Component,\n typeof FeedbackForm\n>(FeedbackForm, {\n Item: FeedbackItem,\n Success,\n Submit: SubmitButton,\n Cancel,\n Notice,\n});\n"],"mappings":";;;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAHA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AAGA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,cAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,MAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,eAAA,GAAAP,OAAA;AAEA,IAAAQ,aAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAT,OAAA;AAGA,IAAAU,qBAAA,GAAAV,OAAA;AAAoE;AAAA,MAAAW,KAAA,8BAAAZ,KAAA,CAAAa,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAEp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W;EAAnD,OAAAF,KAAA,GAAO,IAAA/D,aAAO,EAACgB,MAAM,CAAC,eAACtB,MAAA,CAAAa,OAAA,CAAAe,aAAA,CAAC0C,OAAO,EAAAD,KAAA,CAAAlC,EAAA;IAAA,OAAA1C,KAAA,CAAAoE,WAAA;MAAA,aAAiCnC;IAAK,GAAA0C,KAAA;EAAA,EAAG,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AAJA,IAAAI,QAAA,GAAAC,OAAA,CAAA5D,OAAA,GAKe,IAAA6D,qBAAe,EAG5BlE,YAAY,EAAE;EACdmE,IAAI,EAAEC,0BAAY;EAClBtB,OAAO;EACPuB,MAAM,EAAEC,0BAAY;EACpBhB,MAAM;EACNK;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -22,7 +22,6 @@ var _noticeBubble = require("@semcore/notice-bubble");
|
|
|
22
22
|
var _spinContainer = _interopRequireDefault(require("@semcore/spin-container"));
|
|
23
23
|
var _textarea = _interopRequireDefault(require("@semcore/textarea"));
|
|
24
24
|
var _typography = require("@semcore/typography");
|
|
25
|
-
var _finalFormFocus = _interopRequireDefault(require("final-form-focus"));
|
|
26
25
|
var _react = _interopRequireDefault(require("react"));
|
|
27
26
|
var _reactFinalForm = require("react-final-form");
|
|
28
27
|
var _CheckboxButton = _interopRequireDefault(require("./component/checkbox-button/CheckboxButton"));
|
|
@@ -30,12 +29,13 @@ var _FeedbackItem = require("./component/feedback-item/FeedbackItem");
|
|
|
30
29
|
var _SliderRating = _interopRequireDefault(require("./component/slider-rating/SliderRating"));
|
|
31
30
|
var _SubmitButton = require("./component/submit-button/SubmitButton");
|
|
32
31
|
var _intergalacticDynamicLocales = require("./translations/__intergalactic-dynamic-locales");
|
|
32
|
+
var _createFocusDecorator = require("./utils/createFocusDecorator");
|
|
33
33
|
/*!__reshadow-styles__:"./style/feedback-rating.shadow.css"*/
|
|
34
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
34
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SFeedbackRating_jjxpt_gg_ ul{margin:0;padding:0}.___SFeedbackRating_jjxpt_gg_ :is(li,ul){list-style:none}.___SFeedbackRating_jjxpt_gg_ .___SHeader_jjxpt_gg_{font-size:var(--intergalactic-fs-300,16px);line-height:var(--intergalactic-lh-300,1.5);font-weight:var(--intergalactic-bold,700);margin:var(--intergalactic-spacing-4x,16px) 0;text-align:center}", /*__inner_css_end__*/"jjxpt_gg_"),
|
|
35
35
|
/*__reshadow_css_end__*/
|
|
36
36
|
{
|
|
37
|
-
"__SFeedbackRating": "
|
|
38
|
-
"__SHeader": "
|
|
37
|
+
"__SFeedbackRating": "___SFeedbackRating_jjxpt_gg_",
|
|
38
|
+
"__SHeader": "___SHeader_jjxpt_gg_"
|
|
39
39
|
});
|
|
40
40
|
class FeedbackRatingRoot extends _core.Component {
|
|
41
41
|
constructor(...args) {
|
|
@@ -44,7 +44,7 @@ class FeedbackRatingRoot extends _core.Component {
|
|
|
44
44
|
error: false
|
|
45
45
|
});
|
|
46
46
|
(0, _defineProperty2.default)(this, "manager", new _noticeBubble.NoticeBubbleManager());
|
|
47
|
-
(0, _defineProperty2.default)(this, "focusDecorator", (0,
|
|
47
|
+
(0, _defineProperty2.default)(this, "focusDecorator", (0, _createFocusDecorator.createFocusDecorator)());
|
|
48
48
|
(0, _defineProperty2.default)(this, "handleChangeRating", rating => {
|
|
49
49
|
if (rating > 0) {
|
|
50
50
|
this.asProps.onVisibleChange(true, rating);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackRating.js","names":["_core","require","_baseComponents","_i18nEnhance","_interopRequireDefault","_uniqueID","_m","_m2","_Feedback","_input","_link","_modal","_notice","_noticeBubble","_spinContainer","_textarea","_typography","_finalFormFocus","_react","_reactFinalForm","_CheckboxButton","_FeedbackItem","_SliderRating","_SubmitButton","_intergalacticDynamicLocales","style","sstyled","insert","FeedbackRatingRoot","Component","constructor","args","_defineProperty2","default","error","NoticeBubbleManager","createFocusDecorator","rating","asProps","onVisibleChange","fn","_value","e","config","index","initialValue","props","initialValues","key","createElement","Field","name","type","input","FeedbackRating","Checkbox","_extends2","id","label","onChange","_","focused","Text","mb","size","isDescriptionReactFragment","description","React","Fragment","Flex","direction","tag","mt","htmlFor","Item","validate","placement","flip","fallbackPlacements","undefined","h","handleChange","autoComplete","state","Value","Box","color","headerId","uid","getHeaderProps","getItemProps","validateOnBlur","getNoticeTextId","componentDidUpdate","prevProps","status","getI18nText","setState","setTimeout","manager","add","icon","children","initialAnimation","duration","render","_ref","_ref2","_ref4","header","submitText","formConfig","notificationText","notificationTitle","learnMoreLink","Children","_Children","styles","forwardRef","theme","background","visible","_onVisibleChange","notificationVisible","onNotificationClose","errorFeedbackEmail","modalWidth","Illustration","Notice","NoticeComponent","other","SFeedbackRating","Modal","checkboxFields","filter","item","textFields","notificationId","assignProps","cn","Label","mr","FeedbackIllustration","Content","Title","gap","alignItems","Actions","handleChangeRating","Close","onClick","handelCloseModal","Form","focusDecorator","api","_ref5","submitting","Header","handleSubmit","map","formConfigItem","renderCheckbox","renderTextField","email","Submit","loading","NoticeBubbleContainer","i18nEnhance","localizedMessages","uniqueIDEnhancement","onSubmit","i18n","locale","SemcoreNotice","value","words","split","symbols","join","Boolean","length","test","String","toLowerCase","_ref3","arguments[0]","_ref6","SHeader","createComponent","FeedbackItem","CheckboxButton","SubmitButton","_default","exports"],"sources":["../../src/FeedbackRating.tsx"],"sourcesContent":["import { Box, Flex } from '@semcore/base-components';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport CheckM from '@semcore/icon/Check/m';\nimport WarnM from '@semcore/icon/Warning/m';\nimport FeedbackIllustration from '@semcore/illustration/Feedback';\nimport Input from '@semcore/input';\nimport Link from '@semcore/link';\nimport Modal from '@semcore/modal';\nimport { default as SemcoreNotice } from '@semcore/notice';\nimport { NoticeBubbleContainer, NoticeBubbleManager } from '@semcore/notice-bubble';\nimport SpinContainer from '@semcore/spin-container';\nimport Textarea from '@semcore/textarea';\nimport { Text } from '@semcore/typography';\nimport createFocusDecorator from 'final-form-focus';\nimport React, { type ReactElement } from 'react';\nimport { Field, Form } from 'react-final-form';\n\nimport CheckboxButton from './component/checkbox-button/CheckboxButton';\nimport { FeedbackItem } from './component/feedback-item/FeedbackItem';\nimport SliderRating from './component/slider-rating/SliderRating';\nimport { SubmitButton } from './component/submit-button/SubmitButton';\nimport type { NSFeedbackRating } from './FeedbackRating.type';\nimport style from './style/feedback-rating.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nclass FeedbackRatingRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSFeedbackRating.Component>,\n typeof FeedbackRatingRoot.enhance,\n {},\n WithI18nEnhanceProps,\n NSFeedbackRating.State,\n NSFeedbackRating.DefaultProps\n> {\n static displayName = 'FeedbackRatingForm';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages), uniqueIDEnhancement()] as const;\n\n static defaultProps: NSFeedbackRating.DefaultProps = {\n onSubmit: () => {},\n i18n: localizedMessages,\n locale: 'en',\n Illustration: FeedbackIllustration,\n Notice: SemcoreNotice,\n };\n\n static validate = {\n description: (error: Error | string) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (Boolean(value) && (symbols.length < 10 || words.length < 3)) {\n return error;\n }\n },\n email: (error: Error | string) => (value = '') => {\n if (Boolean(value) && !/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n state: NSFeedbackRating.State = {\n error: false,\n };\n\n manager = new NoticeBubbleManager();\n\n private focusDecorator = createFocusDecorator<Record<string, any>>();\n\n get headerId() {\n const { uid } = this.asProps;\n\n return `${uid}-feedback-rating-header`;\n }\n\n getHeaderProps() {\n return {\n id: this.headerId,\n };\n }\n\n getItemProps() {\n const { validateOnBlur } = this.asProps;\n\n return {\n validateOnBlur,\n };\n }\n\n getNoticeTextId() {\n const { uid } = this.asProps;\n return `${uid}-feedback-rating-notice`;\n }\n\n handleChangeRating = (rating: number) => {\n if (rating > 0) {\n this.asProps.onVisibleChange(true, rating);\n }\n };\n\n handelCloseModal = () => {\n this.asProps.onVisibleChange(false, this.asProps.rating);\n };\n\n handleChange =\n (fn: (e: React.SyntheticEvent) => void) => (_value: any, e: React.SyntheticEvent) => {\n fn(e);\n };\n\n componentDidUpdate(prevProps: typeof this.asProps) {\n const { status, getI18nText } = this.asProps;\n\n if (prevProps.status !== status) {\n this.setState({ error: false });\n\n if (status === 'success') {\n // showing notice with delay for SR, less than 100ms is not enough\n setTimeout(() => {\n this.manager.add({\n icon: <CheckM color='green-400' />,\n children: getI18nText('successMessage'),\n initialAnimation: true,\n duration: 5000,\n });\n }, 300);\n } else if (status === 'error') {\n this.setState({ error: true });\n }\n }\n }\n\n renderCheckbox = (config: NSFeedbackRating.FormConfigItem, index: number) => {\n const initialValue = this.props.initialValues[config.key];\n\n return (\n <Field name={config.key} initialValue={initialValue} type='checkbox' key={config.key}>\n {({ input }) => (\n <FeedbackRating.Checkbox\n {...input}\n id={config.key}\n label={config.label}\n onChange={(_: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => input.onChange(e)}\n focused={index === 0}\n />\n )}\n </Field>\n );\n };\n\n renderTextField = (config: NSFeedbackRating.FormConfigItem) => {\n const initialValue = this.props.initialValues[config.key];\n\n const label =\n typeof config.label === 'string'\n ? (\n <Text mb={2} size={200}>\n {config.label}\n </Text>\n )\n : (\n (config.label as unknown as JSX.Element)\n );\n\n const isDescriptionReactFragment =\n (config.description as ReactElement)?.type === React.Fragment;\n\n return (\n <Flex key={config.key} direction='column'>\n <Flex tag='label' mt={4} htmlFor={config.key}>\n {label}\n </Flex>\n\n <FeedbackRating.Item\n name={config.key}\n validate={config.validate}\n initialValue={initialValue}\n placement='left-start'\n flip={{\n fallbackPlacements: ['right-start', 'bottom'],\n }}\n aria-describedby={config.description ? config.key + '-description' : undefined}\n >\n {/* @ts-ignore */}\n {({ input }) => {\n if (config.type === 'textarea') {\n return (\n <Textarea\n {...input}\n h={80}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n );\n }\n if (config.type === 'input' || config.type === 'email') {\n if (config.type === 'email') {\n input.autoComplete = 'email';\n input.type = 'email';\n }\n\n return (\n <Input state={input.state}>\n <Input.Value\n {...input}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n </Input>\n );\n }\n return null;\n }}\n </FeedbackRating.Item>\n {config.description && (\n <Box mt={2}>\n {typeof config.description === 'string' || isDescriptionReactFragment\n ? (\n <Text size={200} color='text-secondary' id={config.key + '-description'}>\n {config.description}\n </Text>\n )\n : (\n config.description\n )}\n </Box>\n )}\n </Flex>\n );\n };\n\n render() {\n const {\n header,\n submitText,\n formConfig,\n notificationText,\n notificationTitle,\n learnMoreLink,\n Children: _Children,\n styles,\n forwardRef,\n status,\n theme,\n background,\n rating,\n visible,\n onVisibleChange: _onVisibleChange,\n notificationVisible,\n onNotificationClose,\n getI18nText,\n errorFeedbackEmail,\n modalWidth,\n Illustration,\n Notice: NoticeComponent,\n ...other\n } = this.asProps;\n\n const SFeedbackRating = Root;\n const checkboxFields = formConfig.filter((item) => item.type === 'checkbox');\n const textFields = formConfig.filter(\n (item) => item.type === 'textarea' || item.type === 'input' || item.type === 'email',\n );\n const notificationId = this.getNoticeTextId();\n\n return sstyled(styles)(\n <Root render={Box}>\n <NoticeComponent\n visible={notificationVisible}\n aria-label={getI18nText('leaveFeedback')}\n tag={Flex}\n alignItems={notificationTitle ? 'flex-start' : 'center'}\n >\n <NoticeComponent.Label mr={3} aria-hidden={true}>\n <Illustration primaryColor={Illustration === FeedbackIllustration ? 'illustration-blue' : undefined} />\n </NoticeComponent.Label>\n <NoticeComponent.Content>\n {notificationTitle ? <NoticeComponent.Title>{notificationTitle}</NoticeComponent.Title> : null}\n <NoticeComponent.Text gap={3} tag={Flex} alignItems={notificationTitle ? 'flex-start' : 'center'}>\n <Text id={notificationId}>\n {notificationText}\n </Text>\n <NoticeComponent.Actions mt={0}>\n <SliderRating\n value={rating}\n onChange={this.handleChangeRating}\n aria-labelledby={notificationId}\n />\n </NoticeComponent.Actions>\n {learnMoreLink && (\n <Link href={learnMoreLink}>\n {getI18nText('learnMore')}\n </Link>\n )}\n </NoticeComponent.Text>\n </NoticeComponent.Content>\n <NoticeComponent.Close onClick={onNotificationClose} />\n </NoticeComponent>\n\n <SFeedbackRating\n render={Modal}\n visible={visible}\n onClose={this.handelCloseModal}\n p={0}\n use:w={modalWidth ?? 440}\n aria-labelledby={this.headerId}\n >\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer\n background={background}\n theme={theme}\n size='xl'\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n p={1}\n m={9}\n >\n <Flex justifyContent='center'>\n <SliderRating value={rating} readonly={true} />\n </Flex>\n\n {(header as ReactElement)?.type === FeedbackRating.Header\n ? (\n header\n )\n : (\n <FeedbackRating.Header>{header}</FeedbackRating.Header>\n )}\n\n <Box\n tag='form'\n noValidate\n method='POST'\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n <Field name='rating' initialValue={rating}>\n {({ input }) => <input {...input} type='hidden' />}\n </Field>\n\n <div role='group' aria-labelledby={this.headerId}>\n {checkboxFields.map((formConfigItem, index) =>\n this.renderCheckbox(formConfigItem, index),\n )}\n </div>\n\n {textFields.map((formConfigItem) => this.renderTextField(formConfigItem))}\n\n {this.state.error && (\n <SemcoreNotice theme='warning' mt={4} mb={4}>\n <SemcoreNotice.Label>\n <WarnM />\n </SemcoreNotice.Label>\n <SemcoreNotice.Content>\n {getI18nText('errorMessage', {\n email: (\n <Link href={`mailto:${errorFeedbackEmail}`}>\n {errorFeedbackEmail}\n </Link>\n ),\n })}\n </SemcoreNotice.Content>\n </SemcoreNotice>\n )}\n\n <Flex mt={4} justifyContent='center'>\n <FeedbackRating.Submit\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n size='l'\n >\n {submitText ?? getI18nText('submitButton')}\n </FeedbackRating.Submit>\n </Flex>\n </Box>\n </SpinContainer>,\n )}\n </Form>\n </SFeedbackRating>\n\n <NoticeBubbleContainer manager={this.manager} />\n </Root>,\n );\n }\n}\n\nfunction Header(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSFeedbackRating.Header.Component, typeof FeedbackRatingRoot, 'Header'>,\n) {\n const { styles } = props;\n const SHeader = Root;\n return sstyled(styles)(\n <SHeader render={Modal.Title} />,\n );\n}\n\n/**\n * FeedbackRating\n *\n * {@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}\n */\nconst FeedbackRating = createComponent<\n NSFeedbackRating.Component,\n typeof FeedbackRatingRoot\n>(FeedbackRatingRoot, {\n Header,\n Item: FeedbackItem,\n Checkbox: CheckboxButton,\n Submit: SubmitButton,\n});\n\nexport default FeedbackRating;\n"],"mappings":";;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAIA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,EAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,GAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,SAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,MAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,KAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,MAAA,GAAAP,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AC;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMlI,cAAc,GAAG,IAAAsI,qBAAe,EAGpChK,kBAAkB,EAAE;EACpBiI,MAAM;EACNnF,IAAI,EAAEmH,0BAAY;EAClBtI,QAAQ,EAAEuI,uBAAc;EACxB1B,MAAM,EAAE2B;AACV,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhK,OAAA,GAEYqB,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FeedbackRating.js","names":["_core","require","_baseComponents","_i18nEnhance","_interopRequireDefault","_uniqueID","_m","_m2","_Feedback","_input","_link","_modal","_notice","_noticeBubble","_spinContainer","_textarea","_typography","_react","_reactFinalForm","_CheckboxButton","_FeedbackItem","_SliderRating","_SubmitButton","_intergalacticDynamicLocales","_createFocusDecorator","style","sstyled","insert","FeedbackRatingRoot","Component","constructor","args","_defineProperty2","default","error","NoticeBubbleManager","createFocusDecorator","rating","asProps","onVisibleChange","fn","_value","e","config","index","initialValue","props","initialValues","key","createElement","Field","name","type","input","FeedbackRating","Checkbox","_extends2","id","label","onChange","_","focused","Text","mb","size","isDescriptionReactFragment","description","React","Fragment","Flex","direction","tag","mt","htmlFor","Item","validate","placement","flip","fallbackPlacements","undefined","h","handleChange","autoComplete","state","Value","Box","color","headerId","uid","getHeaderProps","getItemProps","validateOnBlur","getNoticeTextId","componentDidUpdate","prevProps","status","getI18nText","setState","setTimeout","manager","add","icon","children","initialAnimation","duration","render","_ref","_ref2","_ref4","header","submitText","formConfig","notificationText","notificationTitle","learnMoreLink","Children","_Children","styles","forwardRef","theme","background","visible","_onVisibleChange","notificationVisible","onNotificationClose","errorFeedbackEmail","modalWidth","Illustration","Notice","NoticeComponent","other","SFeedbackRating","Modal","checkboxFields","filter","item","textFields","notificationId","assignProps","cn","Label","mr","FeedbackIllustration","Content","Title","gap","alignItems","Actions","handleChangeRating","Close","onClick","handelCloseModal","Form","focusDecorator","api","_ref5","submitting","Header","handleSubmit","map","formConfigItem","renderCheckbox","renderTextField","email","Submit","loading","NoticeBubbleContainer","i18nEnhance","localizedMessages","uniqueIDEnhancement","onSubmit","i18n","locale","SemcoreNotice","value","words","split","symbols","join","Boolean","length","test","String","toLowerCase","_ref3","arguments[0]","_ref6","SHeader","createComponent","FeedbackItem","CheckboxButton","SubmitButton","_default","exports"],"sources":["../../src/FeedbackRating.tsx"],"sourcesContent":["import { Box, Flex } from '@semcore/base-components';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport CheckM from '@semcore/icon/Check/m';\nimport WarnM from '@semcore/icon/Warning/m';\nimport FeedbackIllustration from '@semcore/illustration/Feedback';\nimport Input from '@semcore/input';\nimport Link from '@semcore/link';\nimport Modal from '@semcore/modal';\nimport { default as SemcoreNotice } from '@semcore/notice';\nimport { NoticeBubbleContainer, NoticeBubbleManager } from '@semcore/notice-bubble';\nimport SpinContainer from '@semcore/spin-container';\nimport Textarea from '@semcore/textarea';\nimport { Text } from '@semcore/typography';\nimport React, { type ReactElement } from 'react';\nimport { Field, Form } from 'react-final-form';\n\nimport CheckboxButton from './component/checkbox-button/CheckboxButton';\nimport { FeedbackItem } from './component/feedback-item/FeedbackItem';\nimport SliderRating from './component/slider-rating/SliderRating';\nimport { SubmitButton } from './component/submit-button/SubmitButton';\nimport type { NSFeedbackRating } from './FeedbackRating.type';\nimport style from './style/feedback-rating.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { createFocusDecorator } from './utils/createFocusDecorator';\n\nclass FeedbackRatingRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSFeedbackRating.Component>,\n typeof FeedbackRatingRoot.enhance,\n {},\n WithI18nEnhanceProps,\n NSFeedbackRating.State,\n NSFeedbackRating.DefaultProps\n> {\n static displayName = 'FeedbackRatingForm';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages), uniqueIDEnhancement()] as const;\n\n static defaultProps: NSFeedbackRating.DefaultProps = {\n onSubmit: () => {},\n i18n: localizedMessages,\n locale: 'en',\n Illustration: FeedbackIllustration,\n Notice: SemcoreNotice,\n };\n\n static validate = {\n description: (error: Error | string) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (Boolean(value) && (symbols.length < 10 || words.length < 3)) {\n return error;\n }\n },\n email: (error: Error | string) => (value = '') => {\n if (Boolean(value) && !/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n state: NSFeedbackRating.State = {\n error: false,\n };\n\n manager = new NoticeBubbleManager();\n\n private focusDecorator = createFocusDecorator<Record<string, any>>();\n\n get headerId() {\n const { uid } = this.asProps;\n\n return `${uid}-feedback-rating-header`;\n }\n\n getHeaderProps() {\n return {\n id: this.headerId,\n };\n }\n\n getItemProps() {\n const { validateOnBlur } = this.asProps;\n\n return {\n validateOnBlur,\n };\n }\n\n getNoticeTextId() {\n const { uid } = this.asProps;\n return `${uid}-feedback-rating-notice`;\n }\n\n handleChangeRating = (rating: number) => {\n if (rating > 0) {\n this.asProps.onVisibleChange(true, rating);\n }\n };\n\n handelCloseModal = () => {\n this.asProps.onVisibleChange(false, this.asProps.rating);\n };\n\n handleChange =\n (fn: (e: React.SyntheticEvent) => void) => (_value: any, e: React.SyntheticEvent) => {\n fn(e);\n };\n\n componentDidUpdate(prevProps: typeof this.asProps) {\n const { status, getI18nText } = this.asProps;\n\n if (prevProps.status !== status) {\n this.setState({ error: false });\n\n if (status === 'success') {\n // showing notice with delay for SR, less than 100ms is not enough\n setTimeout(() => {\n this.manager.add({\n icon: <CheckM color='green-400' />,\n children: getI18nText('successMessage'),\n initialAnimation: true,\n duration: 5000,\n });\n }, 300);\n } else if (status === 'error') {\n this.setState({ error: true });\n }\n }\n }\n\n renderCheckbox = (config: NSFeedbackRating.FormConfigItem, index: number) => {\n const initialValue = this.props.initialValues[config.key];\n\n return (\n <Field name={config.key} initialValue={initialValue} type='checkbox' key={config.key}>\n {({ input }) => (\n <FeedbackRating.Checkbox\n {...input}\n id={config.key}\n label={config.label}\n onChange={(_: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => input.onChange(e)}\n focused={index === 0}\n />\n )}\n </Field>\n );\n };\n\n renderTextField = (config: NSFeedbackRating.FormConfigItem) => {\n const initialValue = this.props.initialValues[config.key];\n\n const label =\n typeof config.label === 'string'\n ? (\n <Text mb={2} size={200}>\n {config.label}\n </Text>\n )\n : (\n (config.label as unknown as JSX.Element)\n );\n\n const isDescriptionReactFragment =\n (config.description as ReactElement)?.type === React.Fragment;\n\n return (\n <Flex key={config.key} direction='column'>\n <Flex tag='label' mt={4} htmlFor={config.key}>\n {label}\n </Flex>\n\n <FeedbackRating.Item\n name={config.key}\n validate={config.validate}\n initialValue={initialValue}\n placement='left-start'\n flip={{\n fallbackPlacements: ['right-start', 'bottom'],\n }}\n aria-describedby={config.description ? config.key + '-description' : undefined}\n >\n {/* @ts-ignore */}\n {({ input }) => {\n if (config.type === 'textarea') {\n return (\n <Textarea\n {...input}\n h={80}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n );\n }\n if (config.type === 'input' || config.type === 'email') {\n if (config.type === 'email') {\n input.autoComplete = 'email';\n input.type = 'email';\n }\n\n return (\n <Input state={input.state}>\n <Input.Value\n {...input}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n </Input>\n );\n }\n return null;\n }}\n </FeedbackRating.Item>\n {config.description && (\n <Box mt={2}>\n {typeof config.description === 'string' || isDescriptionReactFragment\n ? (\n <Text size={200} color='text-secondary' id={config.key + '-description'}>\n {config.description}\n </Text>\n )\n : (\n config.description\n )}\n </Box>\n )}\n </Flex>\n );\n };\n\n render() {\n const {\n header,\n submitText,\n formConfig,\n notificationText,\n notificationTitle,\n learnMoreLink,\n Children: _Children,\n styles,\n forwardRef,\n status,\n theme,\n background,\n rating,\n visible,\n onVisibleChange: _onVisibleChange,\n notificationVisible,\n onNotificationClose,\n getI18nText,\n errorFeedbackEmail,\n modalWidth,\n Illustration,\n Notice: NoticeComponent,\n ...other\n } = this.asProps;\n\n const SFeedbackRating = Root;\n const checkboxFields = formConfig.filter((item) => item.type === 'checkbox');\n const textFields = formConfig.filter(\n (item) => item.type === 'textarea' || item.type === 'input' || item.type === 'email',\n );\n const notificationId = this.getNoticeTextId();\n\n return sstyled(styles)(\n <Root render={Box}>\n <NoticeComponent\n visible={notificationVisible}\n aria-label={getI18nText('leaveFeedback')}\n tag={Flex}\n alignItems={notificationTitle ? 'flex-start' : 'center'}\n >\n <NoticeComponent.Label mr={3} aria-hidden={true}>\n <Illustration primaryColor={Illustration === FeedbackIllustration ? 'illustration-blue' : undefined} />\n </NoticeComponent.Label>\n <NoticeComponent.Content>\n {notificationTitle ? <NoticeComponent.Title>{notificationTitle}</NoticeComponent.Title> : null}\n <NoticeComponent.Text gap={3} tag={Flex} alignItems={notificationTitle ? 'flex-start' : 'center'}>\n <Text id={notificationId}>\n {notificationText}\n </Text>\n <NoticeComponent.Actions mt={0}>\n <SliderRating\n value={rating}\n onChange={this.handleChangeRating}\n aria-labelledby={notificationId}\n />\n </NoticeComponent.Actions>\n {learnMoreLink && (\n <Link href={learnMoreLink}>\n {getI18nText('learnMore')}\n </Link>\n )}\n </NoticeComponent.Text>\n </NoticeComponent.Content>\n <NoticeComponent.Close onClick={onNotificationClose} />\n </NoticeComponent>\n\n <SFeedbackRating\n render={Modal}\n visible={visible}\n onClose={this.handelCloseModal}\n p={0}\n use:w={modalWidth ?? 440}\n aria-labelledby={this.headerId}\n >\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer\n background={background}\n theme={theme}\n size='xl'\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n p={1}\n m={9}\n >\n <Flex justifyContent='center'>\n <SliderRating value={rating} readonly={true} />\n </Flex>\n\n {(header as ReactElement)?.type === FeedbackRating.Header\n ? (\n header\n )\n : (\n <FeedbackRating.Header>{header}</FeedbackRating.Header>\n )}\n\n <Box\n tag='form'\n noValidate\n method='POST'\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n <Field name='rating' initialValue={rating}>\n {({ input }) => <input {...input} type='hidden' />}\n </Field>\n\n <div role='group' aria-labelledby={this.headerId}>\n {checkboxFields.map((formConfigItem, index) =>\n this.renderCheckbox(formConfigItem, index),\n )}\n </div>\n\n {textFields.map((formConfigItem) => this.renderTextField(formConfigItem))}\n\n {this.state.error && (\n <SemcoreNotice theme='warning' mt={4} mb={4}>\n <SemcoreNotice.Label>\n <WarnM />\n </SemcoreNotice.Label>\n <SemcoreNotice.Content>\n {getI18nText('errorMessage', {\n email: (\n <Link href={`mailto:${errorFeedbackEmail}`}>\n {errorFeedbackEmail}\n </Link>\n ),\n })}\n </SemcoreNotice.Content>\n </SemcoreNotice>\n )}\n\n <Flex mt={4} justifyContent='center'>\n <FeedbackRating.Submit\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n size='l'\n >\n {submitText ?? getI18nText('submitButton')}\n </FeedbackRating.Submit>\n </Flex>\n </Box>\n </SpinContainer>,\n )}\n </Form>\n </SFeedbackRating>\n\n <NoticeBubbleContainer manager={this.manager} />\n </Root>,\n );\n }\n}\n\nfunction Header(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSFeedbackRating.Header.Component, typeof FeedbackRatingRoot, 'Header'>,\n) {\n const { styles } = props;\n const SHeader = Root;\n return sstyled(styles)(\n <SHeader render={Modal.Title} />,\n );\n}\n\n/**\n * FeedbackRating\n *\n * {@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}\n */\nconst FeedbackRating = createComponent<\n NSFeedbackRating.Component,\n typeof FeedbackRatingRoot\n>(FeedbackRatingRoot, {\n Header,\n Item: FeedbackItem,\n Checkbox: CheckboxButton,\n Submit: SubmitButton,\n});\n\nexport default FeedbackRating;\n"],"mappings":";;;;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,eAAA,GAAAD,OAAA;AAIA,IAAAE,YAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,EAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,GAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,SAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,MAAA,GAAAL,sBAAA,CAAAH,OAAA;AACA,IAAAS,KAAA,GAAAN,sBAAA,CAAAH,OAAA;AACA,IAAAU,MAAA,GAAAP,sBAAA,CAAAH,OAAA;AACA,IAAAW,OAAA,GAAAR,sBAAA,CAAAH,OAAA;AACA,IAAAY,aAAA,GAAAZ,OAAA;AACA,IAAAa,cAAA,GAAAV,sBAAA,CAAAH,OAAA;AACA,IAAAc,SAAA,GAAAX,sBAAA,CAAAH,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AACA,IAAAgB,MAAA,GAAAb,sBAAA,CAAAH,OAAA;AACA,IAAAiB,eAAA,GAAAjB,OAAA;AAEA,IAAAkB,eAAA,GAAAf,sBAAA,CAAAH,OAAA;AACA,IAAAmB,aAAA,GAAAnB,OAAA;AACA,IAAAoB,aAAA,GAAAjB,sBAAA,CAAAH,OAAA;AACA,IAAAqB,aAAA,GAAArB,OAAA;AAGA,IAAAsB,4BAAA,GAAAtB,OAAA;AACA,IAAAuB,qBAAA,GAAAvB,OAAA;AAAoE;AAAA,MAAAwB,KAAA,8BAAAzB,KAAA,CAAA0B,OAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;AAAA;AAEpE,MAAMC,kBAAkB,SAASC,eAAS,CAOxC;EA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AAK,GAAG,EAAE,KAAK;IAChD,IAAIK,OAAO,CAACL,KAAK,CAAC,IAAI,CAAC,YAAY,CAACO,IAAI,CAACC,MAAM,CAACR,KAAK,CAAC,CAACS,WAAW,CAAC,CAAC,CAAC,EAAE;MACrE,OAAOrJ,KAAK;IACd;EACF;AACF,CAAC;AAuUH,SAAS2H,MAAMA,CACb/G,KAAqI,EACrI;EAAA,IAAA0I,KAAA,GAAAC,YAAA;IAAAC,KAAA;EACA,MAAM;IAAErE;EAAO,CAAC,GAAGvE,KAAK;EACxB,MAAM6I,OAAO,GAEMvD,cAAK,CAACY,KAAK;EAD9B,OAAA0C,KAAA,GAAO,IAAAhK,aAAO,EAAC2F,MAAM,CAAC,eACpBpG,MAAA,CAAAgB,OAAA,CAAAgB,aAAA,CAAC0I,OAAO,EAAAD,KAAA,CAAA/C,EAAA;IAAA,OAAA3I,KAAA,CAAA0I,WAAA,MAAA8C,KAAA;EAAA,EAAuB,CAAC;AAEpC;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAMlI,cAAc,GAAG,IAAAsI,qBAAe,EAGpChK,kBAAkB,EAAE;EACpBiI,MAAM;EACNnF,IAAI,EAAEmH,0BAAY;EAClBtI,QAAQ,EAAEuI,uBAAc;EACxB1B,MAAM,EAAE2B;AACV,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAhK,OAAA,GAEYqB,cAAc","ignoreList":[]}
|
|
@@ -11,11 +11,11 @@ var _baseComponents = require("@semcore/base-components");
|
|
|
11
11
|
var _checkbox = _interopRequireDefault(require("@semcore/checkbox"));
|
|
12
12
|
var _react = _interopRequireDefault(require("react"));
|
|
13
13
|
/*!__reshadow-styles__:"../../style/checkbox-button.shadow.css"*/
|
|
14
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
14
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SCheckboxButton_emy2e_gg_{margin-top:var(--intergalactic-spacing-2x,8px);background-color:var(--intergalactic-control-checkbox-button-bg-normal,#0000);border:1px solid var(--intergalactic-control-checkbox-button-border,oklch(.277 .066 242.6/.18));border-radius:var(--intergalactic-control-rounded,6px)}.___SCheckboxButton_emy2e_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x,12px);box-sizing:border-box}.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_{cursor:pointer;background-color:var(--intergalactic-control-checkbox-button-bg-hover,oklch(.375 .09 242.7/.05))}@media (hover:hover){.___SCheckboxButton_emy2e_gg_:hover{cursor:pointer;background-color:var(--intergalactic-control-checkbox-button-bg-hover,oklch(.375 .09 242.7/.05))}}.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_{border-color:var(--intergalactic-control-checkbox-button-border-selected,oklch(.277 .066 242.6/.18))}@media (hover:hover){.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_:hover{background-color:var(--intergalactic-control-checkbox-button-bg-selected-hover,oklch(.344 .082 242.3/.065))}}", /*__inner_css_end__*/"emy2e_gg_"),
|
|
15
15
|
/*__reshadow_css_end__*/
|
|
16
16
|
{
|
|
17
|
-
"__SCheckboxButton": "
|
|
18
|
-
"_checked": "
|
|
17
|
+
"__SCheckboxButton": "___SCheckboxButton_emy2e_gg_",
|
|
18
|
+
"_checked": "__checked_emy2e_gg_"
|
|
19
19
|
});
|
|
20
20
|
class CheckboxButtonRoot extends _core.Component {
|
|
21
21
|
constructor(...args) {
|
|
@@ -13,14 +13,14 @@ var _uniqueID = _interopRequireDefault(require("@semcore/core/lib/utils/uniqueID
|
|
|
13
13
|
var _react = _interopRequireDefault(require("react"));
|
|
14
14
|
var _intergalacticDynamicLocales = require("../../translations/__intergalactic-dynamic-locales");
|
|
15
15
|
/*!__reshadow-styles__:"../../style/slider-rating.shadow.css"*/
|
|
16
|
-
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".
|
|
16
|
+
const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SSliderRating_1ftt8_gg_ .___SStar_1ftt8_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}.___SSliderRating_1ftt8_gg_:focus-visible .___SStar_1ftt8_gg_.__hovered_1ftt8_gg_{cursor:pointer;transform:scale(1.3)}@media (hover:hover){.___SSliderRating_1ftt8_gg_ .___SStar_1ftt8_gg_:hover{cursor:pointer;transform:scale(1.3)}.___SSliderRating_1ftt8_gg_.__readonly_1ftt8_gg_ .___SStar_1ftt8_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_1ftt8_gg_.__filled_1ftt8_gg_:active{animation:wobble .8s ease-in-out}.___SStar_1ftt8_gg_ path{fill:var(--intergalactic-control-slider-rating-icon,#0016298f)}@media (color-gamut:p3){.___SStar_1ftt8_gg_ path{fill:var(--intergalactic-control-slider-rating-icon,oklch(.193 .05 246/.562))}}.___SStar_1ftt8_gg_.__filled_1ftt8_gg_ path{stroke-width:0;fill:var(--intergalactic-control-slider-rating-icon-hover-active,oklch(.22 .008 245))}", /*__inner_css_end__*/"1ftt8_gg_"),
|
|
17
17
|
/*__reshadow_css_end__*/
|
|
18
18
|
{
|
|
19
|
-
"__SSliderRating": "
|
|
20
|
-
"__SStar": "
|
|
21
|
-
"_hovered": "
|
|
22
|
-
"_readonly": "
|
|
23
|
-
"_filled": "
|
|
19
|
+
"__SSliderRating": "___SSliderRating_1ftt8_gg_",
|
|
20
|
+
"__SStar": "___SStar_1ftt8_gg_",
|
|
21
|
+
"_hovered": "__hovered_1ftt8_gg_",
|
|
22
|
+
"_readonly": "__readonly_1ftt8_gg_",
|
|
23
|
+
"_filled": "__filled_1ftt8_gg_"
|
|
24
24
|
});
|
|
25
25
|
const MIN = 1;
|
|
26
26
|
const MAX = 5;
|
package/lib/cjs/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_FeedbackRating","_interopRequireDefault","require","_FeedbackForm","_FeedbackForm2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as FeedbackRating } from './FeedbackRating';\n\nexport { default } from './FeedbackForm';\nexport * from './FeedbackForm.type';\n\nexport { FeedbackRating };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,cAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,cAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,cAAA,CAAAI,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_FeedbackRating","_interopRequireDefault","require","_FeedbackForm","_FeedbackForm2","Object","keys","forEach","key","prototype","hasOwnProperty","call","_exportNames","exports","defineProperty","enumerable","get"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as FeedbackRating } from './FeedbackRating';\n\nexport { default } from './FeedbackForm';\nexport * from './FeedbackForm.type';\n\nexport { FeedbackRating };\nexport type { NSFeedbackRating } from './FeedbackRating.type';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAAC,aAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,cAAA,GAAAF,OAAA;AAAAG,MAAA,CAAAC,IAAA,CAAAF,cAAA,EAAAG,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAC,YAAA,EAAAJ,GAAA;EAAA,IAAAA,GAAA,IAAAK,OAAA,IAAAA,OAAA,CAAAL,GAAA,MAAAJ,cAAA,CAAAI,GAAA;EAAAH,MAAA,CAAAS,cAAA,CAAAD,OAAA,EAAAL,GAAA;IAAAO,UAAA;IAAAC,GAAA,WAAAA,CAAA;MAAA,OAAAZ,cAAA,CAAAI,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.createFocusDecorator = void 0;
|
|
8
|
+
var _finalFormFocus = _interopRequireDefault(require("final-form-focus"));
|
|
9
|
+
/**
|
|
10
|
+
* `final-form-focus` ships only CJS for Node (no `exports` field), so in native ESM
|
|
11
|
+
* environments (e.g. Astro/Vite SSR) the default import resolves to the whole
|
|
12
|
+
* `module.exports` object (`{ default, getFormInputs }`) instead of the function.
|
|
13
|
+
*/
|
|
14
|
+
const createFocusDecorator = exports.createFocusDecorator = _finalFormFocus.default.default ?? _finalFormFocus.default;
|
|
15
|
+
//# sourceMappingURL=createFocusDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocusDecorator.js","names":["_finalFormFocus","_interopRequireDefault","require","createFocusDecorator","exports","createFocusDecoratorImport","default"],"sources":["../../../src/utils/createFocusDecorator.ts"],"sourcesContent":["import createFocusDecoratorImport from 'final-form-focus';\n\n/**\n * `final-form-focus` ships only CJS for Node (no `exports` field), so in native ESM\n * environments (e.g. Astro/Vite SSR) the default import resolves to the whole\n * `module.exports` object (`{ default, getFormInputs }`) instead of the function.\n */\nexport const createFocusDecorator: typeof createFocusDecoratorImport =\n (createFocusDecoratorImport as unknown as { default?: typeof createFocusDecoratorImport })\n .default ?? createFocusDecoratorImport;\n"],"mappings":";;;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA;AACA;AACA;AACA;AACA;AACO,MAAMC,oBAAuD,GAAAC,OAAA,CAAAD,oBAAA,GACjEE,uBAA0B,CACxBC,OAAO,IAAID,uBAA0B","ignoreList":[]}
|
package/lib/es6/FeedbackForm.js
CHANGED
|
@@ -9,22 +9,22 @@ import Button from '@semcore/button';
|
|
|
9
9
|
import { createComponent, Component, sstyled, Root } from '@semcore/core';
|
|
10
10
|
import { NoticeSmart } from '@semcore/notice';
|
|
11
11
|
import SpinContainer from '@semcore/spin-container';
|
|
12
|
-
import createFocusDecorator from 'final-form-focus';
|
|
13
12
|
import React from 'react';
|
|
14
13
|
import { Field, Form } from 'react-final-form';
|
|
15
14
|
import { FeedbackItem } from './component/feedback-item/FeedbackItem';
|
|
16
15
|
import { SubmitButton } from './component/submit-button/SubmitButton';
|
|
17
16
|
/*!__reshadow-styles__:"./style/feedback-form.shadow.css"*/
|
|
18
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
17
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SFeedbackForm_l0n9m_gg_{max-width:320px}.___SCancel_l0n9m_gg_,.___SSubmit_l0n9m_gg_{display:inline-flex;margin-right:var(--intergalactic-spacing-2x,8px)}.___SNotice_l0n9m_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_l0n9m_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_l0n9m_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\")}", /*__inner_css_end__*/"l0n9m_gg_"),
|
|
19
18
|
/*__reshadow_css_end__*/
|
|
20
19
|
{
|
|
21
|
-
"__SFeedbackForm": "
|
|
22
|
-
"__SSubmit": "
|
|
23
|
-
"__SCancel": "
|
|
24
|
-
"__SNotice": "
|
|
25
|
-
"__SSuccess": "
|
|
26
|
-
"__SEmail": "
|
|
20
|
+
"__SFeedbackForm": "___SFeedbackForm_l0n9m_gg_",
|
|
21
|
+
"__SSubmit": "___SSubmit_l0n9m_gg_",
|
|
22
|
+
"__SCancel": "___SCancel_l0n9m_gg_",
|
|
23
|
+
"__SNotice": "___SNotice_l0n9m_gg_",
|
|
24
|
+
"__SSuccess": "___SSuccess_l0n9m_gg_",
|
|
25
|
+
"__SEmail": "___SEmail_l0n9m_gg_"
|
|
27
26
|
});
|
|
27
|
+
import { createFocusDecorator } from './utils/createFocusDecorator';
|
|
28
28
|
class FeedbackForm extends Component {
|
|
29
29
|
constructor(...args) {
|
|
30
30
|
super(...args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackForm.js","names":["Box","Button","createComponent","Component","sstyled","Root","NoticeSmart","SpinContainer","
|
|
1
|
+
{"version":3,"file":"FeedbackForm.js","names":["Box","Button","createComponent","Component","sstyled","Root","NoticeSmart","SpinContainer","React","Field","Form","FeedbackItem","SubmitButton","style","_sstyled","insert","createFocusDecorator","FeedbackForm","constructor","args","_defineProperty","getItemProps","validateOnBlur","asProps","render","SFeedbackForm","Children","styles","forwardRef","loading","background","theme","other","createElement","_extends","decorators","focusDecorator","api","_ref4","cn","undefined","submitting","handleSubmit","origin","onSubmit","description","error","value","words","split","symbols","join","length","email","test","String","toLowerCase","Success","props","_ref","arguments[0]","_ref5","SSuccess","SEmail","_assignProps","Cancel","_ref2","_ref6","SCancel","_assignProps2","Notice","_ref3","_ref7","SNotice","_assignProps3","Item","Submit"],"sources":["../../src/FeedbackForm.tsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport { NoticeSmart } from '@semcore/notice';\nimport SpinContainer from '@semcore/spin-container';\nimport React from 'react';\nimport { Field, Form } from 'react-final-form';\n\nimport { FeedbackItem } from './component/feedback-item/FeedbackItem';\nimport { SubmitButton } from './component/submit-button/SubmitButton';\nimport type { NSFeedbackForm } from './FeedbackForm.type';\nimport style from './style/feedback-form.shadow.css';\nimport { createFocusDecorator } from './utils/createFocusDecorator';\n\nclass FeedbackForm extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSFeedbackForm.Component>,\n [],\n {},\n {},\n {},\n NSFeedbackForm.DefaultProps\n> {\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: string) => (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: string) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n getItemProps() {\n const { validateOnBlur } = this.asProps;\n\n return {\n validateOnBlur,\n };\n }\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, forwardRef, loading, background, theme, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer\n background={background}\n theme={theme}\n size='xl'\n loading={loading === undefined ? api.submitting : loading}\n >\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 </Form>\n );\n }\n}\n\nfunction Success(props: Intergalactic.InternalTypings.InferComponentProps<NSFeedbackForm.Success.Component>) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = 'div';\n\n return sstyled(styles)(\n <SSuccess render={Box} tabIndex={-1}>\n <SEmail aria-hidden={true} />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Cancel(props: Intergalactic.InternalTypings.InferComponentProps<NSFeedbackForm.Cancel.Component>) {\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: Intergalactic.InternalTypings.InferComponentProps<NSFeedbackForm.Notice.Component>) {\n const { styles, theme = 'muted' } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} use:theme={theme} />);\n}\n\n/**\n * FeedbackForm\n *\n * {@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}\n */\nexport default createComponent<\n NSFeedbackForm.Component,\n typeof FeedbackForm\n>(FeedbackForm, {\n Item: FeedbackItem,\n Success,\n Submit: SubmitButton,\n Cancel,\n Notice,\n});\n"],"mappings":";;;;;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,MAAM,MAAM,iBAAiB;AAEpC,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AACzE,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,OAAOC,aAAa,MAAM,yBAAyB;AACnD,OAAOC,KAAK,MAAM,OAAO;AACzB,SAASC,KAAK,EAAEC,IAAI,QAAQ,kBAAkB;AAE9C,SAASC,YAAY,QAAQ,wCAAwC;AACrE,SAASC,YAAY,QAAQ,wCAAwC;AAAC;AAAA,MAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAGtE,SAASC,oBAAoB,QAAQ,8BAA8B;AAEnE,MAAMC,YAAY,SAASd,SAAS,CAOlC;EAAAe,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,yBA2BiBJ,oBAAoB,CAAC,CAAC;EAAA;EAEvCK,YAAYA,CAAA,EAAG;IACb,MAAM;MAAEC;IAAe,CAAC,GAAG,IAAI,CAACC,OAAO;IAEvC,OAAO;MACLD;IACF,CAAC;EACH;EA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,OAAO,CAAC5C,KAAK,GAAGA,KAAK;AAErB,SAASoD,MAAMA,CAACP,KAAyF,EAAE;EAAA,IAAAQ,KAAA,GAAAN,YAAA;IAAAO,KAAA;EACzG,MAAM;IAAExC;EAAO,CAAC,GAAG+B,KAAK;EACxB,MAAMU,OAAO,GAC2BnE,MAAM;EAA9C,OAAAkE,KAAA,GAAO/D,OAAO,CAACuB,MAAM,CAAC,eAACnB,KAAA,CAAAyB,aAAA,CAACmC,OAAO,EAAAD,KAAA,CAAA5B,EAAA;IAAA,GAAA8B,aAAA;MAAA,QAAsB,OAAO;MAAA,OAAK,WAAW;MAAA,SAAO;IAAO,GAAAH,KAAA;EAAA,EAAE,CAAC;AAC/F;AAEA,SAASI,MAAMA,CAACZ,KAAyF,EAAE;EAAA,IAAAa,KAAA,GAAAX,YAAA;IAAAY,KAAA;EACzG,MAAM;IAAE7C,MAAM;IAAEI,KAAK,GAAG;EAAQ,CAAC,GAAG2B,KAAK;EACzC,MAAMe,OAAO,GAC2BnE,WAAW;EAAnD,OAAAkE,KAAA,GAAOpE,OAAO,CAACuB,MAAM,CAAC,eAACnB,KAAA,CAAAyB,aAAA,CAACwC,OAAO,EAAAD,KAAA,CAAAjC,EAAA;IAAA,GAAAmC,aAAA;MAAA,aAAiC3C;IAAK,GAAAwC,KAAA;EAAA,EAAG,CAAC;AAC3E;;AAEA;AACA;AACA;AACA;AACA;AACA,eAAerE,eAAe,CAG5Be,YAAY,EAAE;EACd0D,IAAI,EAAEhE,YAAY;EAClB8C,OAAO;EACPmB,MAAM,EAAEhE,YAAY;EACpBqD,MAAM;EACNK;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -19,7 +19,6 @@ import { NoticeBubbleContainer, NoticeBubbleManager } from '@semcore/notice-bubb
|
|
|
19
19
|
import SpinContainer from '@semcore/spin-container';
|
|
20
20
|
import Textarea from '@semcore/textarea';
|
|
21
21
|
import { Text } from '@semcore/typography';
|
|
22
|
-
import createFocusDecorator from 'final-form-focus';
|
|
23
22
|
import React from 'react';
|
|
24
23
|
import { Field, Form } from 'react-final-form';
|
|
25
24
|
import CheckboxButton from './component/checkbox-button/CheckboxButton';
|
|
@@ -27,13 +26,14 @@ import { FeedbackItem } from './component/feedback-item/FeedbackItem';
|
|
|
27
26
|
import SliderRating from './component/slider-rating/SliderRating';
|
|
28
27
|
import { SubmitButton } from './component/submit-button/SubmitButton';
|
|
29
28
|
/*!__reshadow-styles__:"./style/feedback-rating.shadow.css"*/
|
|
30
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
29
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SFeedbackRating_jjxpt_gg_ ul{margin:0;padding:0}.___SFeedbackRating_jjxpt_gg_ :is(li,ul){list-style:none}.___SFeedbackRating_jjxpt_gg_ .___SHeader_jjxpt_gg_{font-size:var(--intergalactic-fs-300,16px);line-height:var(--intergalactic-lh-300,1.5);font-weight:var(--intergalactic-bold,700);margin:var(--intergalactic-spacing-4x,16px) 0;text-align:center}", /*__inner_css_end__*/"jjxpt_gg_"),
|
|
31
30
|
/*__reshadow_css_end__*/
|
|
32
31
|
{
|
|
33
|
-
"__SFeedbackRating": "
|
|
34
|
-
"__SHeader": "
|
|
32
|
+
"__SFeedbackRating": "___SFeedbackRating_jjxpt_gg_",
|
|
33
|
+
"__SHeader": "___SHeader_jjxpt_gg_"
|
|
35
34
|
});
|
|
36
35
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
36
|
+
import { createFocusDecorator } from './utils/createFocusDecorator';
|
|
37
37
|
class FeedbackRatingRoot extends Component {
|
|
38
38
|
constructor(...args) {
|
|
39
39
|
super(...args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackRating.js","names":["Box","Flex","createComponent","Component","sstyled","Root","i18nEnhance","uniqueIDEnhancement","CheckM","WarnM","FeedbackIllustration","Input","Link","Modal","default","SemcoreNotice","NoticeBubbleContainer","NoticeBubbleManager","SpinContainer","Textarea","Text","createFocusDecorator","React","Field","Form","CheckboxButton","FeedbackItem","SliderRating","SubmitButton","style","_sstyled","insert","localizedMessages","FeedbackRatingRoot","constructor","args","_defineProperty","error","rating","asProps","onVisibleChange","fn","_value","e","config","index","initialValue","props","initialValues","key","createElement","name","type","input","FeedbackRating","Checkbox","_extends","id","label","onChange","_","focused","mb","size","isDescriptionReactFragment","description","Fragment","direction","tag","mt","htmlFor","Item","validate","placement","flip","fallbackPlacements","undefined","h","handleChange","autoComplete","state","Value","color","headerId","uid","getHeaderProps","getItemProps","validateOnBlur","getNoticeTextId","componentDidUpdate","prevProps","status","getI18nText","setState","setTimeout","manager","add","icon","children","initialAnimation","duration","render","_ref","_ref2","_ref4","header","submitText","formConfig","notificationText","notificationTitle","learnMoreLink","Children","_Children","styles","forwardRef","theme","background","visible","_onVisibleChange","notificationVisible","onNotificationClose","errorFeedbackEmail","modalWidth","Illustration","Notice","NoticeComponent","other","SFeedbackRating","checkboxFields","filter","item","textFields","notificationId","_assignProps2","cn","Label","mr","Content","Title","gap","alignItems","Actions","handleChangeRating","Close","onClick","_assignProps","handelCloseModal","focusDecorator","api","_ref5","submitting","Header","handleSubmit","map","formConfigItem","renderCheckbox","renderTextField","email","Submit","loading","onSubmit","i18n","locale","value","words","split","symbols","join","Boolean","length","test","String","toLowerCase","_ref3","arguments[0]","_ref6","SHeader","_assignProps3"],"sources":["../../src/FeedbackRating.tsx"],"sourcesContent":["import { Box, Flex } from '@semcore/base-components';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport CheckM from '@semcore/icon/Check/m';\nimport WarnM from '@semcore/icon/Warning/m';\nimport FeedbackIllustration from '@semcore/illustration/Feedback';\nimport Input from '@semcore/input';\nimport Link from '@semcore/link';\nimport Modal from '@semcore/modal';\nimport { default as SemcoreNotice } from '@semcore/notice';\nimport { NoticeBubbleContainer, NoticeBubbleManager } from '@semcore/notice-bubble';\nimport SpinContainer from '@semcore/spin-container';\nimport Textarea from '@semcore/textarea';\nimport { Text } from '@semcore/typography';\nimport createFocusDecorator from 'final-form-focus';\nimport React, { type ReactElement } from 'react';\nimport { Field, Form } from 'react-final-form';\n\nimport CheckboxButton from './component/checkbox-button/CheckboxButton';\nimport { FeedbackItem } from './component/feedback-item/FeedbackItem';\nimport SliderRating from './component/slider-rating/SliderRating';\nimport { SubmitButton } from './component/submit-button/SubmitButton';\nimport type { NSFeedbackRating } from './FeedbackRating.type';\nimport style from './style/feedback-rating.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\n\nclass FeedbackRatingRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSFeedbackRating.Component>,\n typeof FeedbackRatingRoot.enhance,\n {},\n WithI18nEnhanceProps,\n NSFeedbackRating.State,\n NSFeedbackRating.DefaultProps\n> {\n static displayName = 'FeedbackRatingForm';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages), uniqueIDEnhancement()] as const;\n\n static defaultProps: NSFeedbackRating.DefaultProps = {\n onSubmit: () => {},\n i18n: localizedMessages,\n locale: 'en',\n Illustration: FeedbackIllustration,\n Notice: SemcoreNotice,\n };\n\n static validate = {\n description: (error: Error | string) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (Boolean(value) && (symbols.length < 10 || words.length < 3)) {\n return error;\n }\n },\n email: (error: Error | string) => (value = '') => {\n if (Boolean(value) && !/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n state: NSFeedbackRating.State = {\n error: false,\n };\n\n manager = new NoticeBubbleManager();\n\n private focusDecorator = createFocusDecorator<Record<string, any>>();\n\n get headerId() {\n const { uid } = this.asProps;\n\n return `${uid}-feedback-rating-header`;\n }\n\n getHeaderProps() {\n return {\n id: this.headerId,\n };\n }\n\n getItemProps() {\n const { validateOnBlur } = this.asProps;\n\n return {\n validateOnBlur,\n };\n }\n\n getNoticeTextId() {\n const { uid } = this.asProps;\n return `${uid}-feedback-rating-notice`;\n }\n\n handleChangeRating = (rating: number) => {\n if (rating > 0) {\n this.asProps.onVisibleChange(true, rating);\n }\n };\n\n handelCloseModal = () => {\n this.asProps.onVisibleChange(false, this.asProps.rating);\n };\n\n handleChange =\n (fn: (e: React.SyntheticEvent) => void) => (_value: any, e: React.SyntheticEvent) => {\n fn(e);\n };\n\n componentDidUpdate(prevProps: typeof this.asProps) {\n const { status, getI18nText } = this.asProps;\n\n if (prevProps.status !== status) {\n this.setState({ error: false });\n\n if (status === 'success') {\n // showing notice with delay for SR, less than 100ms is not enough\n setTimeout(() => {\n this.manager.add({\n icon: <CheckM color='green-400' />,\n children: getI18nText('successMessage'),\n initialAnimation: true,\n duration: 5000,\n });\n }, 300);\n } else if (status === 'error') {\n this.setState({ error: true });\n }\n }\n }\n\n renderCheckbox = (config: NSFeedbackRating.FormConfigItem, index: number) => {\n const initialValue = this.props.initialValues[config.key];\n\n return (\n <Field name={config.key} initialValue={initialValue} type='checkbox' key={config.key}>\n {({ input }) => (\n <FeedbackRating.Checkbox\n {...input}\n id={config.key}\n label={config.label}\n onChange={(_: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => input.onChange(e)}\n focused={index === 0}\n />\n )}\n </Field>\n );\n };\n\n renderTextField = (config: NSFeedbackRating.FormConfigItem) => {\n const initialValue = this.props.initialValues[config.key];\n\n const label =\n typeof config.label === 'string'\n ? (\n <Text mb={2} size={200}>\n {config.label}\n </Text>\n )\n : (\n (config.label as unknown as JSX.Element)\n );\n\n const isDescriptionReactFragment =\n (config.description as ReactElement)?.type === React.Fragment;\n\n return (\n <Flex key={config.key} direction='column'>\n <Flex tag='label' mt={4} htmlFor={config.key}>\n {label}\n </Flex>\n\n <FeedbackRating.Item\n name={config.key}\n validate={config.validate}\n initialValue={initialValue}\n placement='left-start'\n flip={{\n fallbackPlacements: ['right-start', 'bottom'],\n }}\n aria-describedby={config.description ? config.key + '-description' : undefined}\n >\n {/* @ts-ignore */}\n {({ input }) => {\n if (config.type === 'textarea') {\n return (\n <Textarea\n {...input}\n h={80}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n );\n }\n if (config.type === 'input' || config.type === 'email') {\n if (config.type === 'email') {\n input.autoComplete = 'email';\n input.type = 'email';\n }\n\n return (\n <Input state={input.state}>\n <Input.Value\n {...input}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n </Input>\n );\n }\n return null;\n }}\n </FeedbackRating.Item>\n {config.description && (\n <Box mt={2}>\n {typeof config.description === 'string' || isDescriptionReactFragment\n ? (\n <Text size={200} color='text-secondary' id={config.key + '-description'}>\n {config.description}\n </Text>\n )\n : (\n config.description\n )}\n </Box>\n )}\n </Flex>\n );\n };\n\n render() {\n const {\n header,\n submitText,\n formConfig,\n notificationText,\n notificationTitle,\n learnMoreLink,\n Children: _Children,\n styles,\n forwardRef,\n status,\n theme,\n background,\n rating,\n visible,\n onVisibleChange: _onVisibleChange,\n notificationVisible,\n onNotificationClose,\n getI18nText,\n errorFeedbackEmail,\n modalWidth,\n Illustration,\n Notice: NoticeComponent,\n ...other\n } = this.asProps;\n\n const SFeedbackRating = Root;\n const checkboxFields = formConfig.filter((item) => item.type === 'checkbox');\n const textFields = formConfig.filter(\n (item) => item.type === 'textarea' || item.type === 'input' || item.type === 'email',\n );\n const notificationId = this.getNoticeTextId();\n\n return sstyled(styles)(\n <Root render={Box}>\n <NoticeComponent\n visible={notificationVisible}\n aria-label={getI18nText('leaveFeedback')}\n tag={Flex}\n alignItems={notificationTitle ? 'flex-start' : 'center'}\n >\n <NoticeComponent.Label mr={3} aria-hidden={true}>\n <Illustration primaryColor={Illustration === FeedbackIllustration ? 'illustration-blue' : undefined} />\n </NoticeComponent.Label>\n <NoticeComponent.Content>\n {notificationTitle ? <NoticeComponent.Title>{notificationTitle}</NoticeComponent.Title> : null}\n <NoticeComponent.Text gap={3} tag={Flex} alignItems={notificationTitle ? 'flex-start' : 'center'}>\n <Text id={notificationId}>\n {notificationText}\n </Text>\n <NoticeComponent.Actions mt={0}>\n <SliderRating\n value={rating}\n onChange={this.handleChangeRating}\n aria-labelledby={notificationId}\n />\n </NoticeComponent.Actions>\n {learnMoreLink && (\n <Link href={learnMoreLink}>\n {getI18nText('learnMore')}\n </Link>\n )}\n </NoticeComponent.Text>\n </NoticeComponent.Content>\n <NoticeComponent.Close onClick={onNotificationClose} />\n </NoticeComponent>\n\n <SFeedbackRating\n render={Modal}\n visible={visible}\n onClose={this.handelCloseModal}\n p={0}\n use:w={modalWidth ?? 440}\n aria-labelledby={this.headerId}\n >\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer\n background={background}\n theme={theme}\n size='xl'\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n p={1}\n m={9}\n >\n <Flex justifyContent='center'>\n <SliderRating value={rating} readonly={true} />\n </Flex>\n\n {(header as ReactElement)?.type === FeedbackRating.Header\n ? (\n header\n )\n : (\n <FeedbackRating.Header>{header}</FeedbackRating.Header>\n )}\n\n <Box\n tag='form'\n noValidate\n method='POST'\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n <Field name='rating' initialValue={rating}>\n {({ input }) => <input {...input} type='hidden' />}\n </Field>\n\n <div role='group' aria-labelledby={this.headerId}>\n {checkboxFields.map((formConfigItem, index) =>\n this.renderCheckbox(formConfigItem, index),\n )}\n </div>\n\n {textFields.map((formConfigItem) => this.renderTextField(formConfigItem))}\n\n {this.state.error && (\n <SemcoreNotice theme='warning' mt={4} mb={4}>\n <SemcoreNotice.Label>\n <WarnM />\n </SemcoreNotice.Label>\n <SemcoreNotice.Content>\n {getI18nText('errorMessage', {\n email: (\n <Link href={`mailto:${errorFeedbackEmail}`}>\n {errorFeedbackEmail}\n </Link>\n ),\n })}\n </SemcoreNotice.Content>\n </SemcoreNotice>\n )}\n\n <Flex mt={4} justifyContent='center'>\n <FeedbackRating.Submit\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n size='l'\n >\n {submitText ?? getI18nText('submitButton')}\n </FeedbackRating.Submit>\n </Flex>\n </Box>\n </SpinContainer>,\n )}\n </Form>\n </SFeedbackRating>\n\n <NoticeBubbleContainer manager={this.manager} />\n </Root>,\n );\n }\n}\n\nfunction Header(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSFeedbackRating.Header.Component, typeof FeedbackRatingRoot, 'Header'>,\n) {\n const { styles } = props;\n const SHeader = Root;\n return sstyled(styles)(\n <SHeader render={Modal.Title} />,\n );\n}\n\n/**\n * FeedbackRating\n *\n * {@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}\n */\nconst FeedbackRating = createComponent<\n NSFeedbackRating.Component,\n typeof FeedbackRatingRoot\n>(FeedbackRatingRoot, {\n Header,\n Item: FeedbackItem,\n Checkbox: CheckboxButton,\n Submit: SubmitButton,\n});\n\nexport default FeedbackRating;\n"],"mappings":";;;;;;AAAA,SAASA,GAAG,EAAEC,IAAI,QAAQ,0BAA0B;AACpD,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAGzE,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,MAAM,MAAM,uBAAuB;AAC1C,OAAOC,KAAK,MAAM,yBAAyB;AAC3C,OAAOC,oBAAoB,MAAM,gCAAgC;AACjE,OAAOC,KAAK,MAAM,gBAAgB;AAClC,OAAOC,IAAI,MAAM,eAAe;AAChC,OAAOC,KAAK,MAAM,gBAAgB;AAClC,SAASC,OAAO,IAAIC,aAAa,QAAQ,iBAAiB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AAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"FeedbackRating.js","names":["Box","Flex","createComponent","Component","sstyled","Root","i18nEnhance","uniqueIDEnhancement","CheckM","WarnM","FeedbackIllustration","Input","Link","Modal","default","SemcoreNotice","NoticeBubbleContainer","NoticeBubbleManager","SpinContainer","Textarea","Text","React","Field","Form","CheckboxButton","FeedbackItem","SliderRating","SubmitButton","style","_sstyled","insert","localizedMessages","createFocusDecorator","FeedbackRatingRoot","constructor","args","_defineProperty","error","rating","asProps","onVisibleChange","fn","_value","e","config","index","initialValue","props","initialValues","key","createElement","name","type","input","FeedbackRating","Checkbox","_extends","id","label","onChange","_","focused","mb","size","isDescriptionReactFragment","description","Fragment","direction","tag","mt","htmlFor","Item","validate","placement","flip","fallbackPlacements","undefined","h","handleChange","autoComplete","state","Value","color","headerId","uid","getHeaderProps","getItemProps","validateOnBlur","getNoticeTextId","componentDidUpdate","prevProps","status","getI18nText","setState","setTimeout","manager","add","icon","children","initialAnimation","duration","render","_ref","_ref2","_ref4","header","submitText","formConfig","notificationText","notificationTitle","learnMoreLink","Children","_Children","styles","forwardRef","theme","background","visible","_onVisibleChange","notificationVisible","onNotificationClose","errorFeedbackEmail","modalWidth","Illustration","Notice","NoticeComponent","other","SFeedbackRating","checkboxFields","filter","item","textFields","notificationId","_assignProps2","cn","Label","mr","Content","Title","gap","alignItems","Actions","handleChangeRating","Close","onClick","_assignProps","handelCloseModal","focusDecorator","api","_ref5","submitting","Header","handleSubmit","map","formConfigItem","renderCheckbox","renderTextField","email","Submit","loading","onSubmit","i18n","locale","value","words","split","symbols","join","Boolean","length","test","String","toLowerCase","_ref3","arguments[0]","_ref6","SHeader","_assignProps3"],"sources":["../../src/FeedbackRating.tsx"],"sourcesContent":["import { Box, Flex } from '@semcore/base-components';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport type { Intergalactic } from '@semcore/core';\nimport type { WithI18nEnhanceProps } from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';\nimport uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';\nimport CheckM from '@semcore/icon/Check/m';\nimport WarnM from '@semcore/icon/Warning/m';\nimport FeedbackIllustration from '@semcore/illustration/Feedback';\nimport Input from '@semcore/input';\nimport Link from '@semcore/link';\nimport Modal from '@semcore/modal';\nimport { default as SemcoreNotice } from '@semcore/notice';\nimport { NoticeBubbleContainer, NoticeBubbleManager } from '@semcore/notice-bubble';\nimport SpinContainer from '@semcore/spin-container';\nimport Textarea from '@semcore/textarea';\nimport { Text } from '@semcore/typography';\nimport React, { type ReactElement } from 'react';\nimport { Field, Form } from 'react-final-form';\n\nimport CheckboxButton from './component/checkbox-button/CheckboxButton';\nimport { FeedbackItem } from './component/feedback-item/FeedbackItem';\nimport SliderRating from './component/slider-rating/SliderRating';\nimport { SubmitButton } from './component/submit-button/SubmitButton';\nimport type { NSFeedbackRating } from './FeedbackRating.type';\nimport style from './style/feedback-rating.shadow.css';\nimport { localizedMessages } from './translations/__intergalactic-dynamic-locales';\nimport { createFocusDecorator } from './utils/createFocusDecorator';\n\nclass FeedbackRatingRoot extends Component<\n Intergalactic.InternalTypings.InferComponentProps<NSFeedbackRating.Component>,\n typeof FeedbackRatingRoot.enhance,\n {},\n WithI18nEnhanceProps,\n NSFeedbackRating.State,\n NSFeedbackRating.DefaultProps\n> {\n static displayName = 'FeedbackRatingForm';\n static style = style;\n\n static enhance = [i18nEnhance(localizedMessages), uniqueIDEnhancement()] as const;\n\n static defaultProps: NSFeedbackRating.DefaultProps = {\n onSubmit: () => {},\n i18n: localizedMessages,\n locale: 'en',\n Illustration: FeedbackIllustration,\n Notice: SemcoreNotice,\n };\n\n static validate = {\n description: (error: Error | string) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (Boolean(value) && (symbols.length < 10 || words.length < 3)) {\n return error;\n }\n },\n email: (error: Error | string) => (value = '') => {\n if (Boolean(value) && !/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n state: NSFeedbackRating.State = {\n error: false,\n };\n\n manager = new NoticeBubbleManager();\n\n private focusDecorator = createFocusDecorator<Record<string, any>>();\n\n get headerId() {\n const { uid } = this.asProps;\n\n return `${uid}-feedback-rating-header`;\n }\n\n getHeaderProps() {\n return {\n id: this.headerId,\n };\n }\n\n getItemProps() {\n const { validateOnBlur } = this.asProps;\n\n return {\n validateOnBlur,\n };\n }\n\n getNoticeTextId() {\n const { uid } = this.asProps;\n return `${uid}-feedback-rating-notice`;\n }\n\n handleChangeRating = (rating: number) => {\n if (rating > 0) {\n this.asProps.onVisibleChange(true, rating);\n }\n };\n\n handelCloseModal = () => {\n this.asProps.onVisibleChange(false, this.asProps.rating);\n };\n\n handleChange =\n (fn: (e: React.SyntheticEvent) => void) => (_value: any, e: React.SyntheticEvent) => {\n fn(e);\n };\n\n componentDidUpdate(prevProps: typeof this.asProps) {\n const { status, getI18nText } = this.asProps;\n\n if (prevProps.status !== status) {\n this.setState({ error: false });\n\n if (status === 'success') {\n // showing notice with delay for SR, less than 100ms is not enough\n setTimeout(() => {\n this.manager.add({\n icon: <CheckM color='green-400' />,\n children: getI18nText('successMessage'),\n initialAnimation: true,\n duration: 5000,\n });\n }, 300);\n } else if (status === 'error') {\n this.setState({ error: true });\n }\n }\n }\n\n renderCheckbox = (config: NSFeedbackRating.FormConfigItem, index: number) => {\n const initialValue = this.props.initialValues[config.key];\n\n return (\n <Field name={config.key} initialValue={initialValue} type='checkbox' key={config.key}>\n {({ input }) => (\n <FeedbackRating.Checkbox\n {...input}\n id={config.key}\n label={config.label}\n onChange={(_: boolean, e?: React.SyntheticEvent<HTMLInputElement>) => input.onChange(e)}\n focused={index === 0}\n />\n )}\n </Field>\n );\n };\n\n renderTextField = (config: NSFeedbackRating.FormConfigItem) => {\n const initialValue = this.props.initialValues[config.key];\n\n const label =\n typeof config.label === 'string'\n ? (\n <Text mb={2} size={200}>\n {config.label}\n </Text>\n )\n : (\n (config.label as unknown as JSX.Element)\n );\n\n const isDescriptionReactFragment =\n (config.description as ReactElement)?.type === React.Fragment;\n\n return (\n <Flex key={config.key} direction='column'>\n <Flex tag='label' mt={4} htmlFor={config.key}>\n {label}\n </Flex>\n\n <FeedbackRating.Item\n name={config.key}\n validate={config.validate}\n initialValue={initialValue}\n placement='left-start'\n flip={{\n fallbackPlacements: ['right-start', 'bottom'],\n }}\n aria-describedby={config.description ? config.key + '-description' : undefined}\n >\n {/* @ts-ignore */}\n {({ input }) => {\n if (config.type === 'textarea') {\n return (\n <Textarea\n {...input}\n h={80}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n );\n }\n if (config.type === 'input' || config.type === 'email') {\n if (config.type === 'email') {\n input.autoComplete = 'email';\n input.type = 'email';\n }\n\n return (\n <Input state={input.state}>\n <Input.Value\n {...input}\n onChange={this.handleChange(input.onChange)}\n id={config.key}\n />\n </Input>\n );\n }\n return null;\n }}\n </FeedbackRating.Item>\n {config.description && (\n <Box mt={2}>\n {typeof config.description === 'string' || isDescriptionReactFragment\n ? (\n <Text size={200} color='text-secondary' id={config.key + '-description'}>\n {config.description}\n </Text>\n )\n : (\n config.description\n )}\n </Box>\n )}\n </Flex>\n );\n };\n\n render() {\n const {\n header,\n submitText,\n formConfig,\n notificationText,\n notificationTitle,\n learnMoreLink,\n Children: _Children,\n styles,\n forwardRef,\n status,\n theme,\n background,\n rating,\n visible,\n onVisibleChange: _onVisibleChange,\n notificationVisible,\n onNotificationClose,\n getI18nText,\n errorFeedbackEmail,\n modalWidth,\n Illustration,\n Notice: NoticeComponent,\n ...other\n } = this.asProps;\n\n const SFeedbackRating = Root;\n const checkboxFields = formConfig.filter((item) => item.type === 'checkbox');\n const textFields = formConfig.filter(\n (item) => item.type === 'textarea' || item.type === 'input' || item.type === 'email',\n );\n const notificationId = this.getNoticeTextId();\n\n return sstyled(styles)(\n <Root render={Box}>\n <NoticeComponent\n visible={notificationVisible}\n aria-label={getI18nText('leaveFeedback')}\n tag={Flex}\n alignItems={notificationTitle ? 'flex-start' : 'center'}\n >\n <NoticeComponent.Label mr={3} aria-hidden={true}>\n <Illustration primaryColor={Illustration === FeedbackIllustration ? 'illustration-blue' : undefined} />\n </NoticeComponent.Label>\n <NoticeComponent.Content>\n {notificationTitle ? <NoticeComponent.Title>{notificationTitle}</NoticeComponent.Title> : null}\n <NoticeComponent.Text gap={3} tag={Flex} alignItems={notificationTitle ? 'flex-start' : 'center'}>\n <Text id={notificationId}>\n {notificationText}\n </Text>\n <NoticeComponent.Actions mt={0}>\n <SliderRating\n value={rating}\n onChange={this.handleChangeRating}\n aria-labelledby={notificationId}\n />\n </NoticeComponent.Actions>\n {learnMoreLink && (\n <Link href={learnMoreLink}>\n {getI18nText('learnMore')}\n </Link>\n )}\n </NoticeComponent.Text>\n </NoticeComponent.Content>\n <NoticeComponent.Close onClick={onNotificationClose} />\n </NoticeComponent>\n\n <SFeedbackRating\n render={Modal}\n visible={visible}\n onClose={this.handelCloseModal}\n p={0}\n use:w={modalWidth ?? 440}\n aria-labelledby={this.headerId}\n >\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer\n background={background}\n theme={theme}\n size='xl'\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n p={1}\n m={9}\n >\n <Flex justifyContent='center'>\n <SliderRating value={rating} readonly={true} />\n </Flex>\n\n {(header as ReactElement)?.type === FeedbackRating.Header\n ? (\n header\n )\n : (\n <FeedbackRating.Header>{header}</FeedbackRating.Header>\n )}\n\n <Box\n tag='form'\n noValidate\n method='POST'\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n <Field name='rating' initialValue={rating}>\n {({ input }) => <input {...input} type='hidden' />}\n </Field>\n\n <div role='group' aria-labelledby={this.headerId}>\n {checkboxFields.map((formConfigItem, index) =>\n this.renderCheckbox(formConfigItem, index),\n )}\n </div>\n\n {textFields.map((formConfigItem) => this.renderTextField(formConfigItem))}\n\n {this.state.error && (\n <SemcoreNotice theme='warning' mt={4} mb={4}>\n <SemcoreNotice.Label>\n <WarnM />\n </SemcoreNotice.Label>\n <SemcoreNotice.Content>\n {getI18nText('errorMessage', {\n email: (\n <Link href={`mailto:${errorFeedbackEmail}`}>\n {errorFeedbackEmail}\n </Link>\n ),\n })}\n </SemcoreNotice.Content>\n </SemcoreNotice>\n )}\n\n <Flex mt={4} justifyContent='center'>\n <FeedbackRating.Submit\n loading={status !== 'loading' ? api.submitting : status === 'loading'}\n size='l'\n >\n {submitText ?? getI18nText('submitButton')}\n </FeedbackRating.Submit>\n </Flex>\n </Box>\n </SpinContainer>,\n )}\n </Form>\n </SFeedbackRating>\n\n <NoticeBubbleContainer manager={this.manager} />\n </Root>,\n );\n }\n}\n\nfunction Header(\n props: Intergalactic.InternalTypings.InferChildComponentProps<NSFeedbackRating.Header.Component, typeof FeedbackRatingRoot, 'Header'>,\n) {\n const { styles } = props;\n const SHeader = Root;\n return sstyled(styles)(\n <SHeader render={Modal.Title} />,\n );\n}\n\n/**\n * FeedbackRating\n *\n * {@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}\n */\nconst FeedbackRating = createComponent<\n NSFeedbackRating.Component,\n typeof FeedbackRatingRoot\n>(FeedbackRatingRoot, {\n Header,\n Item: FeedbackItem,\n Checkbox: CheckboxButton,\n Submit: SubmitButton,\n});\n\nexport default FeedbackRating;\n"],"mappings":";;;;;;AAAA,SAASA,GAAG,EAAEC,IAAI,QAAQ,0BAA0B;AACpD,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,eAAe;AAGzE,OAAOC,WAAW,MAAM,8CAA8C;AACtE,OAAOC,mBAAmB,MAAM,kCAAkC;AAClE,OAAOC,MAAM,MAAM,uBAAuB;AAC1C,OAAOC,KAAK,MAAM,yBAAyB;AAC3C,O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vH,cAAc,GAAGpD,eAAe,CAGpC+B,kBAAkB,EAAE;EACpBsH,MAAM;EACNhF,IAAI,EAAE9C,YAAY;EAClB8B,QAAQ,EAAE/B,cAAc;EACxBsI,MAAM,EAAEnI;AACV,CAAC,CAAC;AAEF,eAAe2B,cAAc","ignoreList":[]}
|
|
@@ -6,11 +6,11 @@ import Checkbox from '@semcore/checkbox';
|
|
|
6
6
|
import { createComponent, Component, Root, sstyled } from '@semcore/core';
|
|
7
7
|
import React from 'react';
|
|
8
8
|
/*!__reshadow-styles__:"../../style/checkbox-button.shadow.css"*/
|
|
9
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
9
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SCheckboxButton_emy2e_gg_{margin-top:var(--intergalactic-spacing-2x,8px);background-color:var(--intergalactic-control-checkbox-button-bg-normal,#0000);border:1px solid var(--intergalactic-control-checkbox-button-border,oklch(.277 .066 242.6/.18));border-radius:var(--intergalactic-control-rounded,6px)}.___SCheckboxButton_emy2e_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x,12px);box-sizing:border-box}.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_{cursor:pointer;background-color:var(--intergalactic-control-checkbox-button-bg-hover,oklch(.375 .09 242.7/.05))}@media (hover:hover){.___SCheckboxButton_emy2e_gg_:hover{cursor:pointer;background-color:var(--intergalactic-control-checkbox-button-bg-hover,oklch(.375 .09 242.7/.05))}}.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_{border-color:var(--intergalactic-control-checkbox-button-border-selected,oklch(.277 .066 242.6/.18))}@media (hover:hover){.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_:hover{background-color:var(--intergalactic-control-checkbox-button-bg-selected-hover,oklch(.344 .082 242.3/.065))}}", /*__inner_css_end__*/"emy2e_gg_"),
|
|
10
10
|
/*__reshadow_css_end__*/
|
|
11
11
|
{
|
|
12
|
-
"__SCheckboxButton": "
|
|
13
|
-
"_checked": "
|
|
12
|
+
"__SCheckboxButton": "___SCheckboxButton_emy2e_gg_",
|
|
13
|
+
"_checked": "__checked_emy2e_gg_"
|
|
14
14
|
});
|
|
15
15
|
class CheckboxButtonRoot extends Component {
|
|
16
16
|
constructor(...args) {
|
|
@@ -9,14 +9,14 @@ import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
|
9
9
|
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
10
10
|
import React from 'react';
|
|
11
11
|
/*!__reshadow-styles__:"../../style/slider-rating.shadow.css"*/
|
|
12
|
-
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
12
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SSliderRating_1ftt8_gg_ .___SStar_1ftt8_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}.___SSliderRating_1ftt8_gg_:focus-visible .___SStar_1ftt8_gg_.__hovered_1ftt8_gg_{cursor:pointer;transform:scale(1.3)}@media (hover:hover){.___SSliderRating_1ftt8_gg_ .___SStar_1ftt8_gg_:hover{cursor:pointer;transform:scale(1.3)}.___SSliderRating_1ftt8_gg_.__readonly_1ftt8_gg_ .___SStar_1ftt8_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_1ftt8_gg_.__filled_1ftt8_gg_:active{animation:wobble .8s ease-in-out}.___SStar_1ftt8_gg_ path{fill:var(--intergalactic-control-slider-rating-icon,#0016298f)}@media (color-gamut:p3){.___SStar_1ftt8_gg_ path{fill:var(--intergalactic-control-slider-rating-icon,oklch(.193 .05 246/.562))}}.___SStar_1ftt8_gg_.__filled_1ftt8_gg_ path{stroke-width:0;fill:var(--intergalactic-control-slider-rating-icon-hover-active,oklch(.22 .008 245))}", /*__inner_css_end__*/"1ftt8_gg_"),
|
|
13
13
|
/*__reshadow_css_end__*/
|
|
14
14
|
{
|
|
15
|
-
"__SSliderRating": "
|
|
16
|
-
"__SStar": "
|
|
17
|
-
"_hovered": "
|
|
18
|
-
"_readonly": "
|
|
19
|
-
"_filled": "
|
|
15
|
+
"__SSliderRating": "___SSliderRating_1ftt8_gg_",
|
|
16
|
+
"__SStar": "___SStar_1ftt8_gg_",
|
|
17
|
+
"_hovered": "__hovered_1ftt8_gg_",
|
|
18
|
+
"_readonly": "__readonly_1ftt8_gg_",
|
|
19
|
+
"_filled": "__filled_1ftt8_gg_"
|
|
20
20
|
});
|
|
21
21
|
import { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
22
22
|
const MIN = 1;
|
package/lib/es6/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["default","FeedbackRating"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as FeedbackRating } from './FeedbackRating';\n\nexport { default } from './FeedbackForm';\nexport * from './FeedbackForm.type';\n\nexport { FeedbackRating };\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,cAAc,QAAQ,kBAAkB;AAE5D,SAASD,OAAO,QAAQ,gBAAgB;AACxC,cAAc,qBAAqB;AAEnC,SAASC,cAAc","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"index.js","names":["default","FeedbackRating"],"sources":["../../src/index.ts"],"sourcesContent":["import { default as FeedbackRating } from './FeedbackRating';\n\nexport { default } from './FeedbackForm';\nexport * from './FeedbackForm.type';\n\nexport { FeedbackRating };\nexport type { NSFeedbackRating } from './FeedbackRating.type';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,cAAc,QAAQ,kBAAkB;AAE5D,SAASD,OAAO,QAAQ,gBAAgB;AACxC,cAAc,qBAAqB;AAEnC,SAASC,cAAc","ignoreList":[]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import createFocusDecoratorImport from 'final-form-focus';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* `final-form-focus` ships only CJS for Node (no `exports` field), so in native ESM
|
|
5
|
+
* environments (e.g. Astro/Vite SSR) the default import resolves to the whole
|
|
6
|
+
* `module.exports` object (`{ default, getFormInputs }`) instead of the function.
|
|
7
|
+
*/
|
|
8
|
+
export const createFocusDecorator = createFocusDecoratorImport.default ?? createFocusDecoratorImport;
|
|
9
|
+
//# sourceMappingURL=createFocusDecorator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocusDecorator.js","names":["createFocusDecoratorImport","createFocusDecorator","default"],"sources":["../../../src/utils/createFocusDecorator.ts"],"sourcesContent":["import createFocusDecoratorImport from 'final-form-focus';\n\n/**\n * `final-form-focus` ships only CJS for Node (no `exports` field), so in native ESM\n * environments (e.g. Astro/Vite SSR) the default import resolves to the whole\n * `module.exports` object (`{ default, getFormInputs }`) instead of the function.\n */\nexport const createFocusDecorator: typeof createFocusDecoratorImport =\n (createFocusDecoratorImport as unknown as { default?: typeof createFocusDecoratorImport })\n .default ?? createFocusDecoratorImport;\n"],"mappings":"AAAA,OAAOA,0BAA0B,MAAM,kBAAkB;;AAEzD;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,oBAAuD,GACjED,0BAA0B,CACxBE,OAAO,IAAIF,0BAA0B","ignoreList":[]}
|
package/lib/esm/FeedbackForm.mjs
CHANGED
|
@@ -5,27 +5,27 @@ import { Box } from "@semcore/base-components";
|
|
|
5
5
|
import Button from "@semcore/button";
|
|
6
6
|
import { NoticeSmart } from "@semcore/notice";
|
|
7
7
|
import SpinContainer from "@semcore/spin-container";
|
|
8
|
-
import createFocusDecorator from "final-form-focus";
|
|
9
8
|
import React from "react";
|
|
10
9
|
import { Form, Field } from "react-final-form";
|
|
11
10
|
import { FeedbackItem } from "./component/feedback-item/FeedbackItem.mjs";
|
|
12
11
|
import { SubmitButton } from "./component/submit-button/SubmitButton.mjs";
|
|
12
|
+
import { createFocusDecorator } from "./utils/createFocusDecorator.mjs";
|
|
13
13
|
/*!__reshadow-styles__:"./style/feedback-form.shadow.css"*/
|
|
14
14
|
const style = (
|
|
15
15
|
/*__reshadow_css_start__*/
|
|
16
16
|
(sstyled.insert(
|
|
17
17
|
/*__inner_css_start__*/
|
|
18
|
-
`.
|
|
18
|
+
`.___SFeedbackForm_l0n9m_gg_{max-width:320px}.___SCancel_l0n9m_gg_,.___SSubmit_l0n9m_gg_{display:inline-flex;margin-right:var(--intergalactic-spacing-2x,8px)}.___SNotice_l0n9m_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_l0n9m_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_l0n9m_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
|
-
"
|
|
20
|
+
"l0n9m_gg_"
|
|
21
21
|
), /*__reshadow_css_end__*/
|
|
22
22
|
{
|
|
23
|
-
"__SFeedbackForm": "
|
|
24
|
-
"__SSubmit": "
|
|
25
|
-
"__SCancel": "
|
|
26
|
-
"__SNotice": "
|
|
27
|
-
"__SSuccess": "
|
|
28
|
-
"__SEmail": "
|
|
23
|
+
"__SFeedbackForm": "___SFeedbackForm_l0n9m_gg_",
|
|
24
|
+
"__SSubmit": "___SSubmit_l0n9m_gg_",
|
|
25
|
+
"__SCancel": "___SCancel_l0n9m_gg_",
|
|
26
|
+
"__SNotice": "___SNotice_l0n9m_gg_",
|
|
27
|
+
"__SSuccess": "___SSuccess_l0n9m_gg_",
|
|
28
|
+
"__SEmail": "___SEmail_l0n9m_gg_"
|
|
29
29
|
})
|
|
30
30
|
);
|
|
31
31
|
class FeedbackForm extends Component {
|
|
@@ -15,7 +15,6 @@ import { NoticeBubbleManager, NoticeBubbleContainer } from "@semcore/notice-bubb
|
|
|
15
15
|
import SpinContainer from "@semcore/spin-container";
|
|
16
16
|
import Textarea from "@semcore/textarea";
|
|
17
17
|
import { Text } from "@semcore/typography";
|
|
18
|
-
import createFocusDecorator from "final-form-focus";
|
|
19
18
|
import React from "react";
|
|
20
19
|
import { Field, Form } from "react-final-form";
|
|
21
20
|
import CheckboxButton from "./component/checkbox-button/CheckboxButton.mjs";
|
|
@@ -23,18 +22,19 @@ import { FeedbackItem } from "./component/feedback-item/FeedbackItem.mjs";
|
|
|
23
22
|
import SliderRating from "./component/slider-rating/SliderRating.mjs";
|
|
24
23
|
import { SubmitButton } from "./component/submit-button/SubmitButton.mjs";
|
|
25
24
|
import { localizedMessages } from "./translations/__intergalactic-dynamic-locales.mjs";
|
|
25
|
+
import { createFocusDecorator } from "./utils/createFocusDecorator.mjs";
|
|
26
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
|
-
".
|
|
31
|
+
".___SFeedbackRating_jjxpt_gg_ ul{margin:0;padding:0}.___SFeedbackRating_jjxpt_gg_ :is(li,ul){list-style:none}.___SFeedbackRating_jjxpt_gg_ .___SHeader_jjxpt_gg_{font-size:var(--intergalactic-fs-300,16px);line-height:var(--intergalactic-lh-300,1.5);font-weight:var(--intergalactic-bold,700);margin:var(--intergalactic-spacing-4x,16px) 0;text-align:center}",
|
|
32
32
|
/*__inner_css_end__*/
|
|
33
|
-
"
|
|
33
|
+
"jjxpt_gg_"
|
|
34
34
|
), /*__reshadow_css_end__*/
|
|
35
35
|
{
|
|
36
|
-
"__SFeedbackRating": "
|
|
37
|
-
"__SHeader": "
|
|
36
|
+
"__SFeedbackRating": "___SFeedbackRating_jjxpt_gg_",
|
|
37
|
+
"__SHeader": "___SHeader_jjxpt_gg_"
|
|
38
38
|
})
|
|
39
39
|
);
|
|
40
40
|
class FeedbackRatingRoot extends Component {
|
|
@@ -8,13 +8,13 @@ const style = (
|
|
|
8
8
|
/*__reshadow_css_start__*/
|
|
9
9
|
(sstyled.insert(
|
|
10
10
|
/*__inner_css_start__*/
|
|
11
|
-
".
|
|
11
|
+
".___SCheckboxButton_emy2e_gg_{margin-top:var(--intergalactic-spacing-2x,8px);background-color:var(--intergalactic-control-checkbox-button-bg-normal,#0000);border:1px solid var(--intergalactic-control-checkbox-button-border,oklch(.277 .066 242.6/.18));border-radius:var(--intergalactic-control-rounded,6px)}.___SCheckboxButton_emy2e_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x,12px);box-sizing:border-box}.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_{cursor:pointer;background-color:var(--intergalactic-control-checkbox-button-bg-hover,oklch(.375 .09 242.7/.05))}@media (hover:hover){.___SCheckboxButton_emy2e_gg_:hover{cursor:pointer;background-color:var(--intergalactic-control-checkbox-button-bg-hover,oklch(.375 .09 242.7/.05))}}.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_{border-color:var(--intergalactic-control-checkbox-button-border-selected,oklch(.277 .066 242.6/.18))}@media (hover:hover){.___SCheckboxButton_emy2e_gg_.__checked_emy2e_gg_:hover{background-color:var(--intergalactic-control-checkbox-button-bg-selected-hover,oklch(.344 .082 242.3/.065))}}",
|
|
12
12
|
/*__inner_css_end__*/
|
|
13
|
-
"
|
|
13
|
+
"emy2e_gg_"
|
|
14
14
|
), /*__reshadow_css_end__*/
|
|
15
15
|
{
|
|
16
|
-
"__SCheckboxButton": "
|
|
17
|
-
"_checked": "
|
|
16
|
+
"__SCheckboxButton": "___SCheckboxButton_emy2e_gg_",
|
|
17
|
+
"_checked": "__checked_emy2e_gg_"
|
|
18
18
|
})
|
|
19
19
|
);
|
|
20
20
|
class CheckboxButtonRoot extends Component {
|
|
@@ -10,16 +10,16 @@ const style = (
|
|
|
10
10
|
/*__reshadow_css_start__*/
|
|
11
11
|
(sstyled.insert(
|
|
12
12
|
/*__inner_css_start__*/
|
|
13
|
-
".
|
|
13
|
+
".___SSliderRating_1ftt8_gg_ .___SStar_1ftt8_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}.___SSliderRating_1ftt8_gg_:focus-visible .___SStar_1ftt8_gg_.__hovered_1ftt8_gg_{cursor:pointer;transform:scale(1.3)}@media (hover:hover){.___SSliderRating_1ftt8_gg_ .___SStar_1ftt8_gg_:hover{cursor:pointer;transform:scale(1.3)}.___SSliderRating_1ftt8_gg_.__readonly_1ftt8_gg_ .___SStar_1ftt8_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_1ftt8_gg_.__filled_1ftt8_gg_:active{animation:wobble .8s ease-in-out}.___SStar_1ftt8_gg_ path{fill:var(--intergalactic-control-slider-rating-icon,#0016298f)}@media (color-gamut:p3){.___SStar_1ftt8_gg_ path{fill:var(--intergalactic-control-slider-rating-icon,oklch(.193 .05 246/.562))}}.___SStar_1ftt8_gg_.__filled_1ftt8_gg_ path{stroke-width:0;fill:var(--intergalactic-control-slider-rating-icon-hover-active,oklch(.22 .008 245))}",
|
|
14
14
|
/*__inner_css_end__*/
|
|
15
|
-
"
|
|
15
|
+
"1ftt8_gg_"
|
|
16
16
|
), /*__reshadow_css_end__*/
|
|
17
17
|
{
|
|
18
|
-
"__SSliderRating": "
|
|
19
|
-
"__SStar": "
|
|
20
|
-
"_hovered": "
|
|
21
|
-
"_readonly": "
|
|
22
|
-
"_filled": "
|
|
18
|
+
"__SSliderRating": "___SSliderRating_1ftt8_gg_",
|
|
19
|
+
"__SStar": "___SStar_1ftt8_gg_",
|
|
20
|
+
"_hovered": "__hovered_1ftt8_gg_",
|
|
21
|
+
"_readonly": "__readonly_1ftt8_gg_",
|
|
22
|
+
"_filled": "__filled_1ftt8_gg_"
|
|
23
23
|
})
|
|
24
24
|
);
|
|
25
25
|
const MIN = 1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackForm.d.ts","sourceRoot":"","sources":["../../src/FeedbackForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FeedbackForm.d.ts","sourceRoot":"","sources":["../../src/FeedbackForm.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA4G1D;;;;GAIG;;AACH,wBASG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackRating.d.ts","sourceRoot":"","sources":["../../src/FeedbackRating.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FeedbackRating.d.ts","sourceRoot":"","sources":["../../src/FeedbackRating.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AAwX9D;;;;GAIG;AACH,QAAA,MAAM,cAAc,4BAQlB,CAAC;AAEH,eAAe,cAAc,CAAC"}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import { default as FeedbackRating } from './FeedbackRating';
|
|
|
2
2
|
export { default } from './FeedbackForm';
|
|
3
3
|
export * from './FeedbackForm.type';
|
|
4
4
|
export { FeedbackRating };
|
|
5
|
+
export type { NSFeedbackRating } from './FeedbackRating.type';
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/types/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAE7D,OAAO,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACzC,cAAc,qBAAqB,CAAC;AAEpC,OAAO,EAAE,cAAc,EAAE,CAAC;AAC1B,YAAY,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import createFocusDecoratorImport from 'final-form-focus';
|
|
2
|
+
/**
|
|
3
|
+
* `final-form-focus` ships only CJS for Node (no `exports` field), so in native ESM
|
|
4
|
+
* environments (e.g. Astro/Vite SSR) the default import resolves to the whole
|
|
5
|
+
* `module.exports` object (`{ default, getFormInputs }`) instead of the function.
|
|
6
|
+
*/
|
|
7
|
+
export declare const createFocusDecorator: typeof createFocusDecoratorImport;
|
|
8
|
+
//# sourceMappingURL=createFocusDecorator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createFocusDecorator.d.ts","sourceRoot":"","sources":["../../../src/utils/createFocusDecorator.ts"],"names":[],"mappings":"AAAA,OAAO,0BAA0B,MAAM,kBAAkB,CAAC;AAE1D;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,0BAEA,CAAC"}
|
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": "18.
|
|
4
|
+
"version": "18.1.0-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
"require": "./lib/cjs/index.js"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/checkbox": "^18.0.
|
|
18
|
-
"@semcore/notice-bubble": "^18.0.0-prerelease.
|
|
19
|
-
"@semcore/typography": "^18.0.0-prerelease.
|
|
20
|
-
"@semcore/link": "^18.0.0-prerelease.
|
|
21
|
-
"@semcore/modal": "^18.0.0-prerelease.
|
|
22
|
-
"@semcore/illustration": "^18.0.0
|
|
23
|
-
"@semcore/textarea": "^18.0.0
|
|
24
|
-
"@semcore/input": "^18.0.0
|
|
25
|
-
"@semcore/button": "^18.0.0
|
|
26
|
-
"@semcore/notice": "^18.0.0-prerelease.
|
|
27
|
-
"@semcore/spin-container": "^18.0.
|
|
28
|
-
"@semcore/tooltip": "^18.0.0
|
|
17
|
+
"@semcore/checkbox": "^18.0.1-prerelease.0",
|
|
18
|
+
"@semcore/notice-bubble": "^18.0.0-prerelease.0",
|
|
19
|
+
"@semcore/typography": "^18.0.0-prerelease.0",
|
|
20
|
+
"@semcore/link": "^18.0.0-prerelease.0",
|
|
21
|
+
"@semcore/modal": "^18.0.0-prerelease.0",
|
|
22
|
+
"@semcore/illustration": "^18.0.0",
|
|
23
|
+
"@semcore/textarea": "^18.0.0",
|
|
24
|
+
"@semcore/input": "^18.0.0",
|
|
25
|
+
"@semcore/button": "^18.0.0",
|
|
26
|
+
"@semcore/notice": "^18.0.0-prerelease.0",
|
|
27
|
+
"@semcore/spin-container": "^18.0.1-prerelease.0",
|
|
28
|
+
"@semcore/tooltip": "^18.0.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@semcore/base-components": "^18.0.0-prerelease.
|
|
32
|
-
"@semcore/icon": "^18.0.
|
|
31
|
+
"@semcore/base-components": "^18.0.0-prerelease.0",
|
|
32
|
+
"@semcore/icon": "^18.0.1-prerelease.0",
|
|
33
33
|
"final-form": "^4.20.7",
|
|
34
34
|
"final-form-focus": "^1.1.2",
|
|
35
35
|
"react-final-form": "^6.5.9"
|
|
@@ -44,11 +44,11 @@
|
|
|
44
44
|
"final-form": "4.20.7",
|
|
45
45
|
"final-form-focus": "1.1.2",
|
|
46
46
|
"react-final-form": "6.5.9",
|
|
47
|
-
"@semcore/
|
|
48
|
-
"@semcore/
|
|
47
|
+
"@semcore/base-components": "18.0.0-prerelease.0",
|
|
48
|
+
"@semcore/core": "18.0.1-prerelease.0",
|
|
49
49
|
"@semcore/testing-utils": "1.0.0",
|
|
50
|
-
"@semcore/
|
|
51
|
-
"@semcore/icon": "18.0.
|
|
50
|
+
"@semcore/notice": "18.0.0-prerelease.0",
|
|
51
|
+
"@semcore/icon": "18.0.1-prerelease.0"
|
|
52
52
|
},
|
|
53
53
|
"overrides": {
|
|
54
54
|
"final-form": {
|