@semcore/feedback-form 16.0.0-prerelease.6 → 16.0.0-prerelease.7
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/lib/esm/FeedbackForm.mjs +122 -104
- package/lib/esm/component/checkbox-button/CheckboxButton.mjs +45 -38
- package/lib/esm/component/feedback-item/FeedbackItem.mjs +44 -33
- package/lib/esm/component/feedback-rating/FeedbackRating.mjs +286 -241
- package/lib/esm/component/slider-rating/SliderRating.mjs +166 -129
- package/lib/esm/component/submit-button/SubmitButton.mjs +14 -12
- package/lib/esm/index.mjs +4 -4
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +30 -30
- package/lib/esm/translations/de.json.mjs +20 -14
- package/lib/esm/translations/en.json.mjs +20 -14
- package/lib/esm/translations/es.json.mjs +20 -14
- package/lib/esm/translations/fr.json.mjs +20 -14
- package/lib/esm/translations/it.json.mjs +20 -14
- package/lib/esm/translations/ja.json.mjs +20 -14
- package/lib/esm/translations/ko.json.mjs +20 -14
- package/lib/esm/translations/nl.json.mjs +20 -14
- package/lib/esm/translations/pl.json.mjs +20 -14
- package/lib/esm/translations/pt.json.mjs +20 -14
- package/lib/esm/translations/sv.json.mjs +20 -14
- package/lib/esm/translations/tr.json.mjs +20 -14
- package/lib/esm/translations/vi.json.mjs +20 -14
- package/lib/esm/translations/zh.json.mjs +20 -14
- package/package.json +16 -16
package/lib/esm/FeedbackForm.mjs
CHANGED
|
@@ -1,136 +1,154 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { createComponent
|
|
11
|
-
import
|
|
12
|
-
import { Form
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import
|
|
16
|
-
import { NoticeSmart
|
|
17
|
-
import { Box
|
|
18
|
-
import { FeedbackItem
|
|
19
|
-
import { SubmitButton
|
|
20
|
-
var
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
5
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
6
|
+
import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
|
|
7
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
8
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
9
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
10
|
+
import { createComponent, sstyled, Component, assignProps } from "@semcore/core";
|
|
11
|
+
import React from "react";
|
|
12
|
+
import { Form, Field } from "react-final-form";
|
|
13
|
+
import createFocusDecorator from "final-form-focus";
|
|
14
|
+
import Button from "@semcore/button";
|
|
15
|
+
import SpinContainer from "@semcore/spin-container";
|
|
16
|
+
import { NoticeSmart } from "@semcore/notice";
|
|
17
|
+
import { Box } from "@semcore/flex-box";
|
|
18
|
+
import { FeedbackItem } from "./component/feedback-item/FeedbackItem.mjs";
|
|
19
|
+
import { SubmitButton } from "./component/submit-button/SubmitButton.mjs";
|
|
20
|
+
var _excluded = ["Children", "styles", "forwardRef", "loading", "background", "theme"];
|
|
21
|
+
var style = (
|
|
21
22
|
/*__reshadow_css_start__*/
|
|
22
|
-
(
|
|
23
|
+
(sstyled.insert(
|
|
23
24
|
/*__inner_css_start__*/
|
|
24
25
|
`.___SFeedbackForm_glabv_gg_{max-width:320px}.___SCancel_glabv_gg_,.___SSubmit_glabv_gg_{display:inline-flex;margin-right:var(--intergalactic-spacing-2x, 8px)}.___SNotice_glabv_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, 6px) var(--intergalactic-surface-rounded, 6px)}.___SSuccess_glabv_gg_{display:flex;align-items:center;flex-direction:column;width:320px;padding:var(--intergalactic-spacing-10x, 40px);box-sizing:border-box;outline:0}.___SEmail_glabv_gg_{margin-bottom:calc(var(--intergalactic-spacing-4x, 16px) + var(--intergalactic-spacing-05x, 2px));width:80px;height:80px;background-image:url("data:image/svg+xml,%3Csvg width='80' height='80' viewBox='0 0 80 80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M28.1632 6.00003C27.9554 5.99875 27.7493 6.03875 27.5571 6.11772C27.3648 6.19668 27.1902 6.31304 27.0432 6.46003L14.1332 19.38C7.645 25.8687 4 34.669 4 43.845C4 53.0211 7.645 61.8213 14.1332 68.31C17.3463 71.5242 21.1611 74.0738 25.3597 75.8134C29.5583 77.5529 34.0585 78.4482 38.6032 78.4482C43.1479 78.4482 47.6481 77.5529 51.8467 75.8134C56.0454 74.0738 59.8602 71.5242 63.0732 68.31L75.9832 55.4C76.1316 55.2536 76.2495 55.0792 76.3301 54.887C76.4108 54.6948 76.4526 54.4885 76.4532 54.28V6.89003C76.4506 6.65307 76.3546 6.42671 76.1861 6.26009C76.0176 6.09346 75.7902 6.00002 75.5532 6.00003H28.1632Z' fill='%2345E0A8'/%3E%3Cpath d='M29 45.2852L29.2 45.6352C35.39 42.1852 53.39 31.9652 56.73 35.1052C55.6 32.0052 39.7 35.4352 29 45.2852Z' fill='white'/%3E%3Cpath d='M28.44 31.6343C26.63 37.6343 19.23 56.1043 15 61.9443L18 62.8543L19.58 61.5343C23.8 51.9843 29.58 35.5343 29.89 30.0743C29.39 29.8143 28.93 30.2143 28.44 31.6343Z' fill='white'/%3E%3Cpath d='M15 62.0078C19.23 56.1678 26.63 37.7378 28.44 31.6678C30.25 25.5978 33.49 37.6678 31.67 42.7878' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M28 45.9424C38.68 35.5824 55.27 31.9424 56.43 35.1024C57.12 36.9924 43 41.3624 38.02 47.4224' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M44.45 21.93C41.21 20.77 35.86 19.04 33 18.24C37.12 16.41 70 4.24 72.67 3C71.75 7.11 67.75 21.28 65.96 27.93C61.13 26.25 56.23 24.78 53.03 23.74C51.0298 26.3907 49.2219 29.1812 47.62 32.09C46.44 28.23 45.29 23.77 44.45 21.93Z' fill='white' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M45 22.08L61.74 11' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M53 23.73L72.64 3' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48 32.58L55.86 25' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.23 30.77L51.69 25.13L52.66 24L54.73 24.61L55.16 24.48L51.8 27.91L49.33 30.18L48 31.29L48.23 30.77Z' fill='black'/%3E%3Cpath d='M33.81 22L23 27.12' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M40.89 23L34 27.37' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M62.04 29L58 38.85' stroke='white' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M46.68 41C50.29 43.42 44.81 49.52 43 51.12' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M47.17 44C51.31 46.09 48.33 51.76 46 54.6' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cpath d='M48.86 49C54.37 53.48 36.31 72.72 35 73.78' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3Cmask id='mask0_11950_117175' style='mask-type:alpha' maskUnits='userSpaceOnUse' x='4' y='6' width='73' height='73'%3E%3Cpath d='M28.1632 6.00003C27.9554 5.99875 27.7493 6.03875 27.5571 6.11772C27.3648 6.19668 27.1902 6.31304 27.0432 6.46003L14.1332 19.38C7.645 25.8687 4 34.669 4 43.845C4 53.0211 7.645 61.8213 14.1332 68.31C17.3463 71.5242 21.1611 74.0738 25.3597 75.8134C29.5583 77.5529 34.0585 78.4482 38.6032 78.4482C43.1479 78.4482 47.6481 77.5529 51.8467 75.8134C56.0454 74.0738 59.8602 71.5242 63.0732 68.31L75.9832 55.4C76.1316 55.2536 76.2495 55.0792 76.3301 54.887C76.4108 54.6948 76.4526 54.4885 76.4532 54.28V6.89003C76.4506 6.65307 76.3546 6.42671 76.1861 6.26009C76.0176 6.09346 75.7902 6.00002 75.5532 6.00003H28.1632Z' fill='%2345DFA7'/%3E%3C/mask%3E%3Cg mask='url(%23mask0_11950_117175)'%3E%3Cpath d='M5 74.6871C7.49 72.3471 13.24 63.6871 14.52 61.2471C28.18 59.1271 34.71 71.2471 34.98 74.7671C32.7234 79.651 30.1305 84.3723 27.22 88.8971' fill='black'/%3E%3Cpath d='M5 74.6871C7.49 72.3471 13.24 63.6871 14.52 61.2471C28.18 59.1271 34.71 71.2471 34.98 74.7671C32.7234 79.651 30.1305 84.3723 27.22 88.8971' stroke='black' stroke-width='0.75' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/g%3E%3C/svg%3E%0A")}`,
|
|
25
26
|
"glabv_gg_"
|
|
26
27
|
), {
|
|
27
|
-
__SFeedbackForm: "___SFeedbackForm_glabv_gg_",
|
|
28
|
-
__SSubmit: "___SSubmit_glabv_gg_",
|
|
29
|
-
__SCancel: "___SCancel_glabv_gg_",
|
|
30
|
-
__SNotice: "___SNotice_glabv_gg_",
|
|
31
|
-
__SSuccess: "___SSuccess_glabv_gg_",
|
|
32
|
-
__SEmail: "___SEmail_glabv_gg_"
|
|
28
|
+
"__SFeedbackForm": "___SFeedbackForm_glabv_gg_",
|
|
29
|
+
"__SSubmit": "___SSubmit_glabv_gg_",
|
|
30
|
+
"__SCancel": "___SCancel_glabv_gg_",
|
|
31
|
+
"__SNotice": "___SNotice_glabv_gg_",
|
|
32
|
+
"__SSuccess": "___SSuccess_glabv_gg_",
|
|
33
|
+
"__SEmail": "___SEmail_glabv_gg_"
|
|
33
34
|
})
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
);
|
|
36
|
+
var FeedbackForm = /* @__PURE__ */ function(_Component) {
|
|
37
|
+
_inherits(FeedbackForm2, _Component);
|
|
38
|
+
var _super = _createSuper(FeedbackForm2);
|
|
39
|
+
function FeedbackForm2() {
|
|
40
|
+
var _this;
|
|
41
|
+
_classCallCheck(this, FeedbackForm2);
|
|
42
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
43
|
+
args[_key] = arguments[_key];
|
|
44
|
+
}
|
|
45
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
46
|
+
_defineProperty(_assertThisInitialized(_this), "focusDecorator", createFocusDecorator());
|
|
47
|
+
return _this;
|
|
43
48
|
}
|
|
44
|
-
|
|
49
|
+
_createClass(FeedbackForm2, [{
|
|
45
50
|
key: "getItemProps",
|
|
46
|
-
value: function() {
|
|
47
|
-
var
|
|
51
|
+
value: function getItemProps() {
|
|
52
|
+
var validateOnBlur = this.asProps.validateOnBlur;
|
|
48
53
|
return {
|
|
49
|
-
validateOnBlur
|
|
54
|
+
validateOnBlur
|
|
50
55
|
};
|
|
51
56
|
}
|
|
52
57
|
}, {
|
|
53
58
|
key: "render",
|
|
54
|
-
value: function() {
|
|
55
|
-
var
|
|
56
|
-
|
|
59
|
+
value: function render() {
|
|
60
|
+
var SFeedbackForm = Box;
|
|
61
|
+
var _this$asProps = this.asProps, Children = _this$asProps.Children, styles = _this$asProps.styles, forwardRef = _this$asProps.forwardRef, loading = _this$asProps.loading, background = _this$asProps.background, theme = _this$asProps.theme, other = _objectWithoutProperties(_this$asProps, _excluded);
|
|
62
|
+
return /* @__PURE__ */ React.createElement(Form, _extends({
|
|
57
63
|
decorators: [this.focusDecorator]
|
|
58
|
-
},
|
|
59
|
-
var
|
|
60
|
-
return
|
|
61
|
-
background:
|
|
62
|
-
theme:
|
|
63
|
-
size: "xl",
|
|
64
|
-
loading:
|
|
65
|
-
}), /* @__PURE__ */
|
|
66
|
-
tag: "form",
|
|
67
|
-
noValidate:
|
|
68
|
-
method: "POST",
|
|
69
|
-
ref:
|
|
70
|
-
},
|
|
71
|
-
onSubmit:
|
|
72
|
-
})), typeof
|
|
64
|
+
}, other), function(api) {
|
|
65
|
+
var _ref4;
|
|
66
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(SpinContainer, _ref4.cn("SpinContainer", {
|
|
67
|
+
"background": background,
|
|
68
|
+
"theme": theme,
|
|
69
|
+
"size": "xl",
|
|
70
|
+
"loading": loading === void 0 ? api.submitting : loading
|
|
71
|
+
}), /* @__PURE__ */ React.createElement(SFeedbackForm, _ref4.cn("SFeedbackForm", _objectSpread(_objectSpread({
|
|
72
|
+
"tag": "form",
|
|
73
|
+
"noValidate": true,
|
|
74
|
+
"method": "POST",
|
|
75
|
+
"ref": forwardRef
|
|
76
|
+
}, other), {}, {
|
|
77
|
+
"onSubmit": api.handleSubmit
|
|
78
|
+
})), typeof Children.origin === "function" ? Children.origin(api) : /* @__PURE__ */ React.createElement(Children, _ref4.cn("Children", {}))));
|
|
73
79
|
});
|
|
74
80
|
}
|
|
75
|
-
}])
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
81
|
+
}]);
|
|
82
|
+
return FeedbackForm2;
|
|
83
|
+
}(Component);
|
|
84
|
+
_defineProperty(FeedbackForm, "displayName", "FeedbackForm");
|
|
85
|
+
_defineProperty(FeedbackForm, "style", style);
|
|
86
|
+
_defineProperty(FeedbackForm, "FinalForm", {
|
|
87
|
+
Field,
|
|
88
|
+
Form
|
|
82
89
|
});
|
|
83
|
-
|
|
84
|
-
onSubmit: function() {
|
|
90
|
+
_defineProperty(FeedbackForm, "defaultProps", {
|
|
91
|
+
onSubmit: function onSubmit() {
|
|
85
92
|
}
|
|
86
93
|
});
|
|
87
|
-
|
|
88
|
-
description: function(
|
|
94
|
+
_defineProperty(FeedbackForm, "validate", {
|
|
95
|
+
description: function description(error) {
|
|
89
96
|
return function() {
|
|
90
|
-
var
|
|
91
|
-
|
|
92
|
-
|
|
97
|
+
var value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
98
|
+
var words = value.split(/\s+/);
|
|
99
|
+
var symbols = words.join(" ");
|
|
100
|
+
if (symbols.length < 10 || words.length < 3) {
|
|
101
|
+
return error;
|
|
102
|
+
}
|
|
93
103
|
};
|
|
94
104
|
},
|
|
95
|
-
email: function(
|
|
105
|
+
email: function email(error) {
|
|
96
106
|
return function() {
|
|
97
|
-
var
|
|
98
|
-
if (!/.+@.+\..+/i.test(String(
|
|
99
|
-
return
|
|
107
|
+
var value = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
|
|
108
|
+
if (!/.+@.+\..+/i.test(String(value).toLowerCase())) {
|
|
109
|
+
return error;
|
|
110
|
+
}
|
|
100
111
|
};
|
|
101
112
|
}
|
|
102
113
|
});
|
|
103
|
-
function
|
|
104
|
-
var
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
114
|
+
function Success(props) {
|
|
115
|
+
var _ref = arguments[0], _ref5;
|
|
116
|
+
var Children = props.Children, styles = props.styles;
|
|
117
|
+
var SSuccess = Box;
|
|
118
|
+
var SEmail = "div";
|
|
119
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SSuccess, _ref5.cn("SSuccess", _objectSpread({}, assignProps({
|
|
120
|
+
"tabIndex": -1
|
|
121
|
+
}, _ref))), /* @__PURE__ */ React.createElement(SEmail, _ref5.cn("SEmail", {
|
|
122
|
+
"aria-hidden": true
|
|
123
|
+
})), /* @__PURE__ */ React.createElement("span", _ref5.cn("span", {}), /* @__PURE__ */ React.createElement(Children, _ref5.cn("Children", {}))));
|
|
110
124
|
}
|
|
111
|
-
|
|
112
|
-
function
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
125
|
+
Success.style = style;
|
|
126
|
+
function Cancel(props) {
|
|
127
|
+
var _ref2 = arguments[0], _ref6;
|
|
128
|
+
var styles = props.styles;
|
|
129
|
+
var SCancel = Button;
|
|
130
|
+
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SCancel, _ref6.cn("SCancel", _objectSpread({}, assignProps({
|
|
131
|
+
"type": "reset",
|
|
132
|
+
"use": "secondary",
|
|
133
|
+
"theme": "muted"
|
|
134
|
+
}, _ref2))));
|
|
119
135
|
}
|
|
120
|
-
function
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
136
|
+
function Notice(props) {
|
|
137
|
+
var _ref3 = arguments[0], _ref7;
|
|
138
|
+
var styles = props.styles, _props$theme = props.theme, theme = _props$theme === void 0 ? "muted" : _props$theme, _props$use = props.use, use = _props$use === void 0 ? "secondary" : _props$use;
|
|
139
|
+
var SNotice = NoticeSmart;
|
|
140
|
+
return _ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(SNotice, _ref7.cn("SNotice", _objectSpread({}, assignProps({
|
|
141
|
+
"use:theme": theme,
|
|
142
|
+
"use:use": use
|
|
143
|
+
}, _ref3))));
|
|
126
144
|
}
|
|
127
|
-
const
|
|
128
|
-
Item:
|
|
129
|
-
Success
|
|
130
|
-
Submit:
|
|
131
|
-
Cancel
|
|
132
|
-
Notice
|
|
145
|
+
const FeedbackForm$1 = createComponent(FeedbackForm, {
|
|
146
|
+
Item: FeedbackItem,
|
|
147
|
+
Success,
|
|
148
|
+
Submit: SubmitButton,
|
|
149
|
+
Cancel,
|
|
150
|
+
Notice
|
|
133
151
|
});
|
|
134
152
|
export {
|
|
135
|
-
|
|
153
|
+
FeedbackForm$1 as default
|
|
136
154
|
};
|
|
@@ -1,49 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { sstyled
|
|
9
|
-
import
|
|
10
|
-
import { Box
|
|
11
|
-
import
|
|
12
|
-
var
|
|
1
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
|
+
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
4
|
+
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
+
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
+
import { sstyled, createComponent, assignProps, Component } from "@semcore/core";
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { Box } from "@semcore/flex-box";
|
|
11
|
+
import Checkbox from "@semcore/checkbox";
|
|
12
|
+
var _excluded = ["styles", "id", "label", "type", "focused"];
|
|
13
|
+
var style = (
|
|
13
14
|
/*__reshadow_css_start__*/
|
|
14
|
-
(
|
|
15
|
+
(sstyled.insert(
|
|
15
16
|
/*__inner_css_start__*/
|
|
16
17
|
".___SCheckboxButton_nj35w_gg_{margin-top:var(--intergalactic-spacing-2x, 8px);border:1px solid var(--intergalactic-border-primary, #c4c7cf);border-radius:var(--intergalactic-rounded-medium, 6px)}.___SCheckboxButton_nj35w_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x, 12px);box-sizing:border-box}.___SCheckboxButton_nj35w_gg_.__checked_nj35w_gg_{cursor:pointer;border-color:var(--intergalactic-border-info-active, #006dca);background-color:rgba(0,143,248,.1)}@media (hover:hover){.___SCheckboxButton_nj35w_gg_:hover{cursor:pointer;border-color:var(--intergalactic-border-info-active, #006dca);background-color:rgba(0,143,248,.1)}.___SCheckboxButton_nj35w_gg_.__checked_nj35w_gg_:hover{background-color:rgba(0,143,248,.2)}}",
|
|
17
18
|
"nj35w_gg_"
|
|
18
19
|
), {
|
|
19
|
-
__SCheckboxButton: "___SCheckboxButton_nj35w_gg_",
|
|
20
|
-
_checked: "__checked_nj35w_gg_"
|
|
20
|
+
"__SCheckboxButton": "___SCheckboxButton_nj35w_gg_",
|
|
21
|
+
"_checked": "__checked_nj35w_gg_"
|
|
21
22
|
})
|
|
22
|
-
)
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
);
|
|
24
|
+
var CheckboxButtonRoot = /* @__PURE__ */ function(_Component) {
|
|
25
|
+
_inherits(CheckboxButtonRoot2, _Component);
|
|
26
|
+
var _super = _createSuper(CheckboxButtonRoot2);
|
|
27
|
+
function CheckboxButtonRoot2() {
|
|
28
|
+
_classCallCheck(this, CheckboxButtonRoot2);
|
|
29
|
+
return _super.apply(this, arguments);
|
|
27
30
|
}
|
|
28
|
-
|
|
31
|
+
_createClass(CheckboxButtonRoot2, [{
|
|
29
32
|
key: "render",
|
|
30
|
-
value: function() {
|
|
31
|
-
var
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
}), /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
value: function render() {
|
|
34
|
+
var _ref = this.asProps, _ref2;
|
|
35
|
+
var _this$asProps = this.asProps, styles = _this$asProps.styles, id = _this$asProps.id, label = _this$asProps.label;
|
|
36
|
+
_this$asProps.type;
|
|
37
|
+
var focused = _this$asProps.focused, other = _objectWithoutProperties(_this$asProps, _excluded);
|
|
38
|
+
var autoFocus = focused ? 20 : false;
|
|
39
|
+
var SCheckboxButton = Box;
|
|
40
|
+
return _ref2 = sstyled(styles), /* @__PURE__ */ React.createElement(SCheckboxButton, _ref2.cn("SCheckboxButton", _objectSpread({}, assignProps({
|
|
41
|
+
"__excludeProps": ["onChange", "id", "type"]
|
|
42
|
+
}, _ref))), /* @__PURE__ */ React.createElement(Checkbox, _ref2.cn("Checkbox", _objectSpread({}, other)), /* @__PURE__ */ React.createElement(Checkbox.Value, {
|
|
43
|
+
autoFocus,
|
|
44
|
+
"aria-labelledby": id
|
|
45
|
+
}), /* @__PURE__ */ React.createElement(Checkbox.Text, {
|
|
46
|
+
id
|
|
47
|
+
}, label)));
|
|
42
48
|
}
|
|
43
|
-
}])
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
49
|
+
}]);
|
|
50
|
+
return CheckboxButtonRoot2;
|
|
51
|
+
}(Component);
|
|
52
|
+
_defineProperty(CheckboxButtonRoot, "style", style);
|
|
53
|
+
var CheckboxButton = createComponent(CheckboxButtonRoot);
|
|
47
54
|
export {
|
|
48
|
-
|
|
55
|
+
CheckboxButton as default
|
|
49
56
|
};
|
|
@@ -1,45 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { Field
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { assignProps
|
|
10
|
-
import
|
|
11
|
-
var
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { Field } from "react-final-form";
|
|
6
|
+
import Tooltip from "@semcore/tooltip";
|
|
7
|
+
import pick from "@semcore/core/lib/utils/pick";
|
|
8
|
+
import uniqueIDEnhancement from "@semcore/core/lib/utils/uniqueID";
|
|
9
|
+
import { assignProps } from "@semcore/core";
|
|
10
|
+
import propsForElement from "@semcore/core/lib/utils/propsForElement";
|
|
11
|
+
var _excluded = ["Children", "tag", "uid", "tooltipProps"], _excluded2 = ["input", "meta"];
|
|
12
|
+
var deafultTooltipPropsList = ["title", "theme", "strategy", "modifiers", "placement", "interaction", "timeout", "visible", "defaultVisible", "onVisibleChange", "offset", "preventOverflow", "arrow", "flip", "computeStyles", "eventListeners", "onFirstUpdate"];
|
|
13
|
+
function FeedbackItem(_ref) {
|
|
14
|
+
var Children = _ref.Children, tag = _ref.tag, uid = _ref.uid, _ref$tooltipProps = _ref.tooltipProps, tooltipPropsList = _ref$tooltipProps === void 0 ? deafultTooltipPropsList : _ref$tooltipProps, props = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
var tooltipProps = pick(props, tooltipPropsList);
|
|
16
|
+
var lastErrorRef = React.useRef(void 0);
|
|
17
|
+
return /* @__PURE__ */ React.createElement(Field, props, function(_ref2) {
|
|
18
|
+
var _meta$error;
|
|
19
|
+
var input = _ref2.input, meta = _ref2.meta, other = _objectWithoutProperties(_ref2, _excluded2);
|
|
20
|
+
var showError = other.validateOnBlur === false ? meta.submitFailed : true;
|
|
21
|
+
var invalid = meta.invalid && meta.touched;
|
|
22
|
+
var errorState = showError && invalid;
|
|
23
|
+
var popperId = "".concat(uid, "-error-description");
|
|
24
|
+
var ariaDescribedBy = props["aria-describedby"];
|
|
25
|
+
var inputProps = assignProps(_objectSpread(_objectSpread({}, propsForElement(other)), {}, {
|
|
26
|
+
state: errorState ? "invalid" : "normal",
|
|
27
|
+
"aria-invalid": errorState ? true : false,
|
|
28
|
+
"aria-describedby": meta.active ? errorState ? popperId : ariaDescribedBy : void 0
|
|
29
|
+
}), input);
|
|
30
|
+
if (meta !== null && meta !== void 0 && meta.error) lastErrorRef.current = meta.error;
|
|
31
|
+
return /* @__PURE__ */ React.createElement(Tooltip, _extends({
|
|
32
|
+
visible: errorState && meta.active,
|
|
22
33
|
theme: "warning",
|
|
23
34
|
placement: "left",
|
|
24
35
|
flip: {
|
|
25
36
|
fallbackPlacements: ["right", "bottom"]
|
|
26
37
|
}
|
|
27
|
-
},
|
|
28
|
-
inline:
|
|
38
|
+
}, tooltipProps), /* @__PURE__ */ React.createElement(Tooltip.Trigger, _extends({
|
|
39
|
+
inline: false,
|
|
29
40
|
role: void 0,
|
|
30
|
-
tag
|
|
31
|
-
},
|
|
41
|
+
tag
|
|
42
|
+
}, tag ? inputProps : {}, {
|
|
32
43
|
__excludeProps: ["type", "aria-describedby"]
|
|
33
|
-
}), typeof
|
|
34
|
-
input:
|
|
35
|
-
meta
|
|
36
|
-
},
|
|
44
|
+
}), typeof Children.origin === "function" && Children.origin(_objectSpread({
|
|
45
|
+
input: inputProps,
|
|
46
|
+
meta
|
|
47
|
+
}, other))), /* @__PURE__ */ React.createElement(Tooltip.Popper, {
|
|
37
48
|
w: "100%",
|
|
38
|
-
id:
|
|
39
|
-
}, (
|
|
49
|
+
id: popperId
|
|
50
|
+
}, (_meta$error = meta.error) !== null && _meta$error !== void 0 ? _meta$error : lastErrorRef.current));
|
|
40
51
|
});
|
|
41
52
|
}
|
|
42
|
-
|
|
53
|
+
FeedbackItem.enhance = [uniqueIDEnhancement()];
|
|
43
54
|
export {
|
|
44
|
-
|
|
55
|
+
FeedbackItem
|
|
45
56
|
};
|