@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,23 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.SubmitButton = SubmitButton;
|
|
8
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
|
|
9
8
|
var _core = require("@semcore/core");
|
|
10
9
|
var _button = _interopRequireDefault(require("@semcore/button"));
|
|
11
10
|
var _react = _interopRequireDefault(require("react"));
|
|
12
11
|
function SubmitButton(props) {
|
|
13
12
|
var _ref = arguments[0],
|
|
14
13
|
_ref2;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
const {
|
|
15
|
+
styles
|
|
16
|
+
} = props;
|
|
17
|
+
const SSubmit = _button.default;
|
|
18
|
+
return _ref2 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SSubmit, _ref2.cn("SSubmit", {
|
|
19
|
+
...(0, _core.assignProps)({
|
|
20
|
+
"type": 'submit',
|
|
21
|
+
"use": 'primary',
|
|
22
|
+
"theme": 'success'
|
|
23
|
+
}, _ref)
|
|
24
|
+
}));
|
|
22
25
|
}
|
|
23
26
|
//# sourceMappingURL=SubmitButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubmitButton.js","names":["_core","require","_button","_interopRequireDefault","_react","SubmitButton","props","_ref","arguments[0]","_ref2","styles","SSubmit","Button","sstyled","
|
|
1
|
+
{"version":3,"file":"SubmitButton.js","names":["_core","require","_button","_interopRequireDefault","_react","SubmitButton","props","_ref","arguments[0]","_ref2","styles","SSubmit","Button","sstyled","default","createElement","cn","assignProps"],"sources":["../../../../src/component/submit-button/SubmitButton.tsx"],"sourcesContent":["import Button from '@semcore/button';\nimport { Root, sstyled, type IRootComponentProps } from '@semcore/core';\nimport React from 'react';\n\nexport function SubmitButton(props: IRootComponentProps) {\n const { styles } = props;\n const SSubmit = Root;\n return sstyled(styles)(<SSubmit render={Button} type='submit' use='primary' theme='success' />);\n}\n"],"mappings":";;;;;;;AACA,IAAAA,KAAA,GAAAC,OAAA;AADA,IAAAC,OAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAAG,MAAA,GAAAD,sBAAA,CAAAF,OAAA;AAEO,SAASI,YAAYA,CAACC,KAA0B,EAAE;EAAA,IAAAC,IAAA,GAAAC,YAAA;IAAAC,KAAA;EACvD,MAAM;IAAEC;EAAO,CAAC,GAAGJ,KAAK;EACxB,MAAMK,OAAO,GAC2BC,eAAM;EAA9C,OAAAH,KAAA,GAAO,IAAAI,aAAO,EAACH,MAAM,CAAC,eAACN,MAAA,CAAAU,OAAA,CAAAC,aAAA,CAACJ,OAAO,EAAAF,KAAA,CAAAO,EAAA;IAAA,OAAAhB,KAAA,CAAAiB,WAAA;MAAA,QAAsB,QAAQ;MAAA,OAAK,SAAS;MAAA,SAAO;IAAS,GAAAV,IAAA;EAAA,EAAE,CAAC;AAChG","ignoreList":[]}
|
package/lib/cjs/index.d.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
Object.defineProperty(exports, "FeedbackRating", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function
|
|
10
|
-
return _FeedbackRating
|
|
9
|
+
get: function () {
|
|
10
|
+
return _FeedbackRating.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
var _FeedbackRating = _interopRequireDefault(require("./component/feedback-rating/FeedbackRating"));
|
package/lib/cjs/index.d.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":["_FeedbackRating","_interopRequireDefault","require"],"sources":["../../src/index.d.ts"],"sourcesContent":["import type
|
|
1
|
+
{"version":3,"file":"index.d.js","names":["_FeedbackRating","_interopRequireDefault","require"],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { Box } from '@semcore/base-components';\nimport type Button from '@semcore/button';\nimport type { Intergalactic } from '@semcore/core';\nimport type { NoticeSmart } from '@semcore/notice';\nimport type { FormProps, FieldProps, FieldInputProps, FieldMetaState } from 'react-final-form';\n\nimport { default as FeedbackRating } from './component/feedback-rating/FeedbackRating';\n\nexport type FeedbackFormProps = FormProps & {\n /** The event is called when the form is submitted */\n onSubmit: (values: any, form: any, callback?: (errors?: {}) => void) => {} | Promise<{}> | void;\n /**\n * The property is in charge of the spinner showing\n * */\n loading?: boolean;\n /**\n * Color of container spinner; you can use your own color\n */\n background?: string;\n /** Spinner theme. There are several default themes or you can use your own color\n * @default dark\n **/\n theme?: 'dark' | 'invert' | string;\n};\n\ndeclare const FeedbackForm: Intergalactic.Component<'form', FeedbackFormProps> & {\n Item: Intergalactic.Component<\n 'div',\n FieldProps<any, any>,\n { input: FieldInputProps<any> & { state: 'normal' | 'invalid' }; meta: FieldMetaState<any> }\n >;\n Success: typeof Box;\n Submit: typeof Button;\n Cancel: typeof Button;\n Notice: typeof NoticeSmart;\n};\n\nexport default FeedbackForm;\n\nexport { FeedbackRating };\n"],"mappings":";;;;;;;;;;;;AAMA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA","ignoreList":[]}
|
package/lib/cjs/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
Object.defineProperty(exports, "FeedbackRating", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function
|
|
10
|
-
return _FeedbackRating
|
|
9
|
+
get: function () {
|
|
10
|
+
return _FeedbackRating.default;
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "default", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function
|
|
16
|
-
return _FeedbackForm
|
|
15
|
+
get: function () {
|
|
16
|
+
return _FeedbackForm.default;
|
|
17
17
|
}
|
|
18
18
|
});
|
|
19
19
|
var _FeedbackRating = _interopRequireDefault(require("./component/feedback-rating/FeedbackRating"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
@@ -19,20 +19,20 @@ var _sv = _interopRequireDefault(require("./sv.json"));
|
|
|
19
19
|
var _tr = _interopRequireDefault(require("./tr.json"));
|
|
20
20
|
var _vi = _interopRequireDefault(require("./vi.json"));
|
|
21
21
|
var _zh = _interopRequireDefault(require("./zh.json"));
|
|
22
|
-
|
|
23
|
-
de: _de
|
|
24
|
-
en: _en
|
|
25
|
-
es: _es
|
|
26
|
-
fr: _fr
|
|
27
|
-
it: _it
|
|
28
|
-
ja: _ja
|
|
29
|
-
ko: _ko
|
|
30
|
-
nl: _nl
|
|
31
|
-
pt: _pt
|
|
32
|
-
tr: _tr
|
|
33
|
-
vi: _vi
|
|
34
|
-
zh: _zh
|
|
35
|
-
pl: _pl
|
|
36
|
-
sv: _sv
|
|
22
|
+
const localizedMessages = exports.localizedMessages = {
|
|
23
|
+
de: _de.default,
|
|
24
|
+
en: _en.default,
|
|
25
|
+
es: _es.default,
|
|
26
|
+
fr: _fr.default,
|
|
27
|
+
it: _it.default,
|
|
28
|
+
ja: _ja.default,
|
|
29
|
+
ko: _ko.default,
|
|
30
|
+
nl: _nl.default,
|
|
31
|
+
pt: _pt.default,
|
|
32
|
+
tr: _tr.default,
|
|
33
|
+
vi: _vi.default,
|
|
34
|
+
zh: _zh.default,
|
|
35
|
+
pl: _pl.default,
|
|
36
|
+
sv: _sv.default
|
|
37
37
|
};
|
|
38
38
|
//# sourceMappingURL=__intergalactic-dynamic-locales.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["_de","_interopRequireDefault","require","_en","_es","_fr","_it","_ja","_ko","_nl","_pl","_pt","_sv","_tr","_vi","_zh","localizedMessages","exports","de","en","es","fr","it","ja","ko","nl","pt","tr","vi","zh","pl","sv"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,GAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,GAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,GAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,GAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,GAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,GAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,GAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,GAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,GAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,GAAA,GAAAd,sBAAA,CAAAC,OAAA;AAEO,
|
|
1
|
+
{"version":3,"file":"__intergalactic-dynamic-locales.js","names":["_de","_interopRequireDefault","require","_en","_es","_fr","_it","_ja","_ko","_nl","_pl","_pt","_sv","_tr","_vi","_zh","localizedMessages","exports","de","en","es","fr","it","ja","ko","nl","pt","tr","vi","zh","pl","sv"],"sources":["../../../src/translations/__intergalactic-dynamic-locales.ts"],"sourcesContent":["import de from './de.json';\nimport en from './en.json';\nimport es from './es.json';\nimport fr from './fr.json';\nimport it from './it.json';\nimport ja from './ja.json';\nimport ko from './ko.json';\nimport nl from './nl.json';\nimport pl from './pl.json';\nimport pt from './pt.json';\nimport sv from './sv.json';\nimport tr from './tr.json';\nimport vi from './vi.json';\nimport zh from './zh.json';\n\nexport const localizedMessages = {\n de,\n en,\n es,\n fr,\n it,\n ja,\n ko,\n nl,\n pt,\n tr,\n vi,\n zh,\n pl,\n sv,\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,GAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,GAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,GAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,GAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,GAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,GAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,GAAA,GAAAP,sBAAA,CAAAC,OAAA;AACA,IAAAO,GAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,GAAA,GAAAT,sBAAA,CAAAC,OAAA;AACA,IAAAS,GAAA,GAAAV,sBAAA,CAAAC,OAAA;AACA,IAAAU,GAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,GAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,GAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,GAAA,GAAAd,sBAAA,CAAAC,OAAA;AAEO,MAAMc,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG;EAC/BE,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA,WAAE;EACFC,EAAE,EAAFA;AACF,CAAC","ignoreList":[]}
|
package/lib/es6/FeedbackForm.js
CHANGED
|
@@ -1,19 +1,12 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
|
-
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
7
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
2
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
3
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
10
4
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
11
5
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
12
6
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
13
|
-
|
|
7
|
+
import { Box } from '@semcore/base-components';
|
|
14
8
|
import Button from '@semcore/button';
|
|
15
9
|
import { createComponent, Component, sstyled, Root } from '@semcore/core';
|
|
16
|
-
import { Box } from '@semcore/flex-box';
|
|
17
10
|
import { NoticeSmart } from '@semcore/notice';
|
|
18
11
|
import SpinContainer from '@semcore/spin-container';
|
|
19
12
|
import createFocusDecorator from 'final-form-focus';
|
|
@@ -22,108 +15,97 @@ import { Field, Form } from 'react-final-form';
|
|
|
22
15
|
import { FeedbackItem } from './component/feedback-item/FeedbackItem';
|
|
23
16
|
import { SubmitButton } from './component/submit-button/SubmitButton';
|
|
24
17
|
/*!__reshadow-styles__:"./style/feedback-form.shadow.css"*/
|
|
25
|
-
|
|
18
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SFeedbackForm_kw89n_gg_{max-width:320px}.___SCancel_kw89n_gg_,.___SSubmit_kw89n_gg_{display:inline-flex;margin-right:var(--intergalactic-spacing-2x, 8px)}.___SNotice_kw89n_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_kw89n_gg_{display:flex;align-items:center;flex-direction:column;width:320px;padding:var(--intergalactic-spacing-10x, 40px);box-sizing:border-box;outline:0}.___SEmail_kw89n_gg_{margin-bottom:calc(var(--intergalactic-spacing-4x, 16px));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\")}", /*__inner_css_end__*/"kw89n_gg_"),
|
|
26
19
|
/*__reshadow_css_end__*/
|
|
27
20
|
{
|
|
28
|
-
"__SFeedbackForm": "
|
|
29
|
-
"__SSubmit": "
|
|
30
|
-
"__SCancel": "
|
|
31
|
-
"__SNotice": "
|
|
32
|
-
"__SSuccess": "
|
|
33
|
-
"__SEmail": "
|
|
21
|
+
"__SFeedbackForm": "___SFeedbackForm_kw89n_gg_",
|
|
22
|
+
"__SSubmit": "___SSubmit_kw89n_gg_",
|
|
23
|
+
"__SCancel": "___SCancel_kw89n_gg_",
|
|
24
|
+
"__SNotice": "___SNotice_kw89n_gg_",
|
|
25
|
+
"__SSuccess": "___SSuccess_kw89n_gg_",
|
|
26
|
+
"__SEmail": "___SEmail_kw89n_gg_"
|
|
34
27
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
40
|
-
args[_key] = arguments[_key];
|
|
41
|
-
}
|
|
42
|
-
_this = _callSuper(this, FeedbackForm, [].concat(args));
|
|
43
|
-
_defineProperty(_this, "focusDecorator", createFocusDecorator());
|
|
44
|
-
return _this;
|
|
28
|
+
class FeedbackForm extends Component {
|
|
29
|
+
constructor(...args) {
|
|
30
|
+
super(...args);
|
|
31
|
+
_defineProperty(this, "focusDecorator", createFocusDecorator());
|
|
45
32
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
86
|
-
}]);
|
|
87
|
-
}(Component);
|
|
33
|
+
getItemProps() {
|
|
34
|
+
const {
|
|
35
|
+
validateOnBlur
|
|
36
|
+
} = this.asProps;
|
|
37
|
+
return {
|
|
38
|
+
validateOnBlur
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
render() {
|
|
42
|
+
const SFeedbackForm = Box;
|
|
43
|
+
const {
|
|
44
|
+
Children,
|
|
45
|
+
styles,
|
|
46
|
+
forwardRef,
|
|
47
|
+
loading,
|
|
48
|
+
background,
|
|
49
|
+
theme,
|
|
50
|
+
...other
|
|
51
|
+
} = this.asProps;
|
|
52
|
+
return /*#__PURE__*/React.createElement(Form, _extends({
|
|
53
|
+
decorators: [this.focusDecorator]
|
|
54
|
+
}, other), api => {
|
|
55
|
+
var _ref4;
|
|
56
|
+
return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(SpinContainer, _ref4.cn("SpinContainer", {
|
|
57
|
+
"background": background,
|
|
58
|
+
"theme": theme,
|
|
59
|
+
"size": 'xl',
|
|
60
|
+
"loading": loading === undefined ? api.submitting : loading
|
|
61
|
+
}), /*#__PURE__*/React.createElement(SFeedbackForm, _ref4.cn("SFeedbackForm", {
|
|
62
|
+
"tag": 'form',
|
|
63
|
+
"noValidate": true,
|
|
64
|
+
"method": 'POST',
|
|
65
|
+
"ref": forwardRef,
|
|
66
|
+
...other,
|
|
67
|
+
"onSubmit": api.handleSubmit
|
|
68
|
+
}), typeof Children.origin === 'function' ? Children.origin(api) : /*#__PURE__*/React.createElement(Children, _ref4.cn("Children", {}))));
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
}
|
|
88
72
|
_defineProperty(FeedbackForm, "displayName", 'FeedbackForm');
|
|
89
73
|
_defineProperty(FeedbackForm, "style", style);
|
|
90
74
|
_defineProperty(FeedbackForm, "FinalForm", {
|
|
91
|
-
Field
|
|
92
|
-
Form
|
|
75
|
+
Field,
|
|
76
|
+
Form
|
|
93
77
|
});
|
|
94
78
|
_defineProperty(FeedbackForm, "defaultProps", {
|
|
95
|
-
onSubmit:
|
|
79
|
+
onSubmit: () => {}
|
|
96
80
|
});
|
|
97
81
|
_defineProperty(FeedbackForm, "validate", {
|
|
98
|
-
description:
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return error;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
82
|
+
description: error => (value = '') => {
|
|
83
|
+
const words = value.split(/\s+/);
|
|
84
|
+
const symbols = words.join(' ');
|
|
85
|
+
if (symbols.length < 10 || words.length < 3) {
|
|
86
|
+
return error;
|
|
87
|
+
}
|
|
107
88
|
},
|
|
108
|
-
email:
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
return error;
|
|
113
|
-
}
|
|
114
|
-
};
|
|
89
|
+
email: error => (value = '') => {
|
|
90
|
+
if (!/.+@.+\..+/i.test(String(value).toLowerCase())) {
|
|
91
|
+
return error;
|
|
92
|
+
}
|
|
115
93
|
}
|
|
116
94
|
});
|
|
117
95
|
function Success(props) {
|
|
118
96
|
var _ref = arguments[0],
|
|
119
97
|
_ref5;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
98
|
+
const {
|
|
99
|
+
Children,
|
|
100
|
+
styles
|
|
101
|
+
} = props;
|
|
102
|
+
const SSuccess = Box;
|
|
103
|
+
const SEmail = 'div';
|
|
104
|
+
return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SSuccess, _ref5.cn("SSuccess", {
|
|
105
|
+
..._assignProps({
|
|
106
|
+
"tabIndex": -1
|
|
107
|
+
}, _ref)
|
|
108
|
+
}), /*#__PURE__*/React.createElement(SEmail, _ref5.cn("SEmail", {
|
|
127
109
|
"aria-hidden": true
|
|
128
110
|
})), /*#__PURE__*/React.createElement("span", _ref5.cn("span", {}), /*#__PURE__*/React.createElement(Children, _ref5.cn("Children", {}))));
|
|
129
111
|
}
|
|
@@ -132,33 +114,39 @@ Success.style = style;
|
|
|
132
114
|
function Cancel(props) {
|
|
133
115
|
var _ref2 = arguments[0],
|
|
134
116
|
_ref6;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
117
|
+
const {
|
|
118
|
+
styles
|
|
119
|
+
} = props;
|
|
120
|
+
const SCancel = Button;
|
|
121
|
+
return _ref6 = sstyled(styles), /*#__PURE__*/React.createElement(SCancel, _ref6.cn("SCancel", {
|
|
122
|
+
..._assignProps2({
|
|
123
|
+
"type": 'reset',
|
|
124
|
+
"use": 'secondary',
|
|
125
|
+
"theme": 'muted'
|
|
126
|
+
}, _ref2)
|
|
127
|
+
}));
|
|
142
128
|
}
|
|
143
129
|
function Notice(props) {
|
|
144
130
|
var _ref3 = arguments[0],
|
|
145
131
|
_ref7;
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
theme =
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SNotice, _ref7.cn("SNotice",
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
132
|
+
const {
|
|
133
|
+
styles,
|
|
134
|
+
theme = 'muted',
|
|
135
|
+
use = 'secondary'
|
|
136
|
+
} = props;
|
|
137
|
+
const SNotice = NoticeSmart;
|
|
138
|
+
return _ref7 = sstyled(styles), /*#__PURE__*/React.createElement(SNotice, _ref7.cn("SNotice", {
|
|
139
|
+
..._assignProps3({
|
|
140
|
+
"use:theme": theme,
|
|
141
|
+
"use:use": use
|
|
142
|
+
}, _ref3)
|
|
143
|
+
}));
|
|
156
144
|
}
|
|
157
145
|
export default createComponent(FeedbackForm, {
|
|
158
146
|
Item: FeedbackItem,
|
|
159
|
-
Success
|
|
147
|
+
Success,
|
|
160
148
|
Submit: SubmitButton,
|
|
161
|
-
Cancel
|
|
162
|
-
Notice
|
|
149
|
+
Cancel,
|
|
150
|
+
Notice
|
|
163
151
|
});
|
|
164
152
|
//# sourceMappingURL=FeedbackForm.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FeedbackForm.js","names":["Button","createComponent","Component","sstyled","Root","
|
|
1
|
+
{"version":3,"file":"FeedbackForm.js","names":["Box","Button","createComponent","Component","sstyled","Root","NoticeSmart","SpinContainer","createFocusDecorator","React","Field","Form","FeedbackItem","SubmitButton","style","_sstyled","insert","FeedbackForm","constructor","args","_defineProperty","getItemProps","validateOnBlur","asProps","render","SFeedbackForm","Children","styles","forwardRef","loading","background","theme","other","createElement","_extends","decorators","focusDecorator","api","_ref4","cn","undefined","submitting","handleSubmit","origin","onSubmit","description","error","value","words","split","symbols","join","length","email","test","String","toLowerCase","Success","props","_ref","arguments[0]","_ref5","SSuccess","SEmail","_assignProps","Cancel","_ref2","_ref6","SCancel","_assignProps2","Notice","_ref3","_ref7","use","SNotice","_assignProps3","Item","Submit"],"sources":["../../src/FeedbackForm.jsx"],"sourcesContent":["import { Box } from '@semcore/base-components';\nimport Button from '@semcore/button';\nimport { createComponent, Component, sstyled, Root } from '@semcore/core';\nimport { NoticeSmart } from '@semcore/notice';\nimport SpinContainer from '@semcore/spin-container';\nimport createFocusDecorator from 'final-form-focus';\nimport React from 'react';\nimport { Field, Form } from 'react-final-form';\n\nimport { FeedbackItem } from './component/feedback-item/FeedbackItem';\nimport { SubmitButton } from './component/submit-button/SubmitButton';\nimport style from './style/feedback-form.shadow.css';\n\nclass FeedbackForm extends Component {\n static displayName = 'FeedbackForm';\n static style = style;\n static FinalForm = {\n Field,\n Form,\n };\n\n static defaultProps = {\n onSubmit: () => {},\n };\n\n static validate = {\n description: (error) => (value = '') => {\n const words = value.split(/\\s+/);\n const symbols = words.join(' ');\n if (symbols.length < 10 || words.length < 3) {\n return error;\n }\n },\n email: (error) => (value = '') => {\n if (!/.+@.+\\..+/i.test(String(value).toLowerCase())) {\n return error;\n }\n },\n };\n\n focusDecorator = createFocusDecorator();\n\n getItemProps() {\n const { validateOnBlur } = this.asProps;\n\n return {\n validateOnBlur,\n };\n }\n\n render() {\n const SFeedbackForm = Box;\n const { Children, styles, forwardRef, loading, background, theme, ...other } = this.asProps;\n\n return (\n <Form decorators={[this.focusDecorator]} {...other}>\n {(api) =>\n sstyled(styles)(\n <SpinContainer\n background={background}\n theme={theme}\n size='xl'\n loading={loading === undefined ? api.submitting : loading}\n >\n <SFeedbackForm\n tag='form'\n noValidate\n method='POST'\n ref={forwardRef}\n {...other}\n onSubmit={api.handleSubmit}\n >\n {typeof Children.origin === 'function' ? Children.origin(api) : <Children />}\n </SFeedbackForm>\n </SpinContainer>,\n )}\n </Form>\n );\n }\n}\n\nfunction Success(props) {\n const { Children, styles } = props;\n const SSuccess = Root;\n const SEmail = 'div';\n\n return sstyled(styles)(\n <SSuccess render={Box} tabIndex={-1}>\n <SEmail aria-hidden={true} />\n <span>\n <Children />\n </span>\n </SSuccess>,\n );\n}\n// because it is used without a wrapper\nSuccess.style = style;\n\nfunction Cancel(props) {\n const { styles } = props;\n const SCancel = Root;\n return sstyled(styles)(<SCancel render={Button} type='reset' use='secondary' theme='muted' />);\n}\n\nfunction Notice(props) {\n const { styles, theme = 'muted', use = 'secondary' } = props;\n const SNotice = Root;\n return sstyled(styles)(<SNotice render={NoticeSmart} use:theme={theme} use:use={use} />);\n}\n\nexport default createComponent(FeedbackForm, {\n Item: FeedbackItem,\n Success,\n Submit: SubmitButton,\n Cancel,\n Notice,\n});\n"],"mappings":";;;;;;AAAA,SAASA,GAAG,QAAQ,0BAA0B;AAC9C,OAAOC,MAAM,MAAM,iBAAiB;AACpC,SAASC,eAAe,EAAEC,SAAS,EAAEC,OAAO,EAAEC,IAAI,QAAQ,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AC5D,MAAMgB,OAAO,GAC2BpE,WAAW;EAAnD,OAAAkE,KAAA,GAAOpE,OAAO,CAACuB,MAAM,CAAC,eAAClB,KAAA,CAAAwB,aAAA,CAACyC,OAAO,EAAAF,KAAA,CAAAjC,EAAA;IAAA,GAAAoC,aAAA;MAAA,aAAiC5C,KAAK;MAAA,WAAW0C;IAAG,GAAAF,KAAA;EAAA,EAAG,CAAC;AACzF;AAEA,eAAerE,eAAe,CAACe,YAAY,EAAE;EAC3C2D,IAAI,EAAEhE,YAAY;EAClB6C,OAAO;EACPoB,MAAM,EAAEhE,YAAY;EACpBoD,MAAM;EACNK;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,56 +1,59 @@
|
|
|
1
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
4
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
5
|
-
import _callSuper from "@babel/runtime/helpers/callSuper";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
2
|
import { sstyled as _sstyled } from "@semcore/core";
|
|
9
3
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
10
|
-
|
|
4
|
+
import { Box } from '@semcore/base-components';
|
|
11
5
|
import Checkbox from '@semcore/checkbox';
|
|
12
6
|
import { createComponent, Component, Root, sstyled } from '@semcore/core';
|
|
13
|
-
import { Box } from '@semcore/flex-box';
|
|
14
7
|
import React from 'react';
|
|
15
8
|
/*!__reshadow-styles__:"../../style/checkbox-button.shadow.css"*/
|
|
16
|
-
|
|
9
|
+
const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SCheckboxButton_ljd37_gg_{margin-top:var(--intergalactic-spacing-2x, 8px);border:1px solid var(--intergalactic-border-primary, #c4c7cf);border-radius:var(--intergalactic-rounded-medium, 6px)}.___SCheckboxButton_ljd37_gg_ label{width:100%;padding:var(--intergalactic-spacing-3x, 12px);box-sizing:border-box}.___SCheckboxButton_ljd37_gg_.__checked_ljd37_gg_{cursor:pointer;border-color:var(--intergalactic-border-info-active, #006dca);background-color:rgba(0,143,248,.1)}@media (hover:hover){.___SCheckboxButton_ljd37_gg_:hover{cursor:pointer;border-color:var(--intergalactic-border-info-active, #006dca);background-color:rgba(0,143,248,.1)}.___SCheckboxButton_ljd37_gg_.__checked_ljd37_gg_:hover{background-color:rgba(0,143,248,.2)}}", /*__inner_css_end__*/"ljd37_gg_"),
|
|
17
10
|
/*__reshadow_css_end__*/
|
|
18
11
|
{
|
|
19
|
-
"__SCheckboxButton": "
|
|
20
|
-
"_checked": "
|
|
12
|
+
"__SCheckboxButton": "___SCheckboxButton_ljd37_gg_",
|
|
13
|
+
"_checked": "__checked_ljd37_gg_"
|
|
21
14
|
});
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
class CheckboxButtonRoot extends Component {
|
|
16
|
+
constructor(...args) {
|
|
17
|
+
super(...args);
|
|
18
|
+
_defineProperty(this, "checkboxRef", /*#__PURE__*/React.createRef());
|
|
26
19
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
id = _this$asProps.id,
|
|
36
|
-
label = _this$asProps.label,
|
|
37
|
-
_type = _this$asProps.type,
|
|
38
|
-
focused = _this$asProps.focused,
|
|
39
|
-
other = _objectWithoutProperties(_this$asProps, _excluded);
|
|
40
|
-
var autoFocus = focused ? 20 : false;
|
|
41
|
-
var SCheckboxButton = Box;
|
|
42
|
-
return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SCheckboxButton, _ref2.cn("SCheckboxButton", _objectSpread({}, _assignProps({
|
|
43
|
-
"__excludeProps": ['onChange', 'id', 'type']
|
|
44
|
-
}, _ref))), /*#__PURE__*/React.createElement(Checkbox, _ref2.cn("Checkbox", _objectSpread({}, other)), /*#__PURE__*/React.createElement(Checkbox.Value, {
|
|
45
|
-
autoFocus: autoFocus,
|
|
46
|
-
"aria-labelledby": id
|
|
47
|
-
}), /*#__PURE__*/React.createElement(Checkbox.Text, {
|
|
48
|
-
id: id
|
|
49
|
-
}, label)));
|
|
20
|
+
componentDidMount() {
|
|
21
|
+
const {
|
|
22
|
+
focused
|
|
23
|
+
} = this.asProps;
|
|
24
|
+
if (focused) {
|
|
25
|
+
setTimeout(() => {
|
|
26
|
+
this.checkboxRef.current?.focus();
|
|
27
|
+
}, 20);
|
|
50
28
|
}
|
|
51
|
-
}
|
|
52
|
-
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
var _ref = this.asProps,
|
|
32
|
+
_ref2;
|
|
33
|
+
const {
|
|
34
|
+
styles,
|
|
35
|
+
id,
|
|
36
|
+
label,
|
|
37
|
+
type: _type,
|
|
38
|
+
focused,
|
|
39
|
+
...other
|
|
40
|
+
} = this.asProps;
|
|
41
|
+
const SCheckboxButton = Box;
|
|
42
|
+
return _ref2 = sstyled(styles), /*#__PURE__*/React.createElement(SCheckboxButton, _ref2.cn("SCheckboxButton", {
|
|
43
|
+
..._assignProps({
|
|
44
|
+
"__excludeProps": ['onChange', 'id', 'type']
|
|
45
|
+
}, _ref)
|
|
46
|
+
}), /*#__PURE__*/React.createElement(Checkbox, _ref2.cn("Checkbox", {
|
|
47
|
+
...other
|
|
48
|
+
}), /*#__PURE__*/React.createElement(Checkbox.Value, {
|
|
49
|
+
ref: this.checkboxRef,
|
|
50
|
+
"aria-labelledby": id
|
|
51
|
+
}), /*#__PURE__*/React.createElement(Checkbox.Text, {
|
|
52
|
+
id: id
|
|
53
|
+
}, label)));
|
|
54
|
+
}
|
|
55
|
+
}
|
|
53
56
|
_defineProperty(CheckboxButtonRoot, "style", style);
|
|
54
|
-
|
|
57
|
+
const CheckboxButton = createComponent(CheckboxButtonRoot);
|
|
55
58
|
export default CheckboxButton;
|
|
56
59
|
//# sourceMappingURL=CheckboxButton.js.map
|