@semcore/feedback-form 16.2.0 → 17.0.0-prerelease.18
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 +6 -0
- package/lib/cjs/FeedbackForm.js +108 -120
- package/lib/cjs/FeedbackForm.js.map +1 -1
- package/lib/cjs/component/checkbox-button/CheckboxButton.js +48 -45
- package/lib/cjs/component/checkbox-button/CheckboxButton.js.map +1 -1
- package/lib/cjs/component/feedback-item/FeedbackItem.js +33 -35
- package/lib/cjs/component/feedback-item/FeedbackItem.js.map +1 -1
- package/lib/cjs/component/feedback-rating/FeedbackRating.js +240 -274
- package/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/lib/cjs/component/feedback-rating/FeedbackRating.type.js.map +1 -1
- package/lib/cjs/component/slider-rating/SliderRating.js +146 -147
- package/lib/cjs/component/slider-rating/SliderRating.js.map +1 -1
- package/lib/cjs/component/submit-button/SubmitButton.js +12 -9
- package/lib/cjs/component/submit-button/SubmitButton.js.map +1 -1
- package/lib/cjs/index.d.js +3 -3
- package/lib/cjs/index.d.js.map +1 -1
- package/lib/cjs/index.js +5 -5
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +16 -16
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/FeedbackForm.js +101 -113
- package/lib/es6/FeedbackForm.js.map +1 -1
- package/lib/es6/component/checkbox-button/CheckboxButton.js +44 -41
- package/lib/es6/component/checkbox-button/CheckboxButton.js.map +1 -1
- package/lib/es6/component/feedback-item/FeedbackItem.js +29 -31
- package/lib/es6/component/feedback-item/FeedbackItem.js.map +1 -1
- package/lib/es6/component/feedback-rating/FeedbackRating.js +220 -254
- package/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/lib/es6/component/feedback-rating/FeedbackRating.type.js.map +1 -1
- package/lib/es6/component/slider-rating/SliderRating.js +138 -139
- package/lib/es6/component/slider-rating/SliderRating.js.map +1 -1
- package/lib/es6/component/submit-button/SubmitButton.js +11 -8
- package/lib/es6/component/submit-button/SubmitButton.js.map +1 -1
- package/lib/es6/index.d.js +0 -3
- package/lib/es6/index.d.js.map +1 -1
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +15 -15
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/esm/FeedbackForm.mjs +101 -101
- package/lib/esm/component/checkbox-button/CheckboxButton.mjs +47 -39
- package/lib/esm/component/feedback-item/FeedbackItem.mjs +29 -23
- package/lib/esm/component/feedback-rating/FeedbackRating.mjs +223 -234
- package/lib/esm/component/slider-rating/SliderRating.mjs +139 -129
- package/lib/esm/component/submit-button/SubmitButton.mjs +11 -8
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +1 -1
- package/lib/types/component/checkbox-button/CheckboxButton.d.ts +1 -3
- package/lib/types/component/feedback-rating/FeedbackRating.d.ts +11 -189
- package/lib/types/component/feedback-rating/FeedbackRating.type.d.ts +7 -9
- package/lib/types/component/slider-rating/SliderRating.d.ts +1 -1
- package/lib/types/index.d.ts +1 -3
- package/package.json +17 -16
|
@@ -1,162 +1,170 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
1
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
7
|
-
import { createComponent, assignProps, sstyled
|
|
2
|
+
import { createComponent, Component, assignProps, sstyled } from "@semcore/core";
|
|
3
|
+
import { Flex, Box } from "@semcore/base-components";
|
|
8
4
|
import i18nEnhance from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
9
5
|
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
10
|
-
import { Flex, Box } from "@semcore/flex-box";
|
|
11
6
|
import React from "react";
|
|
12
7
|
import { localizedMessages } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
13
8
|
/*!__reshadow-styles__:"../../style/slider-rating.shadow.css"*/
|
|
14
|
-
|
|
9
|
+
const style = (
|
|
15
10
|
/*__reshadow_css_start__*/
|
|
16
11
|
(sstyled.insert(
|
|
17
12
|
/*__inner_css_start__*/
|
|
18
|
-
".
|
|
13
|
+
".___SSliderRating_wx4t1_gg_ .___SStar_wx4t1_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}.___SSliderRating_wx4t1_gg_:focus-visible .___SStar_wx4t1_gg_.__hovered_wx4t1_gg_{cursor:pointer;transform:scale(1.3)}@media (hover:hover){.___SSliderRating_wx4t1_gg_ .___SStar_wx4t1_gg_:hover{cursor:pointer;transform:scale(1.3)}.___SSliderRating_wx4t1_gg_.__readonly_wx4t1_gg_ .___SStar_wx4t1_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_wx4t1_gg_.__filled_wx4t1_gg_:active{animation:wobble .8s ease-in-out}.___SStar_wx4t1_gg_ path{fill:var(--intergalactic-slider-rating-normal, #a9abb6)}.___SStar_wx4t1_gg_.__filled_wx4t1_gg_ path{stroke-width:0;fill:var(--intergalactic-slider-rating-hover-active, #fdc23c)}",
|
|
19
14
|
/*__inner_css_end__*/
|
|
20
|
-
"
|
|
15
|
+
"wx4t1_gg_"
|
|
21
16
|
), /*__reshadow_css_end__*/
|
|
22
17
|
{
|
|
23
|
-
"__SSliderRating": "
|
|
24
|
-
"__SStar": "
|
|
25
|
-
"_hovered": "
|
|
26
|
-
"_readonly": "
|
|
27
|
-
"_filled": "
|
|
18
|
+
"__SSliderRating": "___SSliderRating_wx4t1_gg_",
|
|
19
|
+
"__SStar": "___SStar_wx4t1_gg_",
|
|
20
|
+
"_hovered": "__hovered_wx4t1_gg_",
|
|
21
|
+
"_readonly": "__readonly_wx4t1_gg_",
|
|
22
|
+
"_filled": "__filled_wx4t1_gg_"
|
|
28
23
|
})
|
|
29
24
|
);
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
37
|
-
args[_key] = arguments[_key];
|
|
38
|
-
}
|
|
39
|
-
_this = _callSuper(this, SliderRatingRoot2, [].concat(args));
|
|
40
|
-
_defineProperty(_this, "state", {
|
|
25
|
+
const MIN = 1;
|
|
26
|
+
const MAX = 5;
|
|
27
|
+
class SliderRatingRoot extends Component {
|
|
28
|
+
constructor(...args) {
|
|
29
|
+
super(...args);
|
|
30
|
+
_defineProperty(this, "state", {
|
|
41
31
|
hoveredIndex: -1,
|
|
42
32
|
clickedIndex: -1
|
|
43
33
|
});
|
|
44
|
-
_defineProperty(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}
|
|
34
|
+
_defineProperty(this, "handleClick", (newValue) => (_e) => {
|
|
35
|
+
const {
|
|
36
|
+
readonly
|
|
37
|
+
} = this.asProps;
|
|
38
|
+
if (!readonly) {
|
|
39
|
+
this.setValue(newValue);
|
|
40
|
+
}
|
|
51
41
|
});
|
|
52
|
-
_defineProperty(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
});
|
|
57
|
-
};
|
|
42
|
+
_defineProperty(this, "handleMouseEnder", (index) => () => {
|
|
43
|
+
this.setState({
|
|
44
|
+
hoveredIndex: index
|
|
45
|
+
});
|
|
58
46
|
});
|
|
59
|
-
_defineProperty(
|
|
60
|
-
|
|
47
|
+
_defineProperty(this, "handleMouseLeave", () => {
|
|
48
|
+
this.setState({
|
|
61
49
|
hoveredIndex: -1
|
|
62
50
|
});
|
|
63
51
|
});
|
|
64
|
-
_defineProperty(
|
|
65
|
-
|
|
52
|
+
_defineProperty(this, "setValue", (newValue) => {
|
|
53
|
+
const {
|
|
54
|
+
onChange,
|
|
55
|
+
value
|
|
56
|
+
} = this.asProps;
|
|
66
57
|
if (onChange) {
|
|
67
58
|
onChange(newValue);
|
|
68
59
|
}
|
|
69
60
|
if (newValue <= value) {
|
|
70
|
-
|
|
61
|
+
this.setState({
|
|
71
62
|
clickedIndex: newValue,
|
|
72
63
|
hoveredIndex: -1
|
|
73
64
|
});
|
|
74
65
|
} else {
|
|
75
|
-
|
|
66
|
+
this.setState({
|
|
76
67
|
clickedIndex: -1,
|
|
77
68
|
hoveredIndex: -1
|
|
78
69
|
});
|
|
79
70
|
}
|
|
80
71
|
});
|
|
81
|
-
_defineProperty(
|
|
72
|
+
_defineProperty(this, "handleKeyDown", (event) => {
|
|
82
73
|
if (!["ArrowLeft", "ArrowRight", "Enter"].includes(event.key)) return;
|
|
83
74
|
event.preventDefault();
|
|
84
75
|
if (event.key === "Enter") {
|
|
85
|
-
|
|
86
|
-
|
|
76
|
+
const {
|
|
77
|
+
hoveredIndex
|
|
78
|
+
} = this.state;
|
|
79
|
+
this.setValue(hoveredIndex + 1);
|
|
87
80
|
} else {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
81
|
+
const {
|
|
82
|
+
value
|
|
83
|
+
} = this.asProps;
|
|
84
|
+
const {
|
|
85
|
+
hoveredIndex
|
|
86
|
+
} = this.state;
|
|
87
|
+
const direction = event.key === "ArrowLeft" ? -1 : 1;
|
|
88
|
+
let newValue = hoveredIndex === -1 ? value + direction : hoveredIndex + 1 + direction;
|
|
92
89
|
if (newValue > MAX) newValue = MAX;
|
|
93
90
|
if (newValue < MIN) newValue = MIN;
|
|
94
|
-
|
|
91
|
+
this.setState({
|
|
95
92
|
hoveredIndex: newValue - 1
|
|
96
93
|
});
|
|
97
94
|
}
|
|
98
95
|
});
|
|
99
|
-
return _this;
|
|
100
96
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
97
|
+
getStarProps(_, index) {
|
|
98
|
+
const {
|
|
99
|
+
value,
|
|
100
|
+
readonly
|
|
101
|
+
} = this.asProps;
|
|
102
|
+
const {
|
|
103
|
+
hoveredIndex
|
|
104
|
+
} = this.state;
|
|
105
|
+
return {
|
|
106
|
+
filled: value ? index + 1 <= value || index <= hoveredIndex : index <= hoveredIndex,
|
|
107
|
+
onClick: this.handleClick(index + 1),
|
|
108
|
+
onMouseEnter: readonly ? void 0 : this.handleMouseEnder(index),
|
|
109
|
+
hovered: hoveredIndex === index
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
getLabelText() {
|
|
113
|
+
const {
|
|
114
|
+
hoveredIndex
|
|
115
|
+
} = this.state;
|
|
116
|
+
const {
|
|
117
|
+
readonly,
|
|
118
|
+
value,
|
|
119
|
+
getI18nText
|
|
120
|
+
} = this.asProps;
|
|
121
|
+
if (readonly) {
|
|
122
|
+
return getI18nText("FeedbackRating.SliderRating.aria-valuetext.readonly", {
|
|
123
|
+
selectedRating: value,
|
|
124
|
+
max: MAX
|
|
125
|
+
});
|
|
113
126
|
}
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
var _this$asProps3 = this.asProps, readonly = _this$asProps3.readonly, value = _this$asProps3.value, getI18nText = _this$asProps3.getI18nText;
|
|
119
|
-
if (readonly) {
|
|
120
|
-
return getI18nText("FeedbackRating.SliderRating.aria-valuetext.readonly", {
|
|
121
|
-
selectedRating: value,
|
|
122
|
-
max: MAX
|
|
123
|
-
});
|
|
124
|
-
}
|
|
125
|
-
if (value) {
|
|
126
|
-
var selectedRating = hoveredIndex > -1 ? hoveredIndex + 1 : value;
|
|
127
|
-
return getI18nText("FeedbackRating.SliderRating.aria-valuetext", {
|
|
128
|
-
selectedRating,
|
|
129
|
-
max: MAX
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
return hoveredIndex === -1 ? getI18nText("FeedbackRating.SliderRating.aria-valuetext.empty") : getI18nText("FeedbackRating.SliderRating.aria-valuetext", {
|
|
133
|
-
selectedRating: hoveredIndex + 1,
|
|
127
|
+
if (value) {
|
|
128
|
+
const selectedRating = hoveredIndex > -1 ? hoveredIndex + 1 : value;
|
|
129
|
+
return getI18nText("FeedbackRating.SliderRating.aria-valuetext", {
|
|
130
|
+
selectedRating,
|
|
134
131
|
max: MAX
|
|
135
132
|
});
|
|
136
133
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
134
|
+
return hoveredIndex === -1 ? getI18nText("FeedbackRating.SliderRating.aria-valuetext.empty") : getI18nText("FeedbackRating.SliderRating.aria-valuetext", {
|
|
135
|
+
selectedRating: hoveredIndex + 1,
|
|
136
|
+
max: MAX
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
render() {
|
|
140
|
+
var _ref = this.asProps, _ref3;
|
|
141
|
+
const {
|
|
142
|
+
styles,
|
|
143
|
+
readonly,
|
|
144
|
+
getI18nText,
|
|
145
|
+
value
|
|
146
|
+
} = this.asProps;
|
|
147
|
+
const {
|
|
148
|
+
hoveredIndex
|
|
149
|
+
} = this.state;
|
|
150
|
+
const SSliderRating = Flex;
|
|
151
|
+
const label = this.getLabelText();
|
|
152
|
+
if (readonly) {
|
|
153
|
+
return /* @__PURE__ */ React.createElement(SSliderRating, assignProps({
|
|
154
|
+
"gap": 1,
|
|
155
|
+
"role": "img",
|
|
156
|
+
"aria-label": label
|
|
157
|
+
}, _ref), new Array(MAX).fill(null).map((_, index) => {
|
|
158
|
+
return /* @__PURE__ */ React.createElement(Box, {
|
|
159
|
+
key: index,
|
|
160
|
+
position: "relative"
|
|
161
|
+
}, /* @__PURE__ */ React.createElement(SliderRating.Star, null));
|
|
162
|
+
}));
|
|
163
|
+
}
|
|
164
|
+
const hoverValue = hoveredIndex + 1;
|
|
165
|
+
const editModeLabel = hoverValue > 0 || value ? `${label}. ${getI18nText("FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber")}.` : label;
|
|
166
|
+
return _ref3 = sstyled(styles), /* @__PURE__ */ React.createElement(SSliderRating, _ref3.cn("SSliderRating", {
|
|
167
|
+
...assignProps({
|
|
160
168
|
"gap": 1,
|
|
161
169
|
"tabIndex": 0,
|
|
162
170
|
"onMouseLeave": this.handleMouseLeave,
|
|
@@ -167,15 +175,15 @@ var SliderRatingRoot = /* @__PURE__ */ (function(_Component) {
|
|
|
167
175
|
"aria-valuemax": MAX,
|
|
168
176
|
"aria-valuetext": editModeLabel,
|
|
169
177
|
"aria-valuenow": hoverValue
|
|
170
|
-
}, _ref)
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
}));
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
178
|
+
}, _ref)
|
|
179
|
+
}), new Array(MAX).fill(null).map((_, index) => {
|
|
180
|
+
return /* @__PURE__ */ React.createElement(Box, {
|
|
181
|
+
key: index,
|
|
182
|
+
position: "relative"
|
|
183
|
+
}, /* @__PURE__ */ React.createElement(SliderRating.Star, null));
|
|
184
|
+
}));
|
|
185
|
+
}
|
|
186
|
+
}
|
|
179
187
|
_defineProperty(SliderRatingRoot, "displayName", "SliderRating");
|
|
180
188
|
_defineProperty(SliderRatingRoot, "style", style);
|
|
181
189
|
_defineProperty(SliderRatingRoot, "enhance", [uniqueIDEnhancement(), i18nEnhance(localizedMessages)]);
|
|
@@ -185,16 +193,18 @@ _defineProperty(SliderRatingRoot, "defaultProps", {
|
|
|
185
193
|
});
|
|
186
194
|
function Star(props) {
|
|
187
195
|
var _ref2 = arguments[0], _ref4;
|
|
188
|
-
|
|
189
|
-
return _ref4 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SStar, _ref4.cn("SStar",
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
const SStar = Box;
|
|
197
|
+
return _ref4 = sstyled(props.styles), /* @__PURE__ */ React.createElement(SStar, _ref4.cn("SStar", {
|
|
198
|
+
...assignProps({
|
|
199
|
+
"tag": "svg",
|
|
200
|
+
"role": "none",
|
|
201
|
+
"width": "24",
|
|
202
|
+
"height": "24",
|
|
203
|
+
"viewBox": "0 0 24 24",
|
|
204
|
+
"fill": "none",
|
|
205
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
206
|
+
}, _ref2)
|
|
207
|
+
}), props.filled ? /* @__PURE__ */ React.createElement("path", _ref4.cn("path", {
|
|
198
208
|
"d": "M11.646 1.214a.4.4 0 0 1 .708 0l3.314 6.293 7 1.214a.4.4 0 0 1 .219.673l-4.952 5.104 1.012 7.044a.4.4 0 0 1-.573.416L12 18.818l-6.374 3.14a.4.4 0 0 1-.572-.416l1.01-7.044-4.95-5.104a.4.4 0 0 1 .218-.673l7-1.214 3.314-6.293Z"
|
|
199
209
|
})) : /* @__PURE__ */ React.createElement("path", _ref4.cn("path", {
|
|
200
210
|
"d": "M14.358 9.31 12 4.834 9.642 9.31l-4.985.864 3.526 3.634-.72 5.014L12 16.588l4.537 2.235-.72-5.014 3.526-3.634-4.985-.864Zm8.31-.59a.4.4 0 0 1 .219.674l-4.952 5.104 1.012 7.044a.4.4 0 0 1-.573.416L12 18.818l-6.374 3.14a.4.4 0 0 1-.572-.416l1.01-7.044-4.95-5.104a.4.4 0 0 1 .218-.673l7-1.214 3.314-6.293a.4.4 0 0 1 .708 0l3.314 6.293 7 1.214Z",
|
|
@@ -203,7 +213,7 @@ function Star(props) {
|
|
|
203
213
|
})));
|
|
204
214
|
}
|
|
205
215
|
Star.displayName = "Star";
|
|
206
|
-
|
|
216
|
+
const SliderRating = createComponent(SliderRatingRoot, {
|
|
207
217
|
Star
|
|
208
218
|
});
|
|
209
219
|
export {
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
1
|
import { sstyled, assignProps } from "@semcore/core";
|
|
3
2
|
import Button from "@semcore/button";
|
|
4
3
|
import React from "react";
|
|
5
4
|
function SubmitButton(props) {
|
|
6
5
|
var _ref = arguments[0], _ref2;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
6
|
+
const {
|
|
7
|
+
styles
|
|
8
|
+
} = props;
|
|
9
|
+
const SSubmit = Button;
|
|
10
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SSubmit, _ref2.cn("SSubmit", {
|
|
11
|
+
...assignProps({
|
|
12
|
+
"type": "submit",
|
|
13
|
+
"use": "primary",
|
|
14
|
+
"theme": "success"
|
|
15
|
+
}, _ref)
|
|
16
|
+
}));
|
|
14
17
|
}
|
|
15
18
|
export {
|
|
16
19
|
SubmitButton
|
|
@@ -1,4 +1,2 @@
|
|
|
1
|
-
declare const CheckboxButton: import("@semcore/core
|
|
2
|
-
[key: string]: (arg: unknown) => void;
|
|
3
|
-
}, null>;
|
|
1
|
+
declare const CheckboxButton: import("@semcore/core").Intergalactic.Component<"div", {}, {}, never[]>;
|
|
4
2
|
export default CheckboxButton;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
1
|
+
import type Button from '@semcore/button';
|
|
2
|
+
import type Checkbox from '@semcore/checkbox';
|
|
3
3
|
import { Component } from '@semcore/core';
|
|
4
|
+
import type { Intergalactic } from '@semcore/core';
|
|
4
5
|
import { NoticeBubbleManager } from '@semcore/notice-bubble';
|
|
5
6
|
import { Text } from '@semcore/typography';
|
|
6
7
|
import React from 'react';
|
|
7
|
-
import type {
|
|
8
|
+
import type { FeedbackRatingCheckboxProps, FeedbackRatingItemProps, FeedbackRatingProps, FormConfigItem, FeedbackRatingDefaultProps } from './FeedbackRating.type';
|
|
8
9
|
type State = {
|
|
9
10
|
error: boolean;
|
|
10
11
|
};
|
|
11
|
-
declare class FeedbackRatingRoot extends Component<FeedbackRatingProps,
|
|
12
|
+
declare class FeedbackRatingRoot extends Component<FeedbackRatingProps, typeof FeedbackRatingRoot.enhance, {}, FeedbackRatingDefaultProps, State> {
|
|
12
13
|
static displayName: string;
|
|
13
14
|
static style: {
|
|
14
15
|
[key: string]: string;
|
|
@@ -20,190 +21,7 @@ declare class FeedbackRatingRoot extends Component<FeedbackRatingProps, {}, Stat
|
|
|
20
21
|
}, (props: any) => {
|
|
21
22
|
uid: ReturnType<typeof import("@semcore/core/lib/utils/uniqueID").useUID>;
|
|
22
23
|
}];
|
|
23
|
-
static defaultProps:
|
|
24
|
-
onSubmit: () => void;
|
|
25
|
-
i18n: {
|
|
26
|
-
de: {
|
|
27
|
-
leaveFeedback: string;
|
|
28
|
-
learnMore: string;
|
|
29
|
-
formTitle: string;
|
|
30
|
-
submitButton: string;
|
|
31
|
-
successMessage: string;
|
|
32
|
-
errorMessage: string;
|
|
33
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
34
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
35
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
36
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
37
|
-
};
|
|
38
|
-
en: {
|
|
39
|
-
leaveFeedback: string;
|
|
40
|
-
learnMore: string;
|
|
41
|
-
formTitle: string;
|
|
42
|
-
submitButton: string;
|
|
43
|
-
successMessage: string;
|
|
44
|
-
errorMessage: string;
|
|
45
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
46
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
47
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
48
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
49
|
-
};
|
|
50
|
-
es: {
|
|
51
|
-
leaveFeedback: string;
|
|
52
|
-
learnMore: string;
|
|
53
|
-
formTitle: string;
|
|
54
|
-
submitButton: string;
|
|
55
|
-
successMessage: string;
|
|
56
|
-
errorMessage: string;
|
|
57
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
58
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
59
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
60
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
61
|
-
};
|
|
62
|
-
fr: {
|
|
63
|
-
leaveFeedback: string;
|
|
64
|
-
learnMore: string;
|
|
65
|
-
formTitle: string;
|
|
66
|
-
submitButton: string;
|
|
67
|
-
successMessage: string;
|
|
68
|
-
errorMessage: string;
|
|
69
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
70
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
71
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
72
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
73
|
-
};
|
|
74
|
-
it: {
|
|
75
|
-
leaveFeedback: string;
|
|
76
|
-
learnMore: string;
|
|
77
|
-
formTitle: string;
|
|
78
|
-
submitButton: string;
|
|
79
|
-
successMessage: string;
|
|
80
|
-
errorMessage: string;
|
|
81
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
82
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
83
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
84
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
85
|
-
};
|
|
86
|
-
ja: {
|
|
87
|
-
leaveFeedback: string;
|
|
88
|
-
learnMore: string;
|
|
89
|
-
formTitle: string;
|
|
90
|
-
submitButton: string;
|
|
91
|
-
successMessage: string;
|
|
92
|
-
errorMessage: string;
|
|
93
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
94
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
95
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
96
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
97
|
-
};
|
|
98
|
-
ko: {
|
|
99
|
-
leaveFeedback: string;
|
|
100
|
-
learnMore: string;
|
|
101
|
-
formTitle: string;
|
|
102
|
-
submitButton: string;
|
|
103
|
-
successMessage: string;
|
|
104
|
-
errorMessage: string;
|
|
105
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
106
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
107
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
108
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
109
|
-
};
|
|
110
|
-
nl: {
|
|
111
|
-
leaveFeedback: string;
|
|
112
|
-
learnMore: string;
|
|
113
|
-
formTitle: string;
|
|
114
|
-
submitButton: string;
|
|
115
|
-
successMessage: string;
|
|
116
|
-
errorMessage: string;
|
|
117
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
118
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
119
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
120
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
121
|
-
};
|
|
122
|
-
pt: {
|
|
123
|
-
leaveFeedback: string;
|
|
124
|
-
learnMore: string;
|
|
125
|
-
formTitle: string;
|
|
126
|
-
submitButton: string;
|
|
127
|
-
successMessage: string;
|
|
128
|
-
errorMessage: string;
|
|
129
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
130
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
131
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
132
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
133
|
-
};
|
|
134
|
-
tr: {
|
|
135
|
-
leaveFeedback: string;
|
|
136
|
-
learnMore: string;
|
|
137
|
-
formTitle: string;
|
|
138
|
-
submitButton: string;
|
|
139
|
-
successMessage: string;
|
|
140
|
-
errorMessage: string;
|
|
141
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
142
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
143
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
144
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
145
|
-
};
|
|
146
|
-
vi: {
|
|
147
|
-
leaveFeedback: string;
|
|
148
|
-
learnMore: string;
|
|
149
|
-
formTitle: string;
|
|
150
|
-
submitButton: string;
|
|
151
|
-
successMessage: string;
|
|
152
|
-
errorMessage: string;
|
|
153
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
154
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
155
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
156
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
157
|
-
};
|
|
158
|
-
zh: {
|
|
159
|
-
leaveFeedback: string;
|
|
160
|
-
learnMore: string;
|
|
161
|
-
formTitle: string;
|
|
162
|
-
submitButton: string;
|
|
163
|
-
successMessage: string;
|
|
164
|
-
errorMessage: string;
|
|
165
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
166
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
167
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
168
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
169
|
-
};
|
|
170
|
-
pl: {
|
|
171
|
-
leaveFeedback: string;
|
|
172
|
-
learnMore: string;
|
|
173
|
-
formTitle: string;
|
|
174
|
-
submitButton: string;
|
|
175
|
-
successMessage: string;
|
|
176
|
-
errorMessage: string;
|
|
177
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
178
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
179
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
180
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
181
|
-
};
|
|
182
|
-
sv: {
|
|
183
|
-
leaveFeedback: string;
|
|
184
|
-
learnMore: string;
|
|
185
|
-
formTitle: string;
|
|
186
|
-
submitButton: string;
|
|
187
|
-
successMessage: string;
|
|
188
|
-
errorMessage: string;
|
|
189
|
-
"FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber": string;
|
|
190
|
-
"FeedbackRating.SliderRating.aria-valuetext.readonly": string;
|
|
191
|
-
"FeedbackRating.SliderRating.aria-valuetext.empty": string;
|
|
192
|
-
"FeedbackRating.SliderRating.aria-valuetext": string;
|
|
193
|
-
};
|
|
194
|
-
};
|
|
195
|
-
locale: string;
|
|
196
|
-
Illustration: Intergalactic.Component<"svg", any, {}, never[]>;
|
|
197
|
-
Notice: (<Tag extends Intergalactic.InternalTypings.ComponentTag | [Intergalactic.InternalTypings.ComponentTag, keyof JSX.IntrinsicElements] = "div", Props extends import("@semcore/notice").NoticeProps = import("@semcore/notice").NoticeProps>(props: Intergalactic.InternalTypings.ComponentProps<Tag, "div", Props, import("@semcore/notice").NoticeContext, never[]>) => Intergalactic.InternalTypings.ComponentRenderingResults) & Intergalactic.InternalTypings.ComponentAdditive<"div", Intergalactic.InternalTypings.ComponentTag, import("@semcore/notice").NoticeProps, import("@semcore/notice").NoticeContext, never[]> & {
|
|
198
|
-
Label: Intergalactic.Component<"div", import("@semcore/notice").NoticeLabelProps>;
|
|
199
|
-
Actions: typeof Box;
|
|
200
|
-
Content: typeof Box;
|
|
201
|
-
Title: typeof Text;
|
|
202
|
-
Text: typeof Text;
|
|
203
|
-
CloseIcon: Intergalactic.Component<"div", import("@semcore/icon").IconProps>;
|
|
204
|
-
Close: import("@semcore/button").ButtonComponent;
|
|
205
|
-
};
|
|
206
|
-
};
|
|
24
|
+
static defaultProps: FeedbackRatingDefaultProps;
|
|
207
25
|
static validate: {
|
|
208
26
|
description: (error: Error | string) => (value?: string) => string | Error | undefined;
|
|
209
27
|
email: (error: Error | string) => (value?: string) => string | Error | undefined;
|
|
@@ -227,7 +45,11 @@ declare class FeedbackRatingRoot extends Component<FeedbackRatingProps, {}, Stat
|
|
|
227
45
|
renderTextField: (config: FormConfigItem) => React.JSX.Element;
|
|
228
46
|
render(): React.ReactNode;
|
|
229
47
|
}
|
|
230
|
-
declare const FeedbackRating: typeof
|
|
48
|
+
declare const FeedbackRating: Intergalactic.Component<"form", FeedbackRatingProps, {}, typeof FeedbackRatingRoot.enhance> & {
|
|
231
49
|
validate: typeof FeedbackRatingRoot.validate;
|
|
50
|
+
Item: Intergalactic.Component<"div", FeedbackRatingItemProps>;
|
|
51
|
+
Submit: typeof Button;
|
|
52
|
+
Checkbox: Intergalactic.Component<typeof Checkbox, FeedbackRatingCheckboxProps>;
|
|
53
|
+
Header: typeof Text;
|
|
232
54
|
};
|
|
233
55
|
export default FeedbackRating;
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import type Button from '@semcore/button';
|
|
2
|
-
import type Checkbox from '@semcore/checkbox';
|
|
3
1
|
import type { CheckboxProps } from '@semcore/checkbox';
|
|
4
2
|
import type { Intergalactic } from '@semcore/core';
|
|
5
3
|
import type { IllustrationProps } from '@semcore/illustration';
|
|
6
4
|
import type Notice from '@semcore/notice';
|
|
7
|
-
import type { Text } from '@semcore/typography';
|
|
8
5
|
import type React from 'react';
|
|
9
6
|
import type { FieldProps } from 'react-final-form';
|
|
10
7
|
import type { FeedbackFormProps } from '../../index';
|
|
8
|
+
import type { localizedMessages } from '../../translations/__intergalactic-dynamic-locales';
|
|
11
9
|
export type FormConfigItem = {
|
|
12
10
|
key: string;
|
|
13
11
|
label: React.ReactNode;
|
|
@@ -65,10 +63,10 @@ export type FeedbackRatingCheckboxProps = Omit<CheckboxProps, 'label'> & {
|
|
|
65
63
|
focused: boolean;
|
|
66
64
|
label: React.ReactNode;
|
|
67
65
|
};
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
66
|
+
export type FeedbackRatingDefaultProps = {
|
|
67
|
+
onSubmit: () => void;
|
|
68
|
+
i18n: typeof localizedMessages;
|
|
69
|
+
locale: 'en';
|
|
70
|
+
Illustration: Intergalactic.Component<'svg', IllustrationProps>;
|
|
71
|
+
Notice: typeof Notice;
|
|
73
72
|
};
|
|
74
|
-
export { FeedbackRatingType };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { Flex, Box, type BoxProps } from '@semcore/base-components';
|
|
1
2
|
import { type Intergalactic } from '@semcore/core';
|
|
2
|
-
import { Flex, Box, type BoxProps } from '@semcore/flex-box';
|
|
3
3
|
type SliderRatingProps = {
|
|
4
4
|
value: number;
|
|
5
5
|
onChange?: (value: number) => void;
|