@semcore/feedback-form 6.27.2 → 6.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/lib/cjs/FeedbackForm.js +28 -86
  3. package/lib/cjs/FeedbackForm.js.map +1 -1
  4. package/lib/cjs/component/checkbox-button/CheckboxButton.js +58 -0
  5. package/lib/cjs/component/checkbox-button/CheckboxButton.js.map +1 -0
  6. package/lib/cjs/component/feedback-item/FeedbackItem.js +63 -0
  7. package/lib/cjs/component/feedback-item/FeedbackItem.js.map +1 -0
  8. package/lib/cjs/component/feedback-rating/FeedbackRating.js +360 -0
  9. package/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -0
  10. package/lib/cjs/component/feedback-rating/FeedbackRating.type.js +2 -0
  11. package/lib/cjs/component/feedback-rating/FeedbackRating.type.js.map +1 -0
  12. package/lib/cjs/component/slider-rating/SliderRating.js +172 -0
  13. package/lib/cjs/component/slider-rating/SliderRating.js.map +1 -0
  14. package/lib/cjs/component/submit-button/SubmitButton.js +23 -0
  15. package/lib/cjs/component/submit-button/SubmitButton.js.map +1 -0
  16. package/lib/cjs/index.d.js +12 -0
  17. package/lib/cjs/index.d.js.map +1 -1
  18. package/lib/cjs/index.js +7 -0
  19. package/lib/cjs/index.js.map +1 -1
  20. package/lib/cjs/style/checkbox-button.shadow.css +21 -0
  21. package/lib/cjs/style/feedback-rating.shadow.css +9 -0
  22. package/lib/cjs/style/slider-rating.shadow.css +34 -0
  23. package/lib/cjs/translations/__intergalactic-dynamic-locales.js +39 -0
  24. package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -0
  25. package/lib/cjs/translations/de.json +7 -0
  26. package/lib/cjs/translations/en.json +8 -0
  27. package/lib/cjs/translations/es.json +7 -0
  28. package/lib/cjs/translations/fr.json +7 -0
  29. package/lib/cjs/translations/it.json +7 -0
  30. package/lib/cjs/translations/ja.json +7 -0
  31. package/lib/cjs/translations/ko.json +7 -0
  32. package/lib/cjs/translations/nl.json +7 -0
  33. package/lib/cjs/translations/pl.json +7 -0
  34. package/lib/cjs/translations/pt.json +7 -0
  35. package/lib/cjs/translations/sv.json +7 -0
  36. package/lib/cjs/translations/tr.json +7 -0
  37. package/lib/cjs/translations/vi.json +7 -0
  38. package/lib/cjs/translations/zh.json +7 -0
  39. package/lib/es6/FeedbackForm.js +28 -88
  40. package/lib/es6/FeedbackForm.js.map +1 -1
  41. package/lib/es6/component/checkbox-button/CheckboxButton.js +50 -0
  42. package/lib/es6/component/checkbox-button/CheckboxButton.js.map +1 -0
  43. package/lib/es6/component/feedback-item/FeedbackItem.js +56 -0
  44. package/lib/es6/component/feedback-item/FeedbackItem.js.map +1 -0
  45. package/lib/es6/component/feedback-rating/FeedbackRating.js +354 -0
  46. package/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -0
  47. package/lib/es6/component/feedback-rating/FeedbackRating.type.js +2 -0
  48. package/lib/es6/component/feedback-rating/FeedbackRating.type.js.map +1 -0
  49. package/lib/es6/component/slider-rating/SliderRating.js +165 -0
  50. package/lib/es6/component/slider-rating/SliderRating.js.map +1 -0
  51. package/lib/es6/component/submit-button/SubmitButton.js +17 -0
  52. package/lib/es6/component/submit-button/SubmitButton.js.map +1 -0
  53. package/lib/es6/index.d.js +5 -1
  54. package/lib/es6/index.d.js.map +1 -1
  55. package/lib/es6/index.js +2 -0
  56. package/lib/es6/index.js.map +1 -1
  57. package/lib/es6/style/checkbox-button.shadow.css +21 -0
  58. package/lib/es6/style/feedback-rating.shadow.css +9 -0
  59. package/lib/es6/style/slider-rating.shadow.css +34 -0
  60. package/lib/es6/translations/__intergalactic-dynamic-locales.js +31 -0
  61. package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -0
  62. package/lib/es6/translations/de.json +7 -0
  63. package/lib/es6/translations/en.json +8 -0
  64. package/lib/es6/translations/es.json +7 -0
  65. package/lib/es6/translations/fr.json +7 -0
  66. package/lib/es6/translations/it.json +7 -0
  67. package/lib/es6/translations/ja.json +7 -0
  68. package/lib/es6/translations/ko.json +7 -0
  69. package/lib/es6/translations/nl.json +7 -0
  70. package/lib/es6/translations/pl.json +7 -0
  71. package/lib/es6/translations/pt.json +7 -0
  72. package/lib/es6/translations/sv.json +7 -0
  73. package/lib/es6/translations/tr.json +7 -0
  74. package/lib/es6/translations/vi.json +7 -0
  75. package/lib/es6/translations/zh.json +7 -0
  76. package/lib/types/component/checkbox-button/CheckboxButton.d.ts +4 -0
  77. package/lib/types/component/feedback-item/FeedbackItem.d.ts +7 -0
  78. package/lib/types/component/feedback-rating/FeedbackRating.d.ts +156 -0
  79. package/lib/types/component/feedback-rating/FeedbackRating.type.d.ts +55 -0
  80. package/lib/types/component/slider-rating/SliderRating.d.ts +14 -0
  81. package/lib/types/component/submit-button/SubmitButton.d.ts +3 -0
  82. package/lib/types/index.d.ts +4 -0
  83. package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +101 -0
  84. package/package.json +18 -8
@@ -0,0 +1,156 @@
1
+ import React from 'react';
2
+ import { Component } from '@semcore/core';
3
+ import { useI18n } from '@semcore/utils/lib/enhances/WithI18n';
4
+ import uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';
5
+ import { FeedbackRatingProps, FeedbackRatingType, FormConfigItem } from './FeedbackRating.type';
6
+ import { NoticeBubbleManager } from '@semcore/notice-bubble';
7
+ type Enhances = {
8
+ getI18nText: ReturnType<typeof useI18n>;
9
+ uid: ReturnType<typeof uniqueIDEnhancement>;
10
+ };
11
+ type State = {
12
+ error: boolean;
13
+ };
14
+ declare class FeedbackRatingRoot extends Component<FeedbackRatingProps, {}, State, Enhances> {
15
+ static displayName: string;
16
+ static style: {
17
+ [key: string]: string;
18
+ };
19
+ static enhance: (((props: any) => {
20
+ uid: string;
21
+ }) | ((props: any) => {
22
+ getI18nText: (messageId: string, variables?: {
23
+ [key: string]: string | number | undefined;
24
+ } | undefined) => string;
25
+ }))[];
26
+ static defaultProps: {
27
+ onSubmit: () => void;
28
+ i18n: {
29
+ de: {
30
+ learnMore: string;
31
+ formTitle: string;
32
+ submitButton: string;
33
+ successMessage: string;
34
+ errorMessage: string;
35
+ };
36
+ en: {
37
+ leaveFeedback: string;
38
+ learnMore: string;
39
+ formTitle: string;
40
+ submitButton: string;
41
+ successMessage: string;
42
+ errorMessage: string;
43
+ };
44
+ es: {
45
+ learnMore: string;
46
+ formTitle: string;
47
+ submitButton: string;
48
+ successMessage: string;
49
+ errorMessage: string;
50
+ };
51
+ fr: {
52
+ learnMore: string;
53
+ formTitle: string;
54
+ submitButton: string;
55
+ successMessage: string;
56
+ errorMessage: string;
57
+ };
58
+ it: {
59
+ learnMore: string;
60
+ formTitle: string;
61
+ submitButton: string;
62
+ successMessage: string;
63
+ errorMessage: string;
64
+ };
65
+ ja: {
66
+ learnMore: string;
67
+ formTitle: string;
68
+ submitButton: string;
69
+ successMessage: string;
70
+ errorMessage: string;
71
+ };
72
+ ko: {
73
+ learnMore: string;
74
+ formTitle: string;
75
+ submitButton: string;
76
+ successMessage: string;
77
+ errorMessage: string;
78
+ };
79
+ nl: {
80
+ learnMore: string;
81
+ formTitle: string;
82
+ submitButton: string;
83
+ successMessage: string;
84
+ errorMessage: string;
85
+ };
86
+ pt: {
87
+ learnMore: string;
88
+ formTitle: string;
89
+ submitButton: string;
90
+ successMessage: string;
91
+ errorMessage: string;
92
+ };
93
+ tr: {
94
+ learnMore: string;
95
+ formTitle: string;
96
+ submitButton: string;
97
+ successMessage: string;
98
+ errorMessage: string;
99
+ };
100
+ vi: {
101
+ learnMore: string;
102
+ formTitle: string;
103
+ submitButton: string;
104
+ successMessage: string;
105
+ errorMessage: string;
106
+ };
107
+ zh: {
108
+ learnMore: string;
109
+ formTitle: string;
110
+ submitButton: string;
111
+ successMessage: string;
112
+ errorMessage: string;
113
+ };
114
+ pl: {
115
+ learnMore: string;
116
+ formTitle: string;
117
+ submitButton: string;
118
+ successMessage: string;
119
+ errorMessage: string;
120
+ };
121
+ sv: {
122
+ learnMore: string;
123
+ formTitle: string;
124
+ submitButton: string;
125
+ successMessage: string;
126
+ errorMessage: string;
127
+ };
128
+ };
129
+ locale: string;
130
+ };
131
+ static validate: {
132
+ description: (error: Error | string) => (value?: string) => string | Error | undefined;
133
+ email: (error: Error | string) => (value?: string) => string | Error | undefined;
134
+ };
135
+ state: State;
136
+ manager: NoticeBubbleManager;
137
+ private focusDecorator;
138
+ get headerId(): string;
139
+ getHeaderProps(): {
140
+ id: string;
141
+ };
142
+ getItemProps(): {
143
+ validateOnBlur: boolean | undefined;
144
+ };
145
+ handleChangeRating: (rating: number) => void;
146
+ handelCloseModal: () => void;
147
+ handleChange: (fn: (e: React.SyntheticEvent) => void) => (value: any, e: React.SyntheticEvent) => void;
148
+ componentDidUpdate(prevProps: Readonly<FeedbackRatingProps>): void;
149
+ renderCheckbox: (config: FormConfigItem) => JSX.Element;
150
+ renderTextField: (config: FormConfigItem) => JSX.Element;
151
+ render(): React.ReactNode;
152
+ }
153
+ declare const FeedbackRating: typeof FeedbackRatingType & {
154
+ validate: typeof FeedbackRatingRoot.validate;
155
+ };
156
+ export default FeedbackRating;
@@ -0,0 +1,55 @@
1
+ import React from 'react';
2
+ import { FeedbackFormProps } from '../../index';
3
+ import { FieldProps } from 'react-final-form';
4
+ import { Intergalactic } from '@semcore/core';
5
+ import Button from '@semcore/button';
6
+ import { Text } from '@semcore/typography';
7
+ import Checkbox from '@semcore/checkbox';
8
+ export type FormConfigItem = {
9
+ key: string;
10
+ label: React.ReactNode;
11
+ type: 'input' | 'checkbox' | 'textarea';
12
+ description?: React.ReactNode;
13
+ validate?: (value: any) => Error | string | undefined;
14
+ };
15
+ export type FeedbackRatingProps = Intergalactic.InternalTypings.EfficientOmit<FeedbackFormProps, 'initialValues' | 'loading'> & {
16
+ /** status of form */
17
+ status: 'default' | 'success' | 'error' | 'loading';
18
+ /** flag for show/hide notification */
19
+ notificationVisible: boolean;
20
+ /** */
21
+ onNotificationClose: () => void;
22
+ /** text in notification panel */
23
+ notificationText: string;
24
+ /** optional link in notification panel */
25
+ learnMoreLink?: string;
26
+ /** rating value */
27
+ rating: number;
28
+ /** visible modal form flag */
29
+ visible: boolean;
30
+ onVisibleChange: (visible: boolean, rating: number) => void;
31
+ /** header of modal with form */
32
+ header: React.ReactNode;
33
+ /** text for submit button of form */
34
+ submitText?: string;
35
+ /** config for form fields */
36
+ formConfig: FormConfigItem[];
37
+ initialValues: Record<string, any> & {
38
+ rating: number;
39
+ };
40
+ errorFeedbackEmail: string;
41
+ locale?: string;
42
+ };
43
+ export type FeedbackRatingItemProps = FieldProps<any, any> & {
44
+ /**
45
+ * Allows to override which passed props will be passed to the Tooltip component.
46
+ */
47
+ tooltipProps?: string[];
48
+ };
49
+ declare const FeedbackRatingType: Intergalactic.Component<'form', FeedbackRatingProps> & {
50
+ Item: Intergalactic.Component<'div', FeedbackRatingItemProps>;
51
+ Submit: typeof Button;
52
+ Checkbox: typeof Checkbox;
53
+ Header: typeof Text;
54
+ };
55
+ export { FeedbackRatingType };
@@ -0,0 +1,14 @@
1
+ import { Component, Intergalactic } from '@semcore/core';
2
+ import { Box, BoxProps } from '@semcore/flex-box';
3
+ type SliderRatingProps = {
4
+ value: number;
5
+ onChange?: (value: number) => void;
6
+ readonly?: boolean;
7
+ };
8
+ type StarProps = BoxProps & {
9
+ filled?: boolean;
10
+ };
11
+ declare const SliderRating: (<Tag extends Intergalactic.InternalTypings.ComponentTag = Intergalactic.Component<"div", import("@semcore/flex-box").FlexProps, {}, never[]>, Props extends SliderRatingProps = SliderRatingProps>(props: Intergalactic.InternalTypings.ComponentProps<Tag, Intergalactic.Component<"div", import("@semcore/flex-box").FlexProps, {}, never[]>, Props, {}, never[]>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<Intergalactic.Component<"div", import("@semcore/flex-box").FlexProps, {}, never[]>, Intergalactic.InternalTypings.ComponentTag, SliderRatingProps, {}, never[]> & {
12
+ Star: Intergalactic.Component<typeof Box, StarProps>;
13
+ };
14
+ export default SliderRating;
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ import { IRootComponentProps } from '@semcore/core';
3
+ export declare function SubmitButton(props: IRootComponentProps): React.ReactNode;
@@ -5,6 +5,8 @@ import Button from '@semcore/button';
5
5
  import { NoticeSmart } from '@semcore/notice';
6
6
  import { Box } from '@semcore/flex-box';
7
7
 
8
+ import { default as FeedbackRating } from './component/feedback-rating/FeedbackRating';
9
+
8
10
  /** @deprecated */
9
11
  export type IFeedbackForm = FeedbackFormProps;
10
12
  export type FeedbackFormProps = FormProps & {
@@ -33,3 +35,5 @@ declare const FeedbackForm: Intergalactic.Component<'form', FeedbackFormProps> &
33
35
  };
34
36
 
35
37
  export default FeedbackForm;
38
+
39
+ export { FeedbackRating };
@@ -0,0 +1,101 @@
1
+ export declare const localizedMessages: {
2
+ de: {
3
+ learnMore: string;
4
+ formTitle: string;
5
+ submitButton: string;
6
+ successMessage: string;
7
+ errorMessage: string;
8
+ };
9
+ en: {
10
+ leaveFeedback: string;
11
+ learnMore: string;
12
+ formTitle: string;
13
+ submitButton: string;
14
+ successMessage: string;
15
+ errorMessage: string;
16
+ };
17
+ es: {
18
+ learnMore: string;
19
+ formTitle: string;
20
+ submitButton: string;
21
+ successMessage: string;
22
+ errorMessage: string;
23
+ };
24
+ fr: {
25
+ learnMore: string;
26
+ formTitle: string;
27
+ submitButton: string;
28
+ successMessage: string;
29
+ errorMessage: string;
30
+ };
31
+ it: {
32
+ learnMore: string;
33
+ formTitle: string;
34
+ submitButton: string;
35
+ successMessage: string;
36
+ errorMessage: string;
37
+ };
38
+ ja: {
39
+ learnMore: string;
40
+ formTitle: string;
41
+ submitButton: string;
42
+ successMessage: string;
43
+ errorMessage: string;
44
+ };
45
+ ko: {
46
+ learnMore: string;
47
+ formTitle: string;
48
+ submitButton: string;
49
+ successMessage: string;
50
+ errorMessage: string;
51
+ };
52
+ nl: {
53
+ learnMore: string;
54
+ formTitle: string;
55
+ submitButton: string;
56
+ successMessage: string;
57
+ errorMessage: string;
58
+ };
59
+ pt: {
60
+ learnMore: string;
61
+ formTitle: string;
62
+ submitButton: string;
63
+ successMessage: string;
64
+ errorMessage: string;
65
+ };
66
+ tr: {
67
+ learnMore: string;
68
+ formTitle: string;
69
+ submitButton: string;
70
+ successMessage: string;
71
+ errorMessage: string;
72
+ };
73
+ vi: {
74
+ learnMore: string;
75
+ formTitle: string;
76
+ submitButton: string;
77
+ successMessage: string;
78
+ errorMessage: string;
79
+ };
80
+ zh: {
81
+ learnMore: string;
82
+ formTitle: string;
83
+ submitButton: string;
84
+ successMessage: string;
85
+ errorMessage: string;
86
+ };
87
+ pl: {
88
+ learnMore: string;
89
+ formTitle: string;
90
+ submitButton: string;
91
+ successMessage: string;
92
+ errorMessage: string;
93
+ };
94
+ sv: {
95
+ learnMore: string;
96
+ formTitle: string;
97
+ submitButton: string;
98
+ successMessage: string;
99
+ errorMessage: string;
100
+ };
101
+ };
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": "6.27.2",
4
+ "version": "6.28.0",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -9,13 +9,22 @@
9
9
  "author": "UI-kit team <ui-kit-team@semrush.com>",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
+ "@semcore/checkbox": "7.29.0",
13
+ "@semcore/notice-bubble": "5.32.0",
14
+ "@semcore/typography": "5.34.0",
15
+ "@semcore/link": "5.29.0",
16
+ "@semcore/modal": "4.36.0",
17
+ "@semcore/illustration": "2.26.0",
18
+ "@semcore/icon": "4.35.0",
19
+ "@semcore/textarea": "5.25.0",
20
+ "@semcore/input": "4.27.0",
21
+ "final-form": "4.20.7",
12
22
  "@semcore/button": "5.27.0",
13
- "@semcore/flex-box": "5.25.2",
14
- "@semcore/notice": "5.32.2",
15
- "@semcore/spin-container": "7.25.2",
16
- "@semcore/tooltip": "6.31.2",
17
- "@semcore/utils": "4.26.3",
18
- "final-form": "4.20.4",
23
+ "@semcore/flex-box": "5.26.0",
24
+ "@semcore/notice": "5.33.0",
25
+ "@semcore/spin-container": "7.26.0",
26
+ "@semcore/tooltip": "6.32.0",
27
+ "@semcore/utils": "4.27.0",
19
28
  "final-form-focus": "1.1.2",
20
29
  "react-final-form": "6.5.9"
21
30
  },
@@ -31,6 +40,7 @@
31
40
  },
32
41
  "devDependencies": {
33
42
  "@types/react": "18.0.21",
43
+ "@types/final-form-focus": "1.1.7",
34
44
  "@semcore/testing-utils": "1.0.0"
35
45
  },
36
46
  "overrides": {
@@ -42,6 +52,6 @@
42
52
  }
43
53
  },
44
54
  "scripts": {
45
- "build": "pnpm semcore-builder --source=js"
55
+ "build": "pnpm semcore-builder --source=js,ts"
46
56
  }
47
57
  }