@doist/reactist 11.6.0 → 12.0.1
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/dist/reactist.cjs.development.js +1335 -1493
- package/dist/reactist.cjs.development.js.map +1 -1
- package/dist/reactist.cjs.production.min.js +1 -1
- package/dist/reactist.cjs.production.min.js.map +1 -1
- package/es/_virtual/_rollupPluginBabelHelpers.js +18 -21
- package/es/_virtual/_rollupPluginBabelHelpers.js.map +1 -1
- package/es/components/checkbox/checkbox.js +7 -9
- package/es/components/checkbox/checkbox.js.map +1 -1
- package/es/components/color-picker/color-picker.js +24 -28
- package/es/components/color-picker/color-picker.js.map +1 -1
- package/es/components/deprecated-button/deprecated-button.js +16 -18
- package/es/components/deprecated-button/deprecated-button.js.map +1 -1
- package/es/components/deprecated-loading/deprecated-loading.js +7 -10
- package/es/components/deprecated-loading/deprecated-loading.js.map +1 -1
- package/es/components/deprecated-modal/deprecated-modal.js +69 -101
- package/es/components/deprecated-modal/deprecated-modal.js.map +1 -1
- package/es/components/deprecated-modal/index.js +4 -4
- package/es/components/deprecated-modal/index.js.map +1 -1
- package/es/components/dropdown/dropdown.js +86 -85
- package/es/components/dropdown/dropdown.js.map +1 -1
- package/es/components/icons/CloseIcon.svg.js +9 -11
- package/es/components/icons/CloseIcon.svg.js.map +1 -1
- package/es/components/input/input.js +4 -3
- package/es/components/input/input.js.map +1 -1
- package/es/components/key-capturer/key-capturer.js +22 -19
- package/es/components/key-capturer/key-capturer.js.map +1 -1
- package/es/components/keyboard-shortcut/keyboard-shortcut.js +20 -26
- package/es/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/es/components/menu/menu.js +112 -142
- package/es/components/menu/menu.js.map +1 -1
- package/es/components/notification/notification.js +32 -32
- package/es/components/notification/notification.js.map +1 -1
- package/es/components/popover/popover.js +85 -91
- package/es/components/popover/popover.js.map +1 -1
- package/es/components/popover/positioning-utils.js +49 -65
- package/es/components/popover/positioning-utils.js.map +1 -1
- package/es/components/progress-bar/progress-bar.js +8 -8
- package/es/components/progress-bar/progress-bar.js.map +1 -1
- package/es/components/select/select.js +20 -25
- package/es/components/select/select.js.map +1 -1
- package/es/components/time/time-utils.js +30 -47
- package/es/components/time/time-utils.js.map +1 -1
- package/es/components/time/time.js +43 -56
- package/es/components/time/time.js.map +1 -1
- package/es/components/tooltip/tooltip.js +43 -46
- package/es/components/tooltip/tooltip.js.map +1 -1
- package/es/hooks/use-previous/use-previous.js +2 -2
- package/es/hooks/use-previous/use-previous.js.map +1 -1
- package/es/new-components/alert/alert.js +7 -6
- package/es/new-components/alert/alert.js.map +1 -1
- package/es/new-components/avatar/avatar.js +19 -18
- package/es/new-components/avatar/avatar.js.map +1 -1
- package/es/new-components/avatar/utils.js +12 -9
- package/es/new-components/avatar/utils.js.map +1 -1
- package/es/new-components/base-button/base-button.js +25 -29
- package/es/new-components/base-button/base-button.js.map +1 -1
- package/es/new-components/base-field/base-field.js +20 -18
- package/es/new-components/base-field/base-field.js.map +1 -1
- package/es/new-components/box/box.js +51 -52
- package/es/new-components/box/box.js.map +1 -1
- package/es/new-components/button/button.js +13 -15
- package/es/new-components/button/button.js.map +1 -1
- package/es/new-components/button-link/button-link.js +13 -15
- package/es/new-components/button-link/button-link.js.map +1 -1
- package/es/new-components/checkbox-field/checkbox-field.js +25 -33
- package/es/new-components/checkbox-field/checkbox-field.js.map +1 -1
- package/es/new-components/checkbox-field/checkbox-icon.js +21 -19
- package/es/new-components/checkbox-field/checkbox-icon.js.map +1 -1
- package/es/new-components/columns/columns.js +24 -27
- package/es/new-components/columns/columns.js.map +1 -1
- package/es/new-components/common-helpers.js +3 -3
- package/es/new-components/common-helpers.js.map +1 -1
- package/es/new-components/divider/divider.js +7 -6
- package/es/new-components/divider/divider.js.map +1 -1
- package/es/new-components/heading/heading.js +17 -17
- package/es/new-components/heading/heading.js.map +1 -1
- package/es/new-components/hidden/hidden.js +14 -13
- package/es/new-components/hidden/hidden.js.map +1 -1
- package/es/new-components/hidden-visually/hidden-visually.js +3 -2
- package/es/new-components/hidden-visually/hidden-visually.js.map +1 -1
- package/es/new-components/icons/alert-icon.js +13 -11
- package/es/new-components/icons/alert-icon.js.map +1 -1
- package/es/new-components/icons/close-icon.js +2 -1
- package/es/new-components/icons/close-icon.js.map +1 -1
- package/es/new-components/icons/password-hidden-icon.js +2 -1
- package/es/new-components/icons/password-hidden-icon.js.map +1 -1
- package/es/new-components/icons/password-visible-icon.js +2 -1
- package/es/new-components/icons/password-visible-icon.js.map +1 -1
- package/es/new-components/inline/inline.js +15 -19
- package/es/new-components/inline/inline.js.map +1 -1
- package/es/new-components/loading/loading.js +11 -10
- package/es/new-components/loading/loading.js.map +1 -1
- package/es/new-components/modal/modal.js +60 -64
- package/es/new-components/modal/modal.js.map +1 -1
- package/es/new-components/notice/notice.js +5 -4
- package/es/new-components/notice/notice.js.map +1 -1
- package/es/new-components/password-field/password-field.js +40 -46
- package/es/new-components/password-field/password-field.js.map +1 -1
- package/es/new-components/responsive-props.js +5 -5
- package/es/new-components/responsive-props.js.map +1 -1
- package/es/new-components/select-field/select-field.js +23 -23
- package/es/new-components/select-field/select-field.js.map +1 -1
- package/es/new-components/spinner/spinner.js +3 -3
- package/es/new-components/spinner/spinner.js.map +1 -1
- package/es/new-components/stack/stack.js +18 -22
- package/es/new-components/stack/stack.js.map +1 -1
- package/es/new-components/switch-field/switch-field.js +31 -41
- package/es/new-components/switch-field/switch-field.js.map +1 -1
- package/es/new-components/tabs/tabs.js +92 -78
- package/es/new-components/tabs/tabs.js.map +1 -1
- package/es/new-components/tabs/tabs.module.css.js +1 -1
- package/es/new-components/text/text.js +16 -17
- package/es/new-components/text/text.js.map +1 -1
- package/es/new-components/text-area/text-area.js +14 -14
- package/es/new-components/text-area/text-area.js.map +1 -1
- package/es/new-components/text-field/text-field.js +21 -22
- package/es/new-components/text-field/text-field.js.map +1 -1
- package/es/new-components/text-link/text-link.js +10 -10
- package/es/new-components/text-link/text-link.js.map +1 -1
- package/es/utils/polymorphism.js.map +1 -1
- package/lib/_virtual/_rollupPluginBabelHelpers.js +1 -1
- package/lib/components/checkbox/checkbox.js +1 -1
- package/lib/components/checkbox/checkbox.js.map +1 -1
- package/lib/components/color-picker/color-picker.js +1 -1
- package/lib/components/color-picker/color-picker.js.map +1 -1
- package/lib/components/deprecated-button/deprecated-button.d.ts +3 -3
- package/lib/components/deprecated-button/deprecated-button.js +1 -1
- package/lib/components/deprecated-button/deprecated-button.js.map +1 -1
- package/lib/components/deprecated-loading/deprecated-loading.js +1 -1
- package/lib/components/deprecated-loading/deprecated-loading.js.map +1 -1
- package/lib/components/deprecated-modal/deprecated-modal.d.ts +2 -2
- package/lib/components/deprecated-modal/deprecated-modal.js +1 -1
- package/lib/components/deprecated-modal/deprecated-modal.js.map +1 -1
- package/lib/components/deprecated-modal/index.js.map +1 -1
- package/lib/components/dropdown/dropdown.d.ts +5 -2
- package/lib/components/dropdown/dropdown.js +1 -1
- package/lib/components/dropdown/dropdown.js.map +1 -1
- package/lib/components/icons/CloseIcon.svg.js +1 -1
- package/lib/components/icons/CloseIcon.svg.js.map +1 -1
- package/lib/components/input/input.js +1 -1
- package/lib/components/input/input.js.map +1 -1
- package/lib/components/key-capturer/key-capturer.d.ts +1 -1
- package/lib/components/key-capturer/key-capturer.js +1 -1
- package/lib/components/key-capturer/key-capturer.js.map +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js +1 -1
- package/lib/components/keyboard-shortcut/keyboard-shortcut.js.map +1 -1
- package/lib/components/menu/menu.d.ts +7 -7
- package/lib/components/menu/menu.js +1 -1
- package/lib/components/menu/menu.js.map +1 -1
- package/lib/components/notification/notification.js +1 -1
- package/lib/components/notification/notification.js.map +1 -1
- package/lib/components/popover/popover.d.ts +1 -1
- package/lib/components/popover/popover.js +1 -1
- package/lib/components/popover/popover.js.map +1 -1
- package/lib/components/popover/positioning-utils.js +1 -1
- package/lib/components/popover/positioning-utils.js.map +1 -1
- package/lib/components/progress-bar/progress-bar.js +1 -1
- package/lib/components/progress-bar/progress-bar.js.map +1 -1
- package/lib/components/select/select.js +1 -1
- package/lib/components/select/select.js.map +1 -1
- package/lib/components/time/time-utils.js +1 -1
- package/lib/components/time/time-utils.js.map +1 -1
- package/lib/components/time/time.js +1 -1
- package/lib/components/time/time.js.map +1 -1
- package/lib/components/tooltip/index.d.ts +1 -2
- package/lib/components/tooltip/tooltip.d.ts +3 -3
- package/lib/components/tooltip/tooltip.js +1 -1
- package/lib/components/tooltip/tooltip.js.map +1 -1
- package/lib/hooks/use-previous/use-previous.js +1 -1
- package/lib/hooks/use-previous/use-previous.js.map +1 -1
- package/lib/index.d.ts +2 -1
- package/lib/new-components/alert/alert.d.ts +1 -1
- package/lib/new-components/alert/alert.js +1 -1
- package/lib/new-components/alert/alert.js.map +1 -1
- package/lib/new-components/avatar/avatar.js +1 -1
- package/lib/new-components/avatar/avatar.js.map +1 -1
- package/lib/new-components/avatar/utils.d.ts +1 -1
- package/lib/new-components/avatar/utils.js +1 -1
- package/lib/new-components/avatar/utils.js.map +1 -1
- package/lib/new-components/base-button/base-button.js +1 -1
- package/lib/new-components/base-button/base-button.js.map +1 -1
- package/lib/new-components/base-field/base-field.d.ts +1 -1
- package/lib/new-components/base-field/base-field.js +1 -1
- package/lib/new-components/base-field/base-field.js.map +1 -1
- package/lib/new-components/box/box.js +1 -1
- package/lib/new-components/box/box.js.map +1 -1
- package/lib/new-components/button/button.d.ts +1 -58
- package/lib/new-components/button/button.js +1 -1
- package/lib/new-components/button/button.js.map +1 -1
- package/lib/new-components/button-link/button-link.js +1 -1
- package/lib/new-components/button-link/button-link.js.map +1 -1
- package/lib/new-components/checkbox-field/checkbox-field.d.ts +1 -1
- package/lib/new-components/checkbox-field/checkbox-field.js +1 -1
- package/lib/new-components/checkbox-field/checkbox-field.js.map +1 -1
- package/lib/new-components/checkbox-field/checkbox-icon.js +1 -1
- package/lib/new-components/checkbox-field/checkbox-icon.js.map +1 -1
- package/lib/new-components/columns/columns.js +1 -1
- package/lib/new-components/columns/columns.js.map +1 -1
- package/lib/new-components/common-helpers.js +1 -1
- package/lib/new-components/common-helpers.js.map +1 -1
- package/lib/new-components/common-types.d.ts +1 -1
- package/lib/new-components/divider/divider.js +1 -1
- package/lib/new-components/divider/divider.js.map +1 -1
- package/lib/new-components/heading/heading.d.ts +2 -2
- package/lib/new-components/heading/heading.js +1 -1
- package/lib/new-components/heading/heading.js.map +1 -1
- package/lib/new-components/hidden/hidden.js +1 -1
- package/lib/new-components/hidden/hidden.js.map +1 -1
- package/lib/new-components/hidden-visually/hidden-visually.js +1 -1
- package/lib/new-components/hidden-visually/hidden-visually.js.map +1 -1
- package/lib/new-components/icons/alert-icon.d.ts +1 -1
- package/lib/new-components/icons/alert-icon.js +1 -1
- package/lib/new-components/icons/alert-icon.js.map +1 -1
- package/lib/new-components/icons/close-icon.js +1 -1
- package/lib/new-components/icons/close-icon.js.map +1 -1
- package/lib/new-components/icons/password-hidden-icon.js +1 -1
- package/lib/new-components/icons/password-hidden-icon.js.map +1 -1
- package/lib/new-components/icons/password-visible-icon.js +1 -1
- package/lib/new-components/icons/password-visible-icon.js.map +1 -1
- package/lib/new-components/inline/inline.js +1 -1
- package/lib/new-components/inline/inline.js.map +1 -1
- package/lib/new-components/loading/loading.js +1 -1
- package/lib/new-components/loading/loading.js.map +1 -1
- package/lib/new-components/modal/modal.js +1 -1
- package/lib/new-components/modal/modal.js.map +1 -1
- package/lib/new-components/notice/notice.d.ts +1 -1
- package/lib/new-components/notice/notice.js +1 -1
- package/lib/new-components/notice/notice.js.map +1 -1
- package/lib/new-components/password-field/password-field.d.ts +1 -1
- package/lib/new-components/password-field/password-field.js +1 -1
- package/lib/new-components/password-field/password-field.js.map +1 -1
- package/lib/new-components/responsive-props.d.ts +1 -1
- package/lib/new-components/responsive-props.js +1 -1
- package/lib/new-components/responsive-props.js.map +1 -1
- package/lib/new-components/select-field/select-field.d.ts +1 -1
- package/lib/new-components/select-field/select-field.js +1 -1
- package/lib/new-components/select-field/select-field.js.map +1 -1
- package/lib/new-components/spinner/spinner.js +1 -1
- package/lib/new-components/spinner/spinner.js.map +1 -1
- package/lib/new-components/stack/stack.js +1 -1
- package/lib/new-components/stack/stack.js.map +1 -1
- package/lib/new-components/switch-field/switch-field.d.ts +1 -1
- package/lib/new-components/switch-field/switch-field.js +1 -1
- package/lib/new-components/switch-field/switch-field.js.map +1 -1
- package/lib/new-components/tabs/tabs.d.ts +13 -3
- package/lib/new-components/tabs/tabs.js +1 -1
- package/lib/new-components/tabs/tabs.js.map +1 -1
- package/lib/new-components/tabs/tabs.module.css.js +1 -1
- package/lib/new-components/test-helpers.d.ts +4 -3
- package/lib/new-components/text/text.js +1 -1
- package/lib/new-components/text/text.js.map +1 -1
- package/lib/new-components/text-area/text-area.js +1 -1
- package/lib/new-components/text-area/text-area.js.map +1 -1
- package/lib/new-components/text-field/text-field.d.ts +1 -1
- package/lib/new-components/text-field/text-field.js +1 -1
- package/lib/new-components/text-field/text-field.js.map +1 -1
- package/lib/new-components/text-link/text-link.js +1 -1
- package/lib/new-components/text-link/text-link.js.map +1 -1
- package/lib/utils/polymorphism.js.map +1 -1
- package/package.json +45 -38
- package/styles/menu.css +1 -1
- package/styles/reactist.css +2 -2
- package/styles/tabs.css +1 -1
- package/styles/tabs.module.css.css +1 -1
|
@@ -51,22 +51,6 @@ function _defineProperty(obj, key, value) {
|
|
|
51
51
|
return obj;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
function _inheritsLoose(subClass, superClass) {
|
|
55
|
-
subClass.prototype = Object.create(superClass.prototype);
|
|
56
|
-
subClass.prototype.constructor = subClass;
|
|
57
|
-
|
|
58
|
-
_setPrototypeOf(subClass, superClass);
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
function _setPrototypeOf(o, p) {
|
|
62
|
-
_setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
|
|
63
|
-
o.__proto__ = p;
|
|
64
|
-
return o;
|
|
65
|
-
};
|
|
66
|
-
|
|
67
|
-
return _setPrototypeOf(o, p);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
54
|
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
71
55
|
if (source == null) return {};
|
|
72
56
|
var target = {};
|
|
@@ -82,13 +66,26 @@ function _objectWithoutPropertiesLoose(source, excluded) {
|
|
|
82
66
|
return target;
|
|
83
67
|
}
|
|
84
68
|
|
|
85
|
-
function
|
|
86
|
-
if (
|
|
87
|
-
|
|
69
|
+
function _objectWithoutProperties(source, excluded) {
|
|
70
|
+
if (source == null) return {};
|
|
71
|
+
|
|
72
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
73
|
+
|
|
74
|
+
var key, i;
|
|
75
|
+
|
|
76
|
+
if (Object.getOwnPropertySymbols) {
|
|
77
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
78
|
+
|
|
79
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
80
|
+
key = sourceSymbolKeys[i];
|
|
81
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
82
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
83
|
+
target[key] = source[key];
|
|
84
|
+
}
|
|
88
85
|
}
|
|
89
86
|
|
|
90
|
-
return
|
|
87
|
+
return target;
|
|
91
88
|
}
|
|
92
89
|
|
|
93
|
-
export {
|
|
90
|
+
export { _defineProperty as defineProperty, _objectSpread2 as objectSpread2, _objectWithoutProperties as objectWithoutProperties, _objectWithoutPropertiesLoose as objectWithoutPropertiesLoose };
|
|
94
91
|
//# sourceMappingURL=_rollupPluginBabelHelpers.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_rollupPluginBabelHelpers.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import React__default from 'react';
|
|
2
2
|
|
|
3
|
-
function Checkbox(
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
3
|
+
function Checkbox({
|
|
4
|
+
label,
|
|
5
|
+
disabled,
|
|
6
|
+
checked = false,
|
|
7
|
+
onChange
|
|
8
|
+
}) {
|
|
9
9
|
return /*#__PURE__*/React__default.createElement("label", {
|
|
10
10
|
className: "reactist_checkbox"
|
|
11
11
|
}, /*#__PURE__*/React__default.createElement("input", {
|
|
@@ -13,9 +13,7 @@ function Checkbox(_ref) {
|
|
|
13
13
|
value: label,
|
|
14
14
|
checked: checked,
|
|
15
15
|
disabled: disabled,
|
|
16
|
-
onChange: disabled || !onChange ? undefined :
|
|
17
|
-
return onChange(event.target.checked);
|
|
18
|
-
},
|
|
16
|
+
onChange: disabled || !onChange ? undefined : event => onChange(event.target.checked),
|
|
19
17
|
type: "checkbox"
|
|
20
18
|
}), label);
|
|
21
19
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import React from 'react'\n\nimport './checkbox.less'\n\ntype Props = {\n checked?: boolean\n disabled?: boolean\n onChange?: (checked: boolean) => void\n label?: string | number\n}\n\nfunction Checkbox({ label, disabled, checked = false, onChange }: Props) {\n return (\n <label className=\"reactist_checkbox\">\n <input\n className=\"reactist_checkbox--input\"\n value={label}\n checked={checked}\n disabled={disabled}\n onChange={\n disabled || !onChange ? undefined : (event) => onChange(event.target.checked)\n }\n type=\"checkbox\"\n />\n {label}\n </label>\n )\n}\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\n"],"names":["Checkbox","label","disabled","checked","onChange","React","className","value","undefined","event","target","type","displayName"],"mappings":";;AAWA,SAASA,QAAT;
|
|
1
|
+
{"version":3,"file":"checkbox.js","sources":["../../../src/components/checkbox/checkbox.tsx"],"sourcesContent":["import React from 'react'\n\nimport './checkbox.less'\n\ntype Props = {\n checked?: boolean\n disabled?: boolean\n onChange?: (checked: boolean) => void\n label?: string | number\n}\n\nfunction Checkbox({ label, disabled, checked = false, onChange }: Props) {\n return (\n <label className=\"reactist_checkbox\">\n <input\n className=\"reactist_checkbox--input\"\n value={label}\n checked={checked}\n disabled={disabled}\n onChange={\n disabled || !onChange ? undefined : (event) => onChange(event.target.checked)\n }\n type=\"checkbox\"\n />\n {label}\n </label>\n )\n}\nCheckbox.displayName = 'Checkbox'\n\nexport { Checkbox }\n"],"names":["Checkbox","label","disabled","checked","onChange","React","className","value","undefined","event","target","type","displayName"],"mappings":";;AAWA,SAASA,QAAT,CAAkB;EAAEC,KAAF;EAASC,QAAT;EAAmBC,OAAO,GAAG,KAA7B;EAAoCC;AAApC,CAAlB;EACI,oBACIC,4BAAA,QAAA;IAAOC,SAAS,EAAC;GAAjB,eACID,4BAAA,QAAA;IACIC,SAAS,EAAC;IACVC,KAAK,EAAEN;IACPE,OAAO,EAAEA;IACTD,QAAQ,EAAEA;IACVE,QAAQ,EACJF,QAAQ,IAAI,CAACE,QAAb,GAAwBI,SAAxB,GAAqCC,KAAD,IAAWL,QAAQ,CAACK,KAAK,CAACC,MAAN,CAAaP,OAAd;IAE3DQ,IAAI,EAAC;GART,CADJ,EAWKV,KAXL,CADJ;AAeH;;AACDD,QAAQ,CAACY,WAAT,GAAuB,UAAvB;;;;"}
|
|
@@ -3,33 +3,30 @@ import classNames from 'classnames';
|
|
|
3
3
|
import { Tooltip } from '../tooltip/tooltip.js';
|
|
4
4
|
import Dropdown from '../dropdown/index.js';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const COLORS = ['#606060', '#4A90E2', '#03B3B2', '#008299', '#82BA00', '#D24726', '#AC193D', '#DC4FAD', '#3BD5FB', '#74E8D3', '#FFCC00', '#FB886E', '#CCCCCC'];
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
return typeof color !== 'string';
|
|
10
|
-
};
|
|
8
|
+
const _isNamedColor = color => typeof color !== 'string';
|
|
11
9
|
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
const _getColor = (colorList, colorIndex) => {
|
|
11
|
+
const index = colorIndex >= colorList.length ? 0 : colorIndex;
|
|
14
12
|
return colorList[index];
|
|
15
13
|
};
|
|
16
14
|
|
|
17
|
-
function ColorPicker(
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
colorList = _ref$colorList === void 0 ? COLORS : _ref$colorList;
|
|
15
|
+
function ColorPicker({
|
|
16
|
+
color = 0,
|
|
17
|
+
small,
|
|
18
|
+
onChange,
|
|
19
|
+
colorList = COLORS
|
|
20
|
+
}) {
|
|
24
21
|
return /*#__PURE__*/React__default.createElement(Dropdown.Box, {
|
|
25
22
|
right: true,
|
|
26
23
|
className: "reactist_color_picker"
|
|
27
|
-
}, /*#__PURE__*/React__default.createElement(Dropdown.Trigger, null,
|
|
28
|
-
|
|
24
|
+
}, /*#__PURE__*/React__default.createElement(Dropdown.Trigger, null, (() => {
|
|
25
|
+
const backgroundColor = _getColor(colorList, color);
|
|
29
26
|
|
|
30
27
|
return /*#__PURE__*/React__default.createElement("span", {
|
|
31
28
|
className: classNames('color_trigger', {
|
|
32
|
-
small
|
|
29
|
+
small
|
|
33
30
|
}),
|
|
34
31
|
style: {
|
|
35
32
|
backgroundColor: _isNamedColor(backgroundColor) ? backgroundColor.color : backgroundColor
|
|
@@ -37,9 +34,9 @@ function ColorPicker(_ref) {
|
|
|
37
34
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
38
35
|
className: "color_trigger--inner_ring"
|
|
39
36
|
}));
|
|
40
|
-
}()), /*#__PURE__*/React__default.createElement(Dropdown.Body, null, /*#__PURE__*/React__default.createElement("div", {
|
|
37
|
+
})()), /*#__PURE__*/React__default.createElement(Dropdown.Body, null, /*#__PURE__*/React__default.createElement("div", {
|
|
41
38
|
className: "color_options"
|
|
42
|
-
}, colorList.reduce(
|
|
39
|
+
}, colorList.reduce((items, currentColor, currentIndex) => {
|
|
43
40
|
items.push( /*#__PURE__*/React__default.createElement(ColorItem, {
|
|
44
41
|
isActive: color >= colorList.length ? currentIndex === 0 : currentIndex === color,
|
|
45
42
|
key: currentIndex,
|
|
@@ -54,20 +51,19 @@ function ColorPicker(_ref) {
|
|
|
54
51
|
|
|
55
52
|
ColorPicker.displayName = 'ColorPicker';
|
|
56
53
|
|
|
57
|
-
function ColorItem(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
54
|
+
function ColorItem({
|
|
55
|
+
color,
|
|
56
|
+
colorIndex,
|
|
57
|
+
isActive,
|
|
58
|
+
onClick,
|
|
59
|
+
tooltip
|
|
60
|
+
}) {
|
|
61
|
+
const item = /*#__PURE__*/React__default.createElement("span", {
|
|
64
62
|
className: 'reactist color_item' + (isActive ? ' active' : ''),
|
|
65
63
|
style: {
|
|
66
64
|
backgroundColor: color
|
|
67
65
|
},
|
|
68
|
-
onClick:
|
|
69
|
-
return _onClick === null || _onClick === void 0 ? void 0 : _onClick(colorIndex);
|
|
70
|
-
}
|
|
66
|
+
onClick: () => onClick == null ? void 0 : onClick(colorIndex)
|
|
71
67
|
}, /*#__PURE__*/React__default.createElement("span", {
|
|
72
68
|
className: "color_item--inner_ring"
|
|
73
69
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-picker.js","sources":["../../../src/components/color-picker/color-picker.tsx"],"sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\n\nimport Dropdown from '../dropdown'\nimport { Tooltip } from '../tooltip'\n\nimport './color-picker.less'\n\ntype NamedColor = { name: string; color: string }\n\nconst COLORS = [\n '#606060',\n '#4A90E2',\n '#03B3B2',\n '#008299',\n '#82BA00',\n '#D24726',\n '#AC193D',\n '#DC4FAD',\n '#3BD5FB',\n '#74E8D3',\n '#FFCC00',\n '#FB886E',\n '#CCCCCC',\n]\n\nconst _isNamedColor = (color: string | NamedColor): color is NamedColor
|
|
1
|
+
{"version":3,"file":"color-picker.js","sources":["../../../src/components/color-picker/color-picker.tsx"],"sourcesContent":["import React from 'react'\nimport classnames from 'classnames'\n\nimport Dropdown from '../dropdown'\nimport { Tooltip } from '../tooltip'\n\nimport './color-picker.less'\n\ntype NamedColor = { name: string; color: string }\n\nconst COLORS = [\n '#606060',\n '#4A90E2',\n '#03B3B2',\n '#008299',\n '#82BA00',\n '#D24726',\n '#AC193D',\n '#DC4FAD',\n '#3BD5FB',\n '#74E8D3',\n '#FFCC00',\n '#FB886E',\n '#CCCCCC',\n]\n\nconst _isNamedColor = (color: string | NamedColor | undefined): color is NamedColor =>\n typeof color !== 'string'\n\nconst _getColor = (colorList: (string | NamedColor)[], colorIndex: number) => {\n const index = colorIndex >= colorList.length ? 0 : colorIndex\n return colorList[index]\n}\n\ntype Props = {\n small?: boolean\n color?: number\n onChange?: (color: number) => void\n colorList?: (string | NamedColor)[]\n}\n\nfunction ColorPicker({ color = 0, small, onChange, colorList = COLORS }: Props) {\n return (\n <Dropdown.Box right className=\"reactist_color_picker\">\n <Dropdown.Trigger>\n {(() => {\n const backgroundColor = _getColor(colorList, color)\n\n return (\n <span\n className={classnames('color_trigger', { small })}\n style={{\n backgroundColor: _isNamedColor(backgroundColor)\n ? backgroundColor.color\n : backgroundColor,\n }}\n >\n <span className=\"color_trigger--inner_ring\" />\n </span>\n )\n })()}\n </Dropdown.Trigger>\n <Dropdown.Body>\n <div className=\"color_options\">\n {colorList.reduce<React.ReactNode[]>((items, currentColor, currentIndex) => {\n items.push(\n <ColorItem\n isActive={\n color >= colorList.length\n ? currentIndex === 0\n : currentIndex === color\n }\n key={currentIndex}\n color={\n _isNamedColor(currentColor) ? currentColor.color : currentColor\n }\n colorIndex={currentIndex}\n onClick={onChange}\n tooltip={_isNamedColor(currentColor) ? currentColor.name : null}\n />,\n )\n return items\n }, [])}\n </div>\n </Dropdown.Body>\n </Dropdown.Box>\n )\n}\nColorPicker.displayName = 'ColorPicker'\n\ntype ColorItemProps = {\n color: string\n colorIndex: number\n isActive?: boolean\n onClick?: (colorIndex: number) => void\n tooltip?: React.ReactNode\n}\n\nfunction ColorItem({ color, colorIndex, isActive, onClick, tooltip }: ColorItemProps) {\n const item = (\n <span\n className={'reactist color_item' + (isActive ? ' active' : '')}\n style={{ backgroundColor: color }}\n onClick={() => onClick?.(colorIndex)}\n >\n <span className=\"color_item--inner_ring\" />\n </span>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{item}</Tooltip> : item\n}\nColorItem.displayName = 'ColorItem'\n\nexport { ColorPicker, ColorItem, COLORS }\n"],"names":["COLORS","_isNamedColor","color","_getColor","colorList","colorIndex","index","length","ColorPicker","small","onChange","React","Dropdown","Box","right","className","Trigger","backgroundColor","classnames","style","Body","reduce","items","currentColor","currentIndex","push","ColorItem","isActive","key","onClick","tooltip","name","displayName","item","Tooltip","content"],"mappings":";;;;;MAUMA,MAAM,GAAG,CACX,SADW,EAEX,SAFW,EAGX,SAHW,EAIX,SAJW,EAKX,SALW,EAMX,SANW,EAOX,SAPW,EAQX,SARW,EASX,SATW,EAUX,SAVW,EAWX,SAXW,EAYX,SAZW,EAaX,SAbW;;AAgBf,MAAMC,aAAa,GAAIC,KAAD,IAClB,OAAOA,KAAP,KAAiB,QADrB;;AAGA,MAAMC,SAAS,GAAG,CAACC,SAAD,EAAqCC,UAArC;EACd,MAAMC,KAAK,GAAGD,UAAU,IAAID,SAAS,CAACG,MAAxB,GAAiC,CAAjC,GAAqCF,UAAnD;EACA,OAAOD,SAAS,CAACE,KAAD,CAAhB;AACH,CAHD;;AAYA,SAASE,WAAT,CAAqB;EAAEN,KAAK,GAAG,CAAV;EAAaO,KAAb;EAAoBC,QAApB;EAA8BN,SAAS,GAAGJ;AAA1C,CAArB;EACI,oBACIW,4BAAA,CAACC,QAAQ,CAACC,GAAV;IAAcC,KAAK;IAACC,SAAS,EAAC;GAA9B,eACIJ,4BAAA,CAACC,QAAQ,CAACI,OAAV,MAAA,EACK,CAAC;IACE,MAAMC,eAAe,GAAGd,SAAS,CAACC,SAAD,EAAYF,KAAZ,CAAjC;;IAEA,oBACIS,4BAAA,OAAA;MACII,SAAS,EAAEG,UAAU,CAAC,eAAD,EAAkB;QAAET;OAApB;MACrBU,KAAK,EAAE;QACHF,eAAe,EAAEhB,aAAa,CAACgB,eAAD,CAAb,GACXA,eAAe,CAACf,KADL,GAEXe;;KALd,eAQIN,4BAAA,OAAA;MAAMI,SAAS,EAAC;KAAhB,CARJ,CADJ;GAHH,GADL,CADJ,eAmBIJ,4BAAA,CAACC,QAAQ,CAACQ,IAAV,MAAA,eACIT,4BAAA,MAAA;IAAKI,SAAS,EAAC;GAAf,EACKX,SAAS,CAACiB,MAAV,CAAoC,CAACC,KAAD,EAAQC,YAAR,EAAsBC,YAAtB;IACjCF,KAAK,CAACG,IAAN,eACId,4BAAA,CAACe,SAAD;MACIC,QAAQ,EACJzB,KAAK,IAAIE,SAAS,CAACG,MAAnB,GACMiB,YAAY,KAAK,CADvB,GAEMA,YAAY,KAAKtB;MAE3B0B,GAAG,EAAEJ;MACLtB,KAAK,EACDD,aAAa,CAACsB,YAAD,CAAb,GAA8BA,YAAY,CAACrB,KAA3C,GAAmDqB;MAEvDlB,UAAU,EAAEmB;MACZK,OAAO,EAAEnB;MACToB,OAAO,EAAE7B,aAAa,CAACsB,YAAD,CAAb,GAA8BA,YAAY,CAACQ,IAA3C,GAAkD;KAZ/D,CADJ;IAgBA,OAAOT,KAAP;GAjBH,EAkBE,EAlBF,CADL,CADJ,CAnBJ,CADJ;AA6CH;;AACDd,WAAW,CAACwB,WAAZ,GAA0B,aAA1B;;AAUA,SAASN,SAAT,CAAmB;EAAExB,KAAF;EAASG,UAAT;EAAqBsB,QAArB;EAA+BE,OAA/B;EAAwCC;AAAxC,CAAnB;EACI,MAAMG,IAAI,gBACNtB,4BAAA,OAAA;IACII,SAAS,EAAE,yBAAyBY,QAAQ,GAAG,SAAH,GAAe,EAAhD;IACXR,KAAK,EAAE;MAAEF,eAAe,EAAEf;;IAC1B2B,OAAO,EAAE,MAAMA,OAAN,oBAAMA,OAAO,CAAGxB,UAAH;GAH1B,eAKIM,4BAAA,OAAA;IAAMI,SAAS,EAAC;GAAhB,CALJ,CADJ;EAUA,OAAOe,OAAO,gBAAGnB,4BAAA,CAACuB,OAAD;IAASC,OAAO,EAAEL;GAAlB,EAA4BG,IAA5B,CAAH,GAAiDA,IAA/D;AACH;;AACDP,SAAS,CAACM,WAAV,GAAwB,WAAxB;;;;"}
|
|
@@ -1,32 +1,30 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { objectWithoutProperties as _objectWithoutProperties, objectSpread2 as _objectSpread2 } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
2
|
import React__default from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { Tooltip } from '../tooltip/tooltip.js';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
const _excluded = ["type", "variant", "size", "loading", "disabled", "tooltip", "onClick", "children"];
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
children = _ref.children,
|
|
24
|
-
props = _objectWithoutPropertiesLoose(_ref, _excluded);
|
|
11
|
+
const Button = /*#__PURE__*/React__default.forwardRef(function Button(_ref, ref) {
|
|
12
|
+
let {
|
|
13
|
+
type = 'button',
|
|
14
|
+
variant,
|
|
15
|
+
size = 'default',
|
|
16
|
+
loading = false,
|
|
17
|
+
disabled = false,
|
|
18
|
+
tooltip,
|
|
19
|
+
onClick,
|
|
20
|
+
children
|
|
21
|
+
} = _ref,
|
|
22
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
25
23
|
|
|
26
|
-
|
|
24
|
+
const className = classNames('reactist_button', variant ? "reactist_button--" + variant : null, size !== 'default' ? "reactist_button--" + size : null, {
|
|
27
25
|
'reactist_button--loading': loading
|
|
28
26
|
}, props.className);
|
|
29
|
-
|
|
27
|
+
const button = /*#__PURE__*/React__default.createElement("button", _objectSpread2(_objectSpread2({}, props), {}, {
|
|
30
28
|
ref: ref,
|
|
31
29
|
type: type,
|
|
32
30
|
className: className,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-button.js","sources":["../../../src/components/deprecated-button/deprecated-button.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport { Tooltip } from '../tooltip'\n\nimport './deprecated-button.less'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\n/** @deprecated */\nexport type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link'\n\n/** @deprecated */\nexport type ButtonSize = 'default' | 'small' | 'large'\n\n/** @deprecated */\nexport type ButtonProps = Omit<NativeButtonProps, 'title' | 'ref'> & {\n /**\n * Loading style. When true it disables the button, but it also adds a visual indication of\n * some in-progress operation going on.\n */\n loading?: boolean\n /**\n * Controls visually how the button shows up from a predefined set of kinds of buttons.\n */\n variant?: ButtonVariant\n /**\n * The size of the button. If not provided it shows up in a normal size.\n */\n size?: ButtonSize\n /**\n * Tooltip that is displayed on hover.\n *\n * This replaces `title` which is not supported for these buttons to avoid confusion.\n */\n tooltip?: React.ReactNode\n}\n\n/**\n * @deprecated\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n type = 'button',\n variant,\n size = 'default',\n loading = false,\n disabled = false,\n tooltip,\n onClick,\n children,\n ...props\n },\n ref,\n) {\n const className = classNames(\n 'reactist_button',\n variant ? `reactist_button--${variant}` : null,\n size !== 'default' ? `reactist_button--${size}` : null,\n { 'reactist_button--loading': loading },\n props.className,\n )\n\n const button = (\n <button\n {...props}\n ref={ref}\n type={type}\n className={className}\n aria-disabled={disabled || loading}\n onClick={disabled || loading ? undefined : onClick}\n >\n {children}\n </button>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{button}</Tooltip> : button\n})\n\nButton.displayName = 'Button'\n\nButton.defaultProps = {\n size: 'default',\n loading: false,\n disabled: false,\n}\n\nexport { Button }\n"],"names":["Button","React","forwardRef","ref","type","variant","size","loading","disabled","tooltip","onClick","children","props","className","classNames","button","undefined","Tooltip","content","displayName","defaultProps"],"mappings":";;;;;;AAyCA;;;;
|
|
1
|
+
{"version":3,"file":"deprecated-button.js","sources":["../../../src/components/deprecated-button/deprecated-button.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport { Tooltip } from '../tooltip'\n\nimport './deprecated-button.less'\n\ntype NativeButtonProps = React.DetailedHTMLProps<\n React.ButtonHTMLAttributes<HTMLButtonElement>,\n HTMLButtonElement\n>\n\n/** @deprecated */\nexport type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'link'\n\n/** @deprecated */\nexport type ButtonSize = 'default' | 'small' | 'large'\n\n/** @deprecated */\nexport type ButtonProps = Omit<NativeButtonProps, 'title' | 'ref'> & {\n /**\n * Loading style. When true it disables the button, but it also adds a visual indication of\n * some in-progress operation going on.\n */\n loading?: boolean\n /**\n * Controls visually how the button shows up from a predefined set of kinds of buttons.\n */\n variant?: ButtonVariant\n /**\n * The size of the button. If not provided it shows up in a normal size.\n */\n size?: ButtonSize\n /**\n * Tooltip that is displayed on hover.\n *\n * This replaces `title` which is not supported for these buttons to avoid confusion.\n */\n tooltip?: React.ReactNode\n}\n\n/**\n * @deprecated\n */\nconst Button = React.forwardRef<HTMLButtonElement, ButtonProps>(function Button(\n {\n type = 'button',\n variant,\n size = 'default',\n loading = false,\n disabled = false,\n tooltip,\n onClick,\n children,\n ...props\n },\n ref,\n) {\n const className = classNames(\n 'reactist_button',\n variant ? `reactist_button--${variant}` : null,\n size !== 'default' ? `reactist_button--${size}` : null,\n { 'reactist_button--loading': loading },\n props.className,\n )\n\n const button = (\n <button\n {...props}\n ref={ref}\n type={type}\n className={className}\n aria-disabled={disabled || loading}\n onClick={disabled || loading ? undefined : onClick}\n >\n {children}\n </button>\n )\n\n return tooltip ? <Tooltip content={tooltip}>{button}</Tooltip> : button\n})\n\nButton.displayName = 'Button'\n\nButton.defaultProps = {\n size: 'default',\n loading: false,\n disabled: false,\n}\n\nexport { Button }\n"],"names":["Button","React","forwardRef","ref","type","variant","size","loading","disabled","tooltip","onClick","children","props","className","classNames","button","undefined","Tooltip","content","displayName","defaultProps"],"mappings":";;;;;;AAyCA;;;;MAGMA,MAAM,gBAAGC,cAAK,CAACC,UAAN,CAAiD,SAASF,MAAT,OAY5DG,GAZ4D;MAC5D;IACIC,IAAI,GAAG,QADX;IAEIC,OAFJ;IAGIC,IAAI,GAAG,SAHX;IAIIC,OAAO,GAAG,KAJd;IAKIC,QAAQ,GAAG,KALf;IAMIC,OANJ;IAOIC,OAPJ;IAQIC;;MACGC;;EAIP,MAAMC,SAAS,GAAGC,UAAU,CACxB,iBADwB,EAExBT,OAAO,yBAAuBA,OAAvB,GAAmC,IAFlB,EAGxBC,IAAI,KAAK,SAAT,yBAAyCA,IAAzC,GAAkD,IAH1B,EAIxB;IAAE,4BAA4BC;GAJN,EAKxBK,KAAK,CAACC,SALkB,CAA5B;EAQA,MAAME,MAAM,gBACRd,4BAAA,SAAA,oCACQW,KADR;IAEIT,GAAG,EAAEA,GAFT;IAGIC,IAAI,EAAEA,IAHV;IAIIS,SAAS,EAAEA,SAJf;qBAKmBL,QAAQ,IAAID,OAL/B;IAMIG,OAAO,EAAEF,QAAQ,IAAID,OAAZ,GAAsBS,SAAtB,GAAkCN;MAE1CC,QARL,CADJ;EAaA,OAAOF,OAAO,gBAAGR,4BAAA,CAACgB,OAAD;IAASC,OAAO,EAAET;GAAlB,EAA4BM,MAA5B,CAAH,GAAmDA,MAAjE;AACH,CApCc;AAsCff,MAAM,CAACmB,WAAP,GAAqB,QAArB;AAEAnB,MAAM,CAACoB,YAAP,GAAsB;EAClBd,IAAI,EAAE,SADY;EAElBC,OAAO,EAAE,KAFS;EAGlBC,QAAQ,EAAE;AAHQ,CAAtB;;;;"}
|
|
@@ -3,16 +3,13 @@ import classNames from 'classnames';
|
|
|
3
3
|
|
|
4
4
|
/** @deprecated */
|
|
5
5
|
|
|
6
|
-
function Loading(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
size = _ref$size === void 0 ? 24 : _ref$size,
|
|
14
|
-
_ref$ariaLabel = _ref['aria-label'],
|
|
15
|
-
ariaLabel = _ref$ariaLabel === void 0 ? 'Loading' : _ref$ariaLabel;
|
|
6
|
+
function Loading({
|
|
7
|
+
className,
|
|
8
|
+
spinnerColor = '#3F82EF',
|
|
9
|
+
bgColor = '#D9E6FB',
|
|
10
|
+
size = 24,
|
|
11
|
+
'aria-label': ariaLabel = 'Loading'
|
|
12
|
+
}) {
|
|
16
13
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
17
14
|
className: classNames('reactist_loading', className),
|
|
18
15
|
"aria-label": ariaLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deprecated-loading.js","sources":["../../../src/components/deprecated-loading/deprecated-loading.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport './deprecated-loading.less'\n\ntype Props = {\n /** Additional css class that is applied to Loading. */\n className?: string\n /** Hex code of the spinner color. */\n spinnerColor?: string\n /** Hex code of the background color. */\n bgColor?: string\n /** Circle diameter in pixels. */\n size?: string | number\n\n 'aria-label'?: string\n}\n\n/** @deprecated */\nfunction Loading({\n className,\n spinnerColor = '#3F82EF',\n bgColor = '#D9E6FB',\n size = 24,\n 'aria-label': ariaLabel = 'Loading',\n}: Props) {\n return (\n <div\n className={classNames('reactist_loading', className)}\n aria-label={ariaLabel}\n aria-live=\"assertive\"\n role=\"alert\"\n >\n <span className=\"reactist_loading--spinner\">\n <svg width={size} height={size} viewBox={'0 0 24 24'}>\n <g fill=\"none\" fillRule=\"nonzero\">\n <path\n fill={spinnerColor}\n d=\"M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z\"\n />\n <path\n fill={bgColor}\n d=\"M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z\"\n />\n </g>\n </svg>\n </span>\n </div>\n )\n}\n\nLoading.displayName = 'Loading'\n\nexport { Loading }\n"],"names":["Loading","className","spinnerColor","bgColor","size","ariaLabel","React","classNames","role","width","height","viewBox","fill","fillRule","d","displayName"],"mappings":";;;AAkBA;;AACA,SAASA,OAAT;
|
|
1
|
+
{"version":3,"file":"deprecated-loading.js","sources":["../../../src/components/deprecated-loading/deprecated-loading.tsx"],"sourcesContent":["import React from 'react'\nimport classNames from 'classnames'\n\nimport './deprecated-loading.less'\n\ntype Props = {\n /** Additional css class that is applied to Loading. */\n className?: string\n /** Hex code of the spinner color. */\n spinnerColor?: string\n /** Hex code of the background color. */\n bgColor?: string\n /** Circle diameter in pixels. */\n size?: string | number\n\n 'aria-label'?: string\n}\n\n/** @deprecated */\nfunction Loading({\n className,\n spinnerColor = '#3F82EF',\n bgColor = '#D9E6FB',\n size = 24,\n 'aria-label': ariaLabel = 'Loading',\n}: Props) {\n return (\n <div\n className={classNames('reactist_loading', className)}\n aria-label={ariaLabel}\n aria-live=\"assertive\"\n role=\"alert\"\n >\n <span className=\"reactist_loading--spinner\">\n <svg width={size} height={size} viewBox={'0 0 24 24'}>\n <g fill=\"none\" fillRule=\"nonzero\">\n <path\n fill={spinnerColor}\n d=\"M17.945 3.958A9.955 9.955 0 0 0 12 2c-2.19 0-4.217.705-5.865 1.9L5.131 2.16A11.945 11.945 0 0 1 12 0c2.59 0 4.99.82 6.95 2.217l-1.005 1.741z\"\n />\n <path\n fill={bgColor}\n d=\"M5.13 2.16L6.136 3.9A9.987 9.987 0 0 0 2 12c0 5.523 4.477 10 10 10s10-4.477 10-10a9.986 9.986 0 0 0-4.055-8.042l1.006-1.741A11.985 11.985 0 0 1 24 12c0 6.627-5.373 12-12 12S0 18.627 0 12c0-4.073 2.029-7.671 5.13-9.84z\"\n />\n </g>\n </svg>\n </span>\n </div>\n )\n}\n\nLoading.displayName = 'Loading'\n\nexport { Loading }\n"],"names":["Loading","className","spinnerColor","bgColor","size","ariaLabel","React","classNames","role","width","height","viewBox","fill","fillRule","d","displayName"],"mappings":";;;AAkBA;;AACA,SAASA,OAAT,CAAiB;EACbC,SADa;EAEbC,YAAY,GAAG,SAFF;EAGbC,OAAO,GAAG,SAHG;EAIbC,IAAI,GAAG,EAJM;EAKb,cAAcC,SAAS,GAAG;AALb,CAAjB;EAOI,oBACIC,4BAAA,MAAA;IACIL,SAAS,EAAEM,UAAU,CAAC,kBAAD,EAAqBN,SAArB;kBACTI;iBACF;IACVG,IAAI,EAAC;GAJT,eAMIF,4BAAA,OAAA;IAAML,SAAS,EAAC;GAAhB,eACIK,4BAAA,MAAA;IAAKG,KAAK,EAAEL;IAAMM,MAAM,EAAEN;IAAMO,OAAO,EAAE;GAAzC,eACIL,4BAAA,IAAA;IAAGM,IAAI,EAAC;IAAOC,QAAQ,EAAC;GAAxB,eACIP,4BAAA,OAAA;IACIM,IAAI,EAAEV;IACNY,CAAC,EAAC;GAFN,CADJ,eAKIR,4BAAA,OAAA;IACIM,IAAI,EAAET;IACNW,CAAC,EAAC;GAFN,CALJ,CADJ,CADJ,CANJ,CADJ;AAuBH;;AAEDd,OAAO,CAACe,WAAR,GAAsB,SAAtB;;;;"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { inheritsLoose as _inheritsLoose } from '../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import React__default from 'react';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import ReactDOM from 'react-dom';
|
|
@@ -6,58 +5,51 @@ import CloseIcon from '../icons/CloseIcon.svg.js';
|
|
|
6
5
|
|
|
7
6
|
/** @deprecated */
|
|
8
7
|
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
class Box extends React__default.Component {
|
|
9
|
+
constructor(...args) {
|
|
10
|
+
super(...args);
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
var _this;
|
|
14
|
-
|
|
15
|
-
_this = _React$Component.apply(this, arguments) || this;
|
|
16
|
-
|
|
17
|
-
_this._closeModal = function () {
|
|
12
|
+
this._closeModal = () => {
|
|
18
13
|
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
19
|
-
|
|
14
|
+
const modalElement = document.getElementById('modal_box');
|
|
20
15
|
ReactDOM.unmountComponentAtNode(modalElement);
|
|
21
16
|
};
|
|
22
17
|
|
|
23
|
-
|
|
18
|
+
this._handleKeyDown = event => {
|
|
24
19
|
if (event.keyCode === 27) {
|
|
25
20
|
// ESC
|
|
26
|
-
|
|
21
|
+
this._closeModal();
|
|
27
22
|
|
|
28
23
|
if (event.preventDefault) event.preventDefault();
|
|
29
24
|
}
|
|
30
25
|
};
|
|
31
26
|
|
|
32
|
-
|
|
27
|
+
this._handleOverlayClick = event => {
|
|
33
28
|
if (event.target instanceof Element && (event.target.id === 'reactist-overlay' || event.target.id === 'reactist-overlay-inner')) {
|
|
34
|
-
|
|
29
|
+
this._closeModal();
|
|
35
30
|
}
|
|
36
31
|
};
|
|
37
|
-
|
|
38
|
-
return _this;
|
|
39
32
|
}
|
|
40
33
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
_proto.componentDidMount = function componentDidMount() {
|
|
34
|
+
componentDidMount() {
|
|
44
35
|
window.addEventListener('keydown', this._handleKeyDown);
|
|
45
|
-
}
|
|
36
|
+
}
|
|
46
37
|
|
|
47
|
-
|
|
38
|
+
componentWillUnmount() {
|
|
48
39
|
window.removeEventListener('keydown', this._handleKeyDown);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
render() {
|
|
43
|
+
const {
|
|
44
|
+
large,
|
|
45
|
+
medium,
|
|
46
|
+
style,
|
|
47
|
+
children,
|
|
48
|
+
closeOnOverlayClick
|
|
49
|
+
} = this.props;
|
|
50
|
+
const className = classNames('reactist_modal_box', {
|
|
51
|
+
large,
|
|
52
|
+
medium
|
|
61
53
|
}, this.props.className);
|
|
62
54
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
63
55
|
className: "reactist_overlay",
|
|
@@ -70,11 +62,12 @@ var Box = /*#__PURE__*/function (_React$Component) {
|
|
|
70
62
|
style: style,
|
|
71
63
|
className: className
|
|
72
64
|
}, children)));
|
|
73
|
-
}
|
|
65
|
+
}
|
|
74
66
|
|
|
75
|
-
|
|
76
|
-
}(React__default.Component);
|
|
67
|
+
}
|
|
77
68
|
|
|
69
|
+
Box.displayName = void 0;
|
|
70
|
+
Box.defaultProps = void 0;
|
|
78
71
|
Box.displayName = 'Modal.Box';
|
|
79
72
|
Box.defaultProps = {
|
|
80
73
|
large: false,
|
|
@@ -82,16 +75,8 @@ Box.defaultProps = {
|
|
|
82
75
|
};
|
|
83
76
|
/** @deprecated */
|
|
84
77
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
function Header() {
|
|
89
|
-
return _React$Component2.apply(this, arguments) || this;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
var _proto2 = Header.prototype;
|
|
93
|
-
|
|
94
|
-
_proto2._closeModal = function _closeModal(event) {
|
|
78
|
+
class Header extends React__default.Component {
|
|
79
|
+
_closeModal(event) {
|
|
95
80
|
event.preventDefault();
|
|
96
81
|
|
|
97
82
|
if (typeof this.props.beforeClose === 'function') {
|
|
@@ -99,11 +84,11 @@ var Header = /*#__PURE__*/function (_React$Component2) {
|
|
|
99
84
|
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
100
85
|
|
|
101
86
|
|
|
102
|
-
|
|
87
|
+
const modalElement = document.getElementById('modal_box');
|
|
103
88
|
ReactDOM.unmountComponentAtNode(modalElement);
|
|
104
|
-
}
|
|
89
|
+
}
|
|
105
90
|
|
|
106
|
-
|
|
91
|
+
render() {
|
|
107
92
|
return (
|
|
108
93
|
/*#__PURE__*/
|
|
109
94
|
|
|
@@ -122,39 +107,33 @@ var Header = /*#__PURE__*/function (_React$Component2) {
|
|
|
122
107
|
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
123
108
|
|
|
124
109
|
);
|
|
125
|
-
}
|
|
110
|
+
}
|
|
126
111
|
|
|
127
|
-
|
|
128
|
-
}(React__default.Component);
|
|
112
|
+
}
|
|
129
113
|
|
|
114
|
+
Header.displayName = void 0;
|
|
115
|
+
Header.defaultProps = void 0;
|
|
130
116
|
Header.displayName = 'Modal.Header';
|
|
131
117
|
/** @deprecated */
|
|
132
118
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
function Body() {
|
|
137
|
-
return _React$Component3.apply(this, arguments) || this;
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
var _proto3 = Body.prototype;
|
|
141
|
-
|
|
142
|
-
_proto3._closeModal = function _closeModal(event) {
|
|
119
|
+
class Body extends React__default.Component {
|
|
120
|
+
_closeModal(event) {
|
|
143
121
|
event.preventDefault(); // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
144
122
|
|
|
145
|
-
|
|
123
|
+
const modalElement = document.getElementById('modal_box');
|
|
146
124
|
ReactDOM.unmountComponentAtNode(modalElement);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
render() {
|
|
128
|
+
const {
|
|
129
|
+
icon,
|
|
130
|
+
plain,
|
|
131
|
+
children,
|
|
132
|
+
style,
|
|
133
|
+
showCloseIcon
|
|
134
|
+
} = this.props;
|
|
135
|
+
const className = classNames('reactist_modal_box__body', {
|
|
136
|
+
plain
|
|
158
137
|
}, this.props.className);
|
|
159
138
|
return (
|
|
160
139
|
/*#__PURE__*/
|
|
@@ -177,49 +156,38 @@ var Body = /*#__PURE__*/function (_React$Component3) {
|
|
|
177
156
|
/* eslint-enable jsx-a11y/anchor-is-valid */
|
|
178
157
|
|
|
179
158
|
);
|
|
180
|
-
}
|
|
159
|
+
}
|
|
181
160
|
|
|
182
|
-
|
|
183
|
-
}(React__default.Component);
|
|
161
|
+
}
|
|
184
162
|
|
|
163
|
+
Body.displayName = void 0;
|
|
164
|
+
Body.defaultProps = void 0;
|
|
185
165
|
Body.displayName = 'Modal.Body';
|
|
186
166
|
Body.defaultProps = {
|
|
187
167
|
showCloseIcon: false
|
|
188
168
|
};
|
|
189
169
|
/** @deprecated */
|
|
190
170
|
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
function Actions() {
|
|
195
|
-
return _React$Component4.apply(this, arguments) || this;
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
var _proto4 = Actions.prototype;
|
|
199
|
-
|
|
200
|
-
_proto4._onClick = function _onClick(onClick) {
|
|
171
|
+
class Actions extends React__default.Component {
|
|
172
|
+
_onClick(onClick) {
|
|
201
173
|
if (onClick) {
|
|
202
174
|
onClick();
|
|
203
175
|
} // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
204
176
|
|
|
205
177
|
|
|
206
|
-
|
|
178
|
+
const modalElement = document.getElementById('modal_box');
|
|
207
179
|
ReactDOM.unmountComponentAtNode(modalElement);
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
_proto4.render = function render() {
|
|
211
|
-
var _this2 = this;
|
|
180
|
+
}
|
|
212
181
|
|
|
213
|
-
|
|
182
|
+
render() {
|
|
183
|
+
const children = React__default.Children.map( // see: https://github.com/microsoft/TypeScript/issues/21699
|
|
214
184
|
// @ts-expect-error Children cannot be typed properly yet in React
|
|
215
|
-
this.props.children,
|
|
185
|
+
this.props.children, child => {
|
|
216
186
|
var _child$props;
|
|
217
187
|
|
|
218
|
-
if (child
|
|
188
|
+
if (child != null && (_child$props = child.props) != null && _child$props.close) {
|
|
219
189
|
return /*#__PURE__*/React__default.cloneElement(child, {
|
|
220
|
-
onClick:
|
|
221
|
-
return _this2._onClick(child.props.onClick);
|
|
222
|
-
}
|
|
190
|
+
onClick: () => this._onClick(child.props.onClick)
|
|
223
191
|
});
|
|
224
192
|
} else {
|
|
225
193
|
return child ? /*#__PURE__*/React__default.cloneElement(child) : /*#__PURE__*/React__default.createElement(React__default.Fragment, null);
|
|
@@ -228,11 +196,11 @@ var Actions = /*#__PURE__*/function (_React$Component4) {
|
|
|
228
196
|
return /*#__PURE__*/React__default.createElement("div", {
|
|
229
197
|
className: "reactist_modal_box__actions"
|
|
230
198
|
}, children);
|
|
231
|
-
}
|
|
199
|
+
}
|
|
232
200
|
|
|
233
|
-
|
|
234
|
-
}(React__default.Component);
|
|
201
|
+
}
|
|
235
202
|
|
|
203
|
+
Actions.displayName = void 0;
|
|
236
204
|
Actions.displayName = 'Modal.Actions';
|
|
237
205
|
|
|
238
206
|
export { Actions, Body, Box, Header };
|