@semcore/feedback-form 6.40.0-prerelease.0 → 16.0.0-prerelease.2
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 +2 -2
- package/lib/cjs/FeedbackForm.js +9 -11
- package/lib/cjs/FeedbackForm.js.map +1 -1
- package/lib/cjs/component/checkbox-button/CheckboxButton.js +5 -7
- package/lib/cjs/component/checkbox-button/CheckboxButton.js.map +1 -1
- package/lib/cjs/component/feedback-item/FeedbackItem.js +4 -4
- package/lib/cjs/component/feedback-item/FeedbackItem.js.map +1 -1
- package/lib/cjs/component/feedback-rating/FeedbackRating.js +6 -8
- package/lib/cjs/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/lib/cjs/component/slider-rating/SliderRating.js +13 -17
- package/lib/cjs/component/slider-rating/SliderRating.js.map +1 -1
- package/lib/cjs/style/slider-rating.shadow.css +1 -6
- package/lib/es6/FeedbackForm.js +9 -9
- package/lib/es6/FeedbackForm.js.map +1 -1
- package/lib/es6/component/checkbox-button/CheckboxButton.js +5 -5
- package/lib/es6/component/checkbox-button/CheckboxButton.js.map +1 -1
- package/lib/es6/component/feedback-item/FeedbackItem.js +4 -4
- package/lib/es6/component/feedback-item/FeedbackItem.js.map +1 -1
- package/lib/es6/component/feedback-rating/FeedbackRating.js +6 -6
- package/lib/es6/component/feedback-rating/FeedbackRating.js.map +1 -1
- package/lib/es6/component/slider-rating/SliderRating.js +13 -15
- package/lib/es6/component/slider-rating/SliderRating.js.map +1 -1
- package/lib/es6/style/slider-rating.shadow.css +1 -6
- package/lib/esm/FeedbackForm.mjs +62 -63
- package/lib/esm/component/checkbox-button/CheckboxButton.mjs +28 -29
- package/lib/esm/component/feedback-item/FeedbackItem.mjs +4 -4
- package/lib/esm/component/feedback-rating/FeedbackRating.mjs +54 -55
- package/lib/esm/component/slider-rating/SliderRating.mjs +73 -76
- package/lib/types/component/checkbox-button/CheckboxButton.d.ts +1 -1
- package/package.json +16 -19
|
@@ -7,38 +7,37 @@ import f from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
|
7
7
|
import re from "@babel/runtime/helpers/esm/inherits";
|
|
8
8
|
import ne from "@babel/runtime/helpers/esm/createSuper";
|
|
9
9
|
import s from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
|
-
import { sstyled as ae } from "@semcore/
|
|
11
|
-
import ie, { sstyled as B, assignProps as z, Component as oe } from "@semcore/core";
|
|
10
|
+
import { sstyled as R, createComponent as ae, assignProps as B, Component as ie } from "@semcore/core";
|
|
12
11
|
import e from "react";
|
|
13
|
-
import { Field as H, Form as
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import
|
|
17
|
-
import
|
|
12
|
+
import { Field as H, Form as oe } from "react-final-form";
|
|
13
|
+
import le from "final-form-focus";
|
|
14
|
+
import se from "@semcore/spin-container";
|
|
15
|
+
import me from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
16
|
+
import ce from "@semcore/core/lib/utils/uniqueID";
|
|
18
17
|
import u from "@semcore/notice";
|
|
19
|
-
import
|
|
20
|
-
import
|
|
18
|
+
import ue from "@semcore/icon/Check/m";
|
|
19
|
+
import de from "@semcore/icon/Warning/m";
|
|
21
20
|
import { Text as P } from "@semcore/typography";
|
|
22
|
-
import
|
|
23
|
-
import
|
|
21
|
+
import pe from "@semcore/illustration/Feedback";
|
|
22
|
+
import fe from "@semcore/link";
|
|
24
23
|
import W from "../slider-rating/SliderRating.mjs";
|
|
25
|
-
import
|
|
26
|
-
import
|
|
24
|
+
import he from "@semcore/modal";
|
|
25
|
+
import ge from "@semcore/textarea";
|
|
27
26
|
import { Flex as k, Box as N } from "@semcore/flex-box";
|
|
28
|
-
import { FeedbackItem as
|
|
29
|
-
import { SubmitButton as
|
|
30
|
-
import
|
|
27
|
+
import { FeedbackItem as be } from "../feedback-item/FeedbackItem.mjs";
|
|
28
|
+
import { SubmitButton as ve } from "../submit-button/SubmitButton.mjs";
|
|
29
|
+
import ke from "../checkbox-button/CheckboxButton.mjs";
|
|
31
30
|
import j from "@semcore/input";
|
|
32
31
|
import { localizedMessages as A } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
33
|
-
import { NoticeBubbleManager as
|
|
34
|
-
var
|
|
32
|
+
import { NoticeBubbleManager as ye, NoticeBubbleContainer as Ce } from "@semcore/notice-bubble";
|
|
33
|
+
var Ee = ["header", "submitText", "formConfig", "notificationText", "notificationTitle", "learnMoreLink", "Children", "styles", "forwardRef", "status", "theme", "background", "rating", "visible", "onVisibleChange", "notificationVisible", "onNotificationClose", "getI18nText", "errorFeedbackEmail", "modalWidth"], xe = (
|
|
35
34
|
/*__reshadow_css_start__*/
|
|
36
|
-
(
|
|
35
|
+
(R.insert(
|
|
37
36
|
/*__inner_css_start__*/
|
|
38
|
-
".
|
|
39
|
-
"
|
|
37
|
+
".___SFeedbackRating_kmztw_gg_ ul{margin:0;padding:0;list-style:none}.___SFeedbackRating_kmztw_gg_ li{list-style:none}",
|
|
38
|
+
"kmztw_gg_"
|
|
40
39
|
), {
|
|
41
|
-
__SFeedbackRating: "
|
|
40
|
+
__SFeedbackRating: "___SFeedbackRating_kmztw_gg_"
|
|
42
41
|
})
|
|
43
42
|
), y = /* @__PURE__ */ function(b) {
|
|
44
43
|
re(o, b);
|
|
@@ -50,7 +49,7 @@ var xe = ["header", "submitText", "formConfig", "notificationText", "notificatio
|
|
|
50
49
|
v[a] = arguments[a];
|
|
51
50
|
return n = p.call.apply(p, [this].concat(v)), s(f(n), "state", {
|
|
52
51
|
error: !1
|
|
53
|
-
}), s(f(n), "manager", new
|
|
52
|
+
}), s(f(n), "manager", new ye()), s(f(n), "focusDecorator", le()), s(f(n), "handleChangeRating", function(t) {
|
|
54
53
|
n.asProps.onVisibleChange(!0, t);
|
|
55
54
|
}), s(f(n), "handelCloseModal", function() {
|
|
56
55
|
n.asProps.onVisibleChange(!1, n.asProps.rating);
|
|
@@ -99,7 +98,7 @@ var xe = ["header", "submitText", "formConfig", "notificationText", "notificatio
|
|
|
99
98
|
"aria-describedby": t.description ? t.key + "-description" : void 0
|
|
100
99
|
}, function(_) {
|
|
101
100
|
var l = _.input;
|
|
102
|
-
return t.type === "textarea" ? /* @__PURE__ */ e.createElement(
|
|
101
|
+
return t.type === "textarea" ? /* @__PURE__ */ e.createElement(ge, I({}, l, {
|
|
103
102
|
h: 80,
|
|
104
103
|
onChange: n.handleChange(l.onChange),
|
|
105
104
|
id: t.key
|
|
@@ -153,7 +152,7 @@ var xe = ["header", "submitText", "formConfig", "notificationText", "notificatio
|
|
|
153
152
|
error: !1
|
|
154
153
|
}), t === "success" ? setTimeout(function() {
|
|
155
154
|
v.manager.add({
|
|
156
|
-
icon: /* @__PURE__ */ e.createElement(
|
|
155
|
+
icon: /* @__PURE__ */ e.createElement(ue, {
|
|
157
156
|
color: "green-400"
|
|
158
157
|
}),
|
|
159
158
|
children: r("successMessage"),
|
|
@@ -169,14 +168,14 @@ var xe = ["header", "submitText", "formConfig", "notificationText", "notificatio
|
|
|
169
168
|
value: function() {
|
|
170
169
|
var i = this.asProps, v = this.asProps, a, t = this, r = this.asProps, m = r.header, h = r.submitText, g = r.formConfig, _ = r.notificationText, l = r.notificationTitle, F = r.learnMoreLink;
|
|
171
170
|
r.Children;
|
|
172
|
-
var
|
|
171
|
+
var z = r.styles, O = r.forwardRef, T = r.status, $ = r.theme, U = r.background, M = r.rating, q = r.visible;
|
|
173
172
|
r.onVisibleChange;
|
|
174
|
-
var G = r.notificationVisible, J = r.onNotificationClose, S = r.getI18nText, K = r.errorFeedbackEmail,
|
|
173
|
+
var G = r.notificationVisible, J = r.onNotificationClose, S = r.getI18nText, K = r.errorFeedbackEmail, V = r.modalWidth, L = Z(r, Ee), Q = he, X = g.filter(function(d) {
|
|
175
174
|
return d.type === "checkbox";
|
|
176
175
|
}), Y = g.filter(function(d) {
|
|
177
176
|
return d.type === "textarea" || d.type === "input" || d.type === "email";
|
|
178
177
|
}), D = this.getNoticeTextId();
|
|
179
|
-
return a =
|
|
178
|
+
return a = R(z), /* @__PURE__ */ e.createElement(N, B({}, v), /* @__PURE__ */ e.createElement(u, a.cn("Notice", {
|
|
180
179
|
visible: G,
|
|
181
180
|
"aria-label": S("leaveFeedback"),
|
|
182
181
|
tag: k,
|
|
@@ -184,7 +183,7 @@ var xe = ["header", "submitText", "formConfig", "notificationText", "notificatio
|
|
|
184
183
|
}), /* @__PURE__ */ e.createElement(u.Label, {
|
|
185
184
|
mr: 3,
|
|
186
185
|
"aria-hidden": !0
|
|
187
|
-
}, /* @__PURE__ */ e.createElement(
|
|
186
|
+
}, /* @__PURE__ */ e.createElement(pe, a.cn("FeedbackIllustration", {}))), /* @__PURE__ */ e.createElement(u.Content, null, l ? /* @__PURE__ */ e.createElement(u.Title, null, l) : null, /* @__PURE__ */ e.createElement(u.Text, {
|
|
188
187
|
tag: k,
|
|
189
188
|
alignItems: l ? "flex-start" : "center"
|
|
190
189
|
}, /* @__PURE__ */ e.createElement(P, a.cn("Text", {
|
|
@@ -193,27 +192,27 @@ var xe = ["header", "submitText", "formConfig", "notificationText", "notificatio
|
|
|
193
192
|
}), _), /* @__PURE__ */ e.createElement(u.Actions, {
|
|
194
193
|
mt: 0
|
|
195
194
|
}, /* @__PURE__ */ e.createElement(W, a.cn("SliderRating", {
|
|
196
|
-
value:
|
|
195
|
+
value: M,
|
|
197
196
|
onChange: this.handleChangeRating,
|
|
198
197
|
"aria-labelledby": D
|
|
199
|
-
}))), F && /* @__PURE__ */ e.createElement(
|
|
198
|
+
}))), F && /* @__PURE__ */ e.createElement(fe, a.cn("Link", {
|
|
200
199
|
ml: 3,
|
|
201
200
|
href: F
|
|
202
201
|
}), S("learnMore")))), /* @__PURE__ */ e.createElement(u.Close, {
|
|
203
202
|
onClick: J
|
|
204
|
-
})), /* @__PURE__ */ e.createElement(Q, a.cn("SFeedbackRating", x({},
|
|
203
|
+
})), /* @__PURE__ */ e.createElement(Q, a.cn("SFeedbackRating", x({}, B({
|
|
205
204
|
visible: q,
|
|
206
205
|
onClose: this.handelCloseModal,
|
|
207
206
|
p: 0,
|
|
208
|
-
"use:w":
|
|
207
|
+
"use:w": V ?? 440,
|
|
209
208
|
"aria-labelledby": this.headerId
|
|
210
|
-
}, i))), /* @__PURE__ */ e.createElement(
|
|
209
|
+
}, i))), /* @__PURE__ */ e.createElement(oe, a.cn("Form", x({
|
|
211
210
|
decorators: [this.focusDecorator]
|
|
212
211
|
}, L)), function(d) {
|
|
213
212
|
var c;
|
|
214
|
-
return c =
|
|
213
|
+
return c = R(z), /* @__PURE__ */ e.createElement(se, c.cn("SpinContainer", {
|
|
215
214
|
background: U,
|
|
216
|
-
theme:
|
|
215
|
+
theme: $,
|
|
217
216
|
size: "xl",
|
|
218
217
|
loading: T !== "loading" ? d.submitting : T === "loading",
|
|
219
218
|
p: 1,
|
|
@@ -221,35 +220,35 @@ var xe = ["header", "submitText", "formConfig", "notificationText", "notificatio
|
|
|
221
220
|
}), /* @__PURE__ */ e.createElement(k, c.cn("Flex", {
|
|
222
221
|
justifyContent: "center"
|
|
223
222
|
}), /* @__PURE__ */ e.createElement(W, c.cn("SliderRating", {
|
|
224
|
-
value:
|
|
223
|
+
value: M,
|
|
225
224
|
readonly: !0
|
|
226
225
|
}))), (m == null ? void 0 : m.type) === E.Header ? m : /* @__PURE__ */ e.createElement(E.Header, null, m), /* @__PURE__ */ e.createElement(N, c.cn("Box", x(x({
|
|
227
226
|
tag: "form",
|
|
228
227
|
noValidate: !0,
|
|
229
228
|
method: "POST",
|
|
230
|
-
ref:
|
|
229
|
+
ref: O
|
|
231
230
|
}, L), {}, {
|
|
232
231
|
onSubmit: d.handleSubmit
|
|
233
232
|
})), /* @__PURE__ */ e.createElement(H, c.cn("Field", {
|
|
234
233
|
name: "rating",
|
|
235
|
-
initialValue:
|
|
234
|
+
initialValue: M
|
|
236
235
|
}), function(C) {
|
|
237
|
-
var
|
|
238
|
-
return /* @__PURE__ */ e.createElement("input", I({},
|
|
236
|
+
var w = C.input;
|
|
237
|
+
return /* @__PURE__ */ e.createElement("input", I({}, w, {
|
|
239
238
|
type: "hidden"
|
|
240
239
|
}));
|
|
241
240
|
}), /* @__PURE__ */ e.createElement("div", c.cn("div", {
|
|
242
241
|
role: "group",
|
|
243
242
|
"aria-labelledby": t.headerId
|
|
244
|
-
}), X.map(function(C,
|
|
245
|
-
return t.renderCheckbox(C,
|
|
243
|
+
}), X.map(function(C, w) {
|
|
244
|
+
return t.renderCheckbox(C, w);
|
|
246
245
|
})), Y.map(function(C) {
|
|
247
246
|
return t.renderTextField(C);
|
|
248
247
|
}), t.state.error && /* @__PURE__ */ e.createElement(u, c.cn("Notice", {
|
|
249
248
|
theme: "warning",
|
|
250
249
|
mt: 4,
|
|
251
250
|
mb: 4
|
|
252
|
-
}), /* @__PURE__ */ e.createElement(u.Label, null, /* @__PURE__ */ e.createElement(
|
|
251
|
+
}), /* @__PURE__ */ e.createElement(u.Label, null, /* @__PURE__ */ e.createElement(de, c.cn("WarnM", {}))), /* @__PURE__ */ e.createElement(u.Content, null, S("errorMessage", {
|
|
253
252
|
email: K
|
|
254
253
|
}))), /* @__PURE__ */ e.createElement(k, c.cn("Flex", {
|
|
255
254
|
mt: 4,
|
|
@@ -258,15 +257,15 @@ var xe = ["header", "submitText", "formConfig", "notificationText", "notificatio
|
|
|
258
257
|
loading: T !== "loading" ? d.submitting : T === "loading",
|
|
259
258
|
size: "l"
|
|
260
259
|
}, h ?? S("submitButton")))));
|
|
261
|
-
})), /* @__PURE__ */ e.createElement(
|
|
260
|
+
})), /* @__PURE__ */ e.createElement(Ce, a.cn("NoticeBubbleContainer", {
|
|
262
261
|
manager: this.manager
|
|
263
262
|
})));
|
|
264
263
|
}
|
|
265
264
|
}]), o;
|
|
266
|
-
}(
|
|
265
|
+
}(ie);
|
|
267
266
|
s(y, "displayName", "FeedbackRatingForm");
|
|
268
|
-
s(y, "style",
|
|
269
|
-
s(y, "enhance", [
|
|
267
|
+
s(y, "style", xe);
|
|
268
|
+
s(y, "enhance", [me(A), ce()]);
|
|
270
269
|
s(y, "defaultProps", {
|
|
271
270
|
onSubmit: function() {
|
|
272
271
|
},
|
|
@@ -289,9 +288,9 @@ s(y, "validate", {
|
|
|
289
288
|
};
|
|
290
289
|
}
|
|
291
290
|
});
|
|
292
|
-
function
|
|
291
|
+
function _e(b) {
|
|
293
292
|
var p = arguments[0], o, n = b.styles, i = P;
|
|
294
|
-
return o =
|
|
293
|
+
return o = R(n), /* @__PURE__ */ e.createElement(i, o.cn("SHeader", x({}, B({
|
|
295
294
|
size: 300,
|
|
296
295
|
tag: "h2",
|
|
297
296
|
mb: 4,
|
|
@@ -299,11 +298,11 @@ function Fe(b) {
|
|
|
299
298
|
textAlign: "center"
|
|
300
299
|
}, p))));
|
|
301
300
|
}
|
|
302
|
-
var E =
|
|
303
|
-
Header:
|
|
304
|
-
Item:
|
|
305
|
-
Checkbox:
|
|
306
|
-
Submit:
|
|
301
|
+
var E = ae(y, {
|
|
302
|
+
Header: _e,
|
|
303
|
+
Item: be,
|
|
304
|
+
Checkbox: ke,
|
|
305
|
+
Submit: ve
|
|
307
306
|
});
|
|
308
307
|
export {
|
|
309
308
|
E as default
|
|
@@ -1,106 +1,103 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
1
|
+
import b from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import w from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
|
+
import T from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
+
import c from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
5
|
+
import A from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
+
import D from "@babel/runtime/helpers/esm/createSuper";
|
|
7
7
|
import _ from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import { sstyled as
|
|
9
|
-
import $, { assignProps as L, sstyled as I, Component as Z } from "@semcore/core";
|
|
8
|
+
import { sstyled as x, createComponent as F, assignProps as k, Component as Z } from "@semcore/core";
|
|
10
9
|
import s from "react";
|
|
11
|
-
import { Box as
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import B from "@semcore/utils/lib/enhances/i18nEnhance";
|
|
10
|
+
import { Box as y, Flex as $ } from "@semcore/flex-box";
|
|
11
|
+
import z from "@semcore/core/lib/utils/uniqueID";
|
|
12
|
+
import K from "@semcore/core/lib/utils/enhances/i18nEnhance";
|
|
15
13
|
import { localizedMessages as C } from "../../translations/__intergalactic-dynamic-locales.mjs";
|
|
16
|
-
var
|
|
14
|
+
var N = (
|
|
17
15
|
/*__reshadow_css_start__*/
|
|
18
|
-
(
|
|
16
|
+
(x.insert(
|
|
19
17
|
/*__inner_css_start__*/
|
|
20
|
-
".
|
|
21
|
-
"
|
|
18
|
+
".___SSliderRating_kf6ar_gg_ .___SStar_kf6ar_gg_{transition:all calc(var(--intergalactic-duration-control, 200)*1ms) ease-out}.___SSliderRating_kf6ar_gg_:focus-visible .___SStar_kf6ar_gg_.__hovered_kf6ar_gg_{cursor:pointer;transform:scale(1.3)}@media (hover:hover){.___SSliderRating_kf6ar_gg_ .___SStar_kf6ar_gg_:hover{cursor:pointer;transform:scale(1.3)}.___SSliderRating_kf6ar_gg_.__readonly_kf6ar_gg_ .___SStar_kf6ar_gg_:hover{cursor:default;transform:none;transition:none}}.___SStar_kf6ar_gg_.__filled_kf6ar_gg_:active{animation:wobble .8s ease-in-out}.___SStar_kf6ar_gg_ path{fill:transparent;stroke:var(--intergalactic-slider-rating-normal, #a9abb6);stroke-width:2}.___SStar_kf6ar_gg_.__filled_kf6ar_gg_ path{stroke-width:0;fill:var(--intergalactic-slider-rating-hover-active, #fdc23c)}",
|
|
19
|
+
"kf6ar_gg_"
|
|
22
20
|
), {
|
|
23
|
-
__SSliderRating: "
|
|
24
|
-
__SStar: "
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_filled: "__filled_1ii78_gg_"
|
|
21
|
+
__SSliderRating: "___SSliderRating_kf6ar_gg_",
|
|
22
|
+
__SStar: "___SStar_kf6ar_gg_",
|
|
23
|
+
_hovered: "__hovered_kf6ar_gg_",
|
|
24
|
+
_readonly: "__readonly_kf6ar_gg_",
|
|
25
|
+
_filled: "__filled_kf6ar_gg_"
|
|
29
26
|
})
|
|
30
|
-
),
|
|
31
|
-
|
|
32
|
-
var
|
|
27
|
+
), L = 1, g = 5, v = /* @__PURE__ */ function(u) {
|
|
28
|
+
A(l, u);
|
|
29
|
+
var h = D(l);
|
|
33
30
|
function l() {
|
|
34
31
|
var e;
|
|
35
|
-
|
|
32
|
+
w(this, l);
|
|
36
33
|
for (var o = arguments.length, a = new Array(o), t = 0; t < o; t++)
|
|
37
34
|
a[t] = arguments[t];
|
|
38
|
-
return e =
|
|
35
|
+
return e = h.call.apply(h, [this].concat(a)), _(c(e), "state", {
|
|
39
36
|
hoveredIndex: -1,
|
|
40
37
|
clickedIndex: -1
|
|
41
|
-
}), _(
|
|
42
|
-
return function(
|
|
43
|
-
var
|
|
44
|
-
|
|
38
|
+
}), _(c(e), "handleClick", function(r) {
|
|
39
|
+
return function(n) {
|
|
40
|
+
var i = e.asProps.readonly;
|
|
41
|
+
i || e.setValue(r);
|
|
45
42
|
};
|
|
46
|
-
}), _(
|
|
43
|
+
}), _(c(e), "handleMouseEnder", function(r) {
|
|
47
44
|
return function() {
|
|
48
45
|
e.setState({
|
|
49
46
|
hoveredIndex: r
|
|
50
47
|
});
|
|
51
48
|
};
|
|
52
|
-
}), _(
|
|
49
|
+
}), _(c(e), "handleMouseLeave", function() {
|
|
53
50
|
e.setState({
|
|
54
51
|
hoveredIndex: -1
|
|
55
52
|
});
|
|
56
|
-
}), _(
|
|
57
|
-
var
|
|
58
|
-
|
|
53
|
+
}), _(c(e), "setValue", function(r) {
|
|
54
|
+
var n = e.asProps, i = n.onChange, f = n.value;
|
|
55
|
+
i && i(r), r <= f ? e.setState({
|
|
59
56
|
clickedIndex: r
|
|
60
57
|
}) : e.setState({
|
|
61
58
|
clickedIndex: -1
|
|
62
59
|
});
|
|
63
|
-
}), _(
|
|
60
|
+
}), _(c(e), "handleKeyDown", function(r) {
|
|
64
61
|
if (["ArrowLeft", "ArrowRight", "Enter"].includes(r.key))
|
|
65
62
|
if (r.preventDefault(), r.key === "Enter") {
|
|
66
|
-
var
|
|
67
|
-
e.setValue(
|
|
63
|
+
var n = e.state.hoveredIndex;
|
|
64
|
+
e.setValue(n + 1);
|
|
68
65
|
} else {
|
|
69
|
-
var
|
|
70
|
-
d > g && (d = g), d <
|
|
66
|
+
var i = e.asProps.value, f = e.state.hoveredIndex, S = r.key === "ArrowLeft" ? -1 : 1, d = f === -1 ? i + S : f + 1 + S;
|
|
67
|
+
d > g && (d = g), d < L && (d = L), e.setState({
|
|
71
68
|
hoveredIndex: d - 1
|
|
72
69
|
});
|
|
73
70
|
}
|
|
74
71
|
}), e;
|
|
75
72
|
}
|
|
76
|
-
return
|
|
73
|
+
return T(l, [{
|
|
77
74
|
key: "getStarProps",
|
|
78
75
|
value: function(o, a) {
|
|
79
|
-
var t = this.asProps, r = t.value,
|
|
76
|
+
var t = this.asProps, r = t.value, n = t.readonly, i = this.state.hoveredIndex;
|
|
80
77
|
return {
|
|
81
|
-
filled: r && a + 1 <= r || a <=
|
|
78
|
+
filled: r && a + 1 <= r || a <= i,
|
|
82
79
|
onClick: this.handleClick(a + 1),
|
|
83
|
-
onMouseEnter:
|
|
84
|
-
hovered:
|
|
80
|
+
onMouseEnter: n ? void 0 : this.handleMouseEnder(a),
|
|
81
|
+
hovered: i === a
|
|
85
82
|
};
|
|
86
83
|
}
|
|
87
84
|
}, {
|
|
88
85
|
key: "getLabelText",
|
|
89
86
|
value: function() {
|
|
90
|
-
var o = this.state.hoveredIndex, a = this.asProps, t = a.readonly, r = a.value,
|
|
87
|
+
var o = this.state.hoveredIndex, a = this.asProps, t = a.readonly, r = a.value, n = a.getI18nText;
|
|
91
88
|
if (t)
|
|
92
|
-
return
|
|
89
|
+
return n("FeedbackRating.SliderRating.aria-valuetext.readonly", {
|
|
93
90
|
selectedRating: r,
|
|
94
91
|
max: g
|
|
95
92
|
});
|
|
96
93
|
if (r) {
|
|
97
|
-
var
|
|
98
|
-
return
|
|
99
|
-
selectedRating:
|
|
94
|
+
var i = o > -1 ? o + 1 : r;
|
|
95
|
+
return n("FeedbackRating.SliderRating.aria-valuetext", {
|
|
96
|
+
selectedRating: i,
|
|
100
97
|
max: g
|
|
101
98
|
});
|
|
102
99
|
}
|
|
103
|
-
return o === -1 ?
|
|
100
|
+
return o === -1 ? n("FeedbackRating.SliderRating.aria-valuetext.empty") : n("FeedbackRating.SliderRating.aria-valuetext", {
|
|
104
101
|
selectedRating: o + 1,
|
|
105
102
|
max: g
|
|
106
103
|
});
|
|
@@ -108,49 +105,49 @@ var j = (
|
|
|
108
105
|
}, {
|
|
109
106
|
key: "render",
|
|
110
107
|
value: function() {
|
|
111
|
-
var o = this.asProps, a, t = this.asProps, r = t.styles,
|
|
112
|
-
if (
|
|
113
|
-
return /* @__PURE__ */ s.createElement(d,
|
|
108
|
+
var o = this.asProps, a, t = this.asProps, r = t.styles, n = t.readonly, i = t.getI18nText, f = t.value, S = this.state.hoveredIndex, d = $, m = this.getLabelText();
|
|
109
|
+
if (n)
|
|
110
|
+
return /* @__PURE__ */ s.createElement(d, k({
|
|
114
111
|
gap: 1,
|
|
115
112
|
role: "img",
|
|
116
|
-
"aria-label":
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
return /* @__PURE__ */ s.createElement(x, {
|
|
113
|
+
"aria-label": m
|
|
114
|
+
}, o), new Array(g).fill(null).map(function(M, p) {
|
|
115
|
+
return /* @__PURE__ */ s.createElement(y, {
|
|
120
116
|
key: p,
|
|
121
117
|
position: "relative"
|
|
122
|
-
}, /* @__PURE__ */ s.createElement(
|
|
118
|
+
}, /* @__PURE__ */ s.createElement(I.Star, null));
|
|
123
119
|
}));
|
|
124
|
-
var R =
|
|
125
|
-
return a =
|
|
120
|
+
var R = S + 1, P = R > 0 || f ? "".concat(m, ". ").concat(i("FeedbackRating.SliderRating.ScreenReaderOnly.sliderDescriber"), ".") : m;
|
|
121
|
+
return a = x(r), /* @__PURE__ */ s.createElement(d, a.cn("SSliderRating", b({}, k({
|
|
126
122
|
gap: 1,
|
|
123
|
+
tabIndex: 0,
|
|
127
124
|
onMouseLeave: this.handleMouseLeave,
|
|
128
125
|
onKeyDown: this.handleKeyDown,
|
|
129
126
|
role: "slider",
|
|
130
127
|
"aria-orientation": "horizontal",
|
|
131
|
-
"aria-valuemin":
|
|
128
|
+
"aria-valuemin": L,
|
|
132
129
|
"aria-valuemax": g,
|
|
133
130
|
"aria-valuetext": P,
|
|
134
131
|
"aria-valuenow": R
|
|
135
|
-
}, o))), new Array(g).fill(null).map(function(
|
|
136
|
-
return /* @__PURE__ */ s.createElement(
|
|
132
|
+
}, o))), new Array(g).fill(null).map(function(M, p) {
|
|
133
|
+
return /* @__PURE__ */ s.createElement(y, {
|
|
137
134
|
key: p,
|
|
138
135
|
position: "relative"
|
|
139
|
-
}, /* @__PURE__ */ s.createElement(
|
|
136
|
+
}, /* @__PURE__ */ s.createElement(I.Star, null));
|
|
140
137
|
}));
|
|
141
138
|
}
|
|
142
139
|
}]), l;
|
|
143
140
|
}(Z);
|
|
144
|
-
_(
|
|
145
|
-
_(
|
|
146
|
-
_(
|
|
147
|
-
_(
|
|
141
|
+
_(v, "displayName", "SliderRating");
|
|
142
|
+
_(v, "style", N);
|
|
143
|
+
_(v, "enhance", [z(), K(C)]);
|
|
144
|
+
_(v, "defaultProps", {
|
|
148
145
|
i18n: C,
|
|
149
146
|
locale: "en"
|
|
150
147
|
});
|
|
151
|
-
function E(
|
|
152
|
-
var
|
|
153
|
-
return l =
|
|
148
|
+
function E(u) {
|
|
149
|
+
var h = arguments[0], l, e = y;
|
|
150
|
+
return l = x(u.styles), /* @__PURE__ */ s.createElement(e, l.cn("SStar", b({}, k({
|
|
154
151
|
tag: "svg",
|
|
155
152
|
role: "none",
|
|
156
153
|
width: "22",
|
|
@@ -158,16 +155,16 @@ function E(h) {
|
|
|
158
155
|
viewBox: "0 0 22 21",
|
|
159
156
|
fill: "none",
|
|
160
157
|
xmlns: "http://www.w3.org/2000/svg"
|
|
161
|
-
},
|
|
158
|
+
}, h))), u.filled ? /* @__PURE__ */ s.createElement("path", l.cn("path", {
|
|
162
159
|
d: "M10.6463 0.213566C10.7963 -0.0711885 11.2037 -0.071189 11.3537 0.213566L14.6682 6.50744L21.668 7.72084C21.9847 7.77572 22.1105 8.16305 21.8867 8.39378L16.9353 13.4978L17.9465 20.5422C17.9922 20.8607 17.6626 21.1002 17.3741 20.9581L11 17.8181L4.62585 20.9581C4.33738 21.1002 4.00781 20.8607 4.05353 20.5422L5.0647 13.4978L0.113338 8.39378C-0.110493 8.16305 0.0153421 7.77572 0.331965 7.72084L7.33178 6.50744L10.6463 0.213566Z"
|
|
163
160
|
})) : /* @__PURE__ */ s.createElement("path", l.cn("path", {
|
|
164
161
|
d: "M13.7834 6.9734L14.0127 7.40871L14.4974 7.49274L20.3785 8.51222L16.2175 12.8015L15.8757 13.1539L15.9454 13.6399L16.7949 19.558L11.4419 16.921L11 16.7033L10.5581 16.921L5.20505 19.558L6.05456 13.6399L6.12432 13.1539L5.78246 12.8015L1.62146 8.51222L7.50258 7.49274L7.98734 7.40871L8.21659 6.9734L11 1.68803L13.7834 6.9734ZM21.4972 8.70614C21.4969 8.70608 21.4965 8.70602 21.4961 8.70595L21.4972 8.70614ZM0.502765 8.70614L0.503758 8.70597C0.503427 8.70603 0.503095 8.70609 0.502764 8.70614L0.400352 8.11535L0.502765 8.70614Z"
|
|
165
162
|
})));
|
|
166
163
|
}
|
|
167
164
|
E.displayName = "Star";
|
|
168
|
-
var
|
|
165
|
+
var I = F(v, {
|
|
169
166
|
Star: E
|
|
170
167
|
});
|
|
171
168
|
export {
|
|
172
|
-
|
|
169
|
+
I as default
|
|
173
170
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
declare const CheckboxButton: import("@semcore/core").ComponentType<unknown, {}, {}, {
|
|
1
|
+
declare const CheckboxButton: import("@semcore/core/lib/types/coreFactory").ComponentType<unknown, {}, {}, {
|
|
2
2
|
[key: string]: (arg: unknown) => void;
|
|
3
3
|
}, null>;
|
|
4
4
|
export default CheckboxButton;
|
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": "
|
|
4
|
+
"version": "16.0.0-prerelease.2",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,29 +14,26 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/
|
|
18
|
-
"@semcore/
|
|
19
|
-
"@semcore/
|
|
20
|
-
"@semcore/
|
|
21
|
-
"@semcore/
|
|
22
|
-
"@semcore/
|
|
23
|
-
"@semcore/
|
|
24
|
-
"@semcore/
|
|
25
|
-
"@semcore/
|
|
17
|
+
"@semcore/flex-box": "16.0.0-prerelease.2",
|
|
18
|
+
"@semcore/checkbox": "16.0.0-prerelease.2",
|
|
19
|
+
"@semcore/notice-bubble": "16.0.0-prerelease.2",
|
|
20
|
+
"@semcore/typography": "16.0.0-prerelease.2",
|
|
21
|
+
"@semcore/link": "16.0.0-prerelease.2",
|
|
22
|
+
"@semcore/modal": "16.0.0-prerelease.2",
|
|
23
|
+
"@semcore/illustration": "16.0.0-prerelease.2",
|
|
24
|
+
"@semcore/icon": "16.0.0-prerelease.2",
|
|
25
|
+
"@semcore/textarea": "16.0.0-prerelease.2",
|
|
26
|
+
"@semcore/input": "16.0.0-prerelease.2",
|
|
26
27
|
"final-form": "4.20.7",
|
|
27
|
-
"@semcore/button": "
|
|
28
|
-
"@semcore/
|
|
29
|
-
"@semcore/
|
|
30
|
-
"@semcore/
|
|
31
|
-
"@semcore/tooltip": "6.49.1",
|
|
32
|
-
"@semcore/utils": "4.48.1",
|
|
28
|
+
"@semcore/button": "16.0.0-prerelease.2",
|
|
29
|
+
"@semcore/notice": "16.0.0-prerelease.2",
|
|
30
|
+
"@semcore/spin-container": "16.0.0-prerelease.2",
|
|
31
|
+
"@semcore/tooltip": "16.0.0-prerelease.2",
|
|
33
32
|
"final-form-focus": "1.1.2",
|
|
34
33
|
"react-final-form": "6.5.9"
|
|
35
34
|
},
|
|
36
35
|
"peerDependencies": {
|
|
37
|
-
"@semcore/
|
|
38
|
-
"react": "16.8 - 18",
|
|
39
|
-
"react-dom": "16.8 - 18"
|
|
36
|
+
"@semcore/base-components": "^16.0.0-prerelease.2"
|
|
40
37
|
},
|
|
41
38
|
"repository": {
|
|
42
39
|
"type": "git",
|