@codacy/ui-components 0.66.24 → 0.66.26
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/Avatar/Avatar.js +20 -28
- package/lib/Avatar/Avatar.types.js +1 -5
- package/lib/Avatar/gravatar.js +14 -22
- package/lib/Avatar/index.js +1 -16
- package/lib/Banner/Banner.js +33 -50
- package/lib/Banner/Banner.styles.d.ts +1 -1
- package/lib/Banner/Banner.styles.js +11 -20
- package/lib/Banner/Banner.types.js +1 -5
- package/lib/Banner/index.js +2 -27
- package/lib/Bannerol/Bannerol.js +44 -61
- package/lib/Bannerol/Bannerol.styles.js +9 -18
- package/lib/Bannerol/Bannerol.types.js +1 -5
- package/lib/Bannerol/index.js +3 -38
- package/lib/BigTabs/BigTabs.js +39 -54
- package/lib/BigTabs/BigTabs.styles.js +79 -107
- package/lib/BigTabs/BigTabs.types.js +1 -5
- package/lib/BigTabs/index.js +1 -16
- package/lib/Button/Button.js +45 -67
- package/lib/Button/index.js +2 -27
- package/lib/Button/styles.js +101 -130
- package/lib/Button/types.js +1 -5
- package/lib/Checkbox/Checkbox.js +55 -68
- package/lib/Checkbox/CheckboxFilterList.js +33 -66
- package/lib/Checkbox/index.js +3 -38
- package/lib/Checkbox/styles.js +64 -86
- package/lib/Checkbox/types.js +1 -5
- package/lib/CloseButton/index.d.ts +1 -1
- package/lib/CloseButton/index.js +24 -36
- package/lib/Divider/Divider.js +14 -25
- package/lib/Divider/Divider.styles.d.ts +1 -1
- package/lib/Divider/Divider.styles.js +24 -38
- package/lib/Divider/Divider.types.js +1 -5
- package/lib/Divider/index.js +1 -16
- package/lib/Dropdown/Content/DropdownInput.js +10 -20
- package/lib/Dropdown/Content/DropdownItem.js +22 -36
- package/lib/Dropdown/Content/DropdownSeparator.js +8 -19
- package/lib/Dropdown/Content/DropdownTitle.js +8 -22
- package/lib/Dropdown/Content/index.js +4 -49
- package/lib/Dropdown/Dropdown.js +74 -102
- package/lib/Dropdown/Dropdown.styles.d.ts +1 -1
- package/lib/Dropdown/Dropdown.styles.js +60 -82
- package/lib/Dropdown/Dropdown.types.js +1 -5
- package/lib/Dropdown/Triggers/DropdownButtonTrigger.js +19 -32
- package/lib/Dropdown/Triggers/DropdownItemTrigger.js +18 -30
- package/lib/Dropdown/Triggers/FilterTrigger.js +66 -93
- package/lib/Dropdown/Triggers/InputTrigger.js +15 -24
- package/lib/Dropdown/Triggers/SelectTrigger.js +12 -21
- package/lib/Dropdown/Triggers/hooks.js +17 -26
- package/lib/Dropdown/Triggers/index.js +6 -71
- package/lib/Dropdown/Triggers/types.js +1 -5
- package/lib/Dropdown/index.js +4 -49
- package/lib/ExpandableBox/ExpandableBox.js +28 -43
- package/lib/ExpandableBox/ExpandableBox.styles.d.ts +2 -2
- package/lib/ExpandableBox/ExpandableBox.styles.js +27 -40
- package/lib/ExpandableBox/ExpandableBox.types.js +1 -5
- package/lib/ExpandableBox/index.js +1 -16
- package/lib/Flexbox/Flexbox.js +14 -21
- package/lib/Flexbox/index.js +1 -16
- package/lib/Group/Group.js +7 -18
- package/lib/Group/Group.styles.js +8 -16
- package/lib/Group/Group.types.js +1 -5
- package/lib/Group/index.js +1 -16
- package/lib/Icon/Icon.js +15 -26
- package/lib/Icon/Icon.styles.d.ts +1 -1
- package/lib/Icon/Icon.styles.js +57 -50
- package/lib/Icon/Icon.types.js +1 -5
- package/lib/Icon/index.js +1 -16
- package/lib/IconAndText/IconAndText.js +23 -36
- package/lib/IconAndText/IconAndText.styles.js +19 -29
- package/lib/IconAndText/IconAndText.types.js +1 -5
- package/lib/IconAndText/index.js +1 -16
- package/lib/Icons/Chevrons.js +45 -65
- package/lib/Icons/CodacyIcon.js +9 -20
- package/lib/Icons/Ellipsis.js +18 -29
- package/lib/Icons/Messages.js +58 -79
- package/lib/Icons/Search.js +8 -19
- package/lib/Icons/Severities.js +113 -149
- package/lib/Icons/Sorting.js +15 -29
- package/lib/Icons/Spinner.js +11 -22
- package/lib/Icons/Symbols.js +67 -90
- package/lib/Icons/index.js +8 -93
- package/lib/Img/Img.js +26 -45
- package/lib/Img/Img.styles.d.ts +2 -2
- package/lib/Img/Img.styles.js +21 -29
- package/lib/Img/Img.types.js +1 -5
- package/lib/Img/index.js +1 -16
- package/lib/InlineMessage/InlineMessage.js +43 -70
- package/lib/InlineMessage/index.js +1 -16
- package/lib/InlineMessage/types.js +1 -5
- package/lib/Input/Input.js +115 -143
- package/lib/Input/hooks.js +107 -208
- package/lib/Input/index.js +2 -27
- package/lib/Input/styles.d.ts +2 -2
- package/lib/Input/styles.js +116 -151
- package/lib/Input/types.js +1 -5
- package/lib/Labeled/Labeled.js +22 -35
- package/lib/Labeled/index.js +1 -16
- package/lib/Labeled/styles.js +23 -37
- package/lib/Labeled/types.js +1 -5
- package/lib/LeftMenu/LeftMenu.js +10 -21
- package/lib/LeftMenu/LeftMenu.styles.js +25 -43
- package/lib/LeftMenu/LeftMenu.types.js +1 -5
- package/lib/LeftMenu/index.js +1 -16
- package/lib/Link/Link.js +32 -50
- package/lib/Link/Link.styles.js +11 -23
- package/lib/Link/Link.types.js +1 -5
- package/lib/Link/index.js +3 -38
- package/lib/Message/Message.js +31 -42
- package/lib/Message/Message.styles.js +18 -31
- package/lib/Message/Message.types.js +1 -5
- package/lib/Message/index.js +1 -16
- package/lib/Modal/ConfirmationModal.js +40 -67
- package/lib/Modal/Modal.js +107 -137
- package/lib/Modal/index.js +2 -27
- package/lib/Modal/styles.js +44 -62
- package/lib/Modal/types.js +1 -5
- package/lib/MoreInfo/MoreInfo.js +41 -53
- package/lib/MoreInfo/index.js +1 -16
- package/lib/MoreInfo/types.js +1 -5
- package/lib/MultiSlider/MultiSlider.js +17 -31
- package/lib/MultiSlider/index.js +1 -16
- package/lib/MultiSlider/styles.js +18 -34
- package/lib/MultiSlider/types.js +1 -5
- package/lib/Panel/Panel.js +9 -19
- package/lib/Panel/Panel.styles.js +15 -22
- package/lib/Panel/Panel.types.js +1 -5
- package/lib/Panel/index.js +2 -27
- package/lib/PillLabel/PillLabel.js +35 -49
- package/lib/PillLabel/PillLabel.styles.js +33 -44
- package/lib/PillLabel/PillLabel.types.js +1 -5
- package/lib/PillLabel/index.js +1 -16
- package/lib/Popup/Popup.js +43 -61
- package/lib/Popup/index.js +1 -16
- package/lib/Popup/styles.js +22 -34
- package/lib/Popup/types.js +1 -5
- package/lib/ProgressBar/ProgressBar.js +19 -35
- package/lib/ProgressBar/index.js +2 -27
- package/lib/ProgressBar/styles.d.ts +2 -2
- package/lib/ProgressBar/styles.js +21 -37
- package/lib/ProgressBar/types.d.ts +0 -3
- package/lib/ProgressBar/types.js +1 -5
- package/lib/Radio/Radio.js +47 -59
- package/lib/Radio/index.js +1 -16
- package/lib/Radio/styles.js +48 -72
- package/lib/Radio/types.js +1 -5
- package/lib/ScrollableContent/ScrollableContent.js +27 -40
- package/lib/ScrollableContent/ScrollableContent.styles.js +22 -39
- package/lib/ScrollableContent/ScrollableContent.types.js +1 -5
- package/lib/ScrollableContent/index.js +2 -27
- package/lib/ScrollableContent/useScrollContainer.js +35 -50
- package/lib/Skeleton/Skeleton.js +25 -45
- package/lib/Skeleton/Skeleton.styles.js +28 -25
- package/lib/Skeleton/Skeleton.types.js +1 -5
- package/lib/Skeleton/index.js +2 -20
- package/lib/Slider/Slider.js +32 -56
- package/lib/Slider/index.js +1 -16
- package/lib/Slider/styles.js +41 -60
- package/lib/Slider/types.js +1 -5
- package/lib/StepNumber/StepNumber.js +26 -40
- package/lib/StepNumber/index.js +1 -16
- package/lib/StepNumber/styles.js +13 -24
- package/lib/StepNumber/types.js +1 -5
- package/lib/Stepper/Stepper.js +45 -62
- package/lib/Stepper/Stepper.styles.js +27 -44
- package/lib/Stepper/Stepper.types.js +1 -5
- package/lib/Stepper/index.js +1 -16
- package/lib/Switcher/Switcher.js +22 -34
- package/lib/Switcher/Switcher.styles.js +27 -42
- package/lib/Switcher/Switcher.types.js +1 -5
- package/lib/Switcher/index.js +1 -16
- package/lib/Tab/Tab.js +21 -33
- package/lib/Tab/Tab.styles.js +34 -50
- package/lib/Tab/Tab.types.js +1 -5
- package/lib/Tab/index.js +1 -16
- package/lib/Table/NewSelectableTable.js +59 -97
- package/lib/Table/SelectableTable.js +142 -189
- package/lib/Table/Table.js +110 -155
- package/lib/Table/Table.styles.js +67 -90
- package/lib/Table/Table.types.js +1 -5
- package/lib/Table/index.js +2 -27
- package/lib/TagsInput/TagsInput.js +32 -46
- package/lib/TagsInput/index.js +1 -16
- package/lib/TagsInput/style.js +45 -71
- package/lib/TagsInput/types.js +1 -5
- package/lib/Textarea/Textarea.js +52 -71
- package/lib/Textarea/Textarea.styles.js +91 -126
- package/lib/Textarea/Textarea.types.js +1 -5
- package/lib/Textarea/index.js +1 -16
- package/lib/ThemeProvider/ThemeProvider.js +41 -65
- package/lib/ThemeProvider/index.js +1 -16
- package/lib/Toast/Toast.js +53 -68
- package/lib/Toast/index.js +1 -16
- package/lib/Toast/styles.js +29 -49
- package/lib/Toast/types.js +1 -5
- package/lib/Toggle/Toggle.js +48 -65
- package/lib/Toggle/index.js +1 -16
- package/lib/Toggle/styles.d.ts +1 -1
- package/lib/Toggle/styles.js +66 -101
- package/lib/Toggle/types.js +1 -5
- package/lib/Tooltip/Tooltip.js +84 -121
- package/lib/Tooltip/index.js +2 -27
- package/lib/Tooltip/styles.js +63 -93
- package/lib/Tooltip/types.js +1 -5
- package/lib/Typography/Typography.js +78 -116
- package/lib/Typography/Typography.styles.js +61 -78
- package/lib/Typography/Typography.types.js +1 -5
- package/lib/Typography/index.js +3 -38
- package/lib/emotion.d.js +1 -3
- package/lib/hooks/index.js +3 -38
- package/lib/hooks/useForwardedRef.js +5 -11
- package/lib/hooks/useInfiniteScroll.js +13 -25
- package/lib/hooks/useStatefulRef.js +10 -23
- package/lib/index.js +49 -544
- package/lib/system-props/color.js +3 -9
- package/lib/system-props/index.js +2 -27
- package/lib/system-props/types.js +1 -5
- package/lib/theme/ColorSchemes/components/alerts.js +30 -38
- package/lib/theme/ColorSchemes/components/button.js +89 -97
- package/lib/theme/ColorSchemes/components/cards.js +16 -24
- package/lib/theme/ColorSchemes/components/charts.js +93 -101
- package/lib/theme/ColorSchemes/components/checkbox-input.js +13 -21
- package/lib/theme/ColorSchemes/components/divider.js +4 -12
- package/lib/theme/ColorSchemes/components/drawer.js +21 -29
- package/lib/theme/ColorSchemes/components/effects.js +5 -13
- package/lib/theme/ColorSchemes/components/filters.js +12 -20
- package/lib/theme/ColorSchemes/components/index.d.ts +2 -0
- package/lib/theme/ColorSchemes/components/index.js +23 -236
- package/lib/theme/ColorSchemes/components/input.js +38 -46
- package/lib/theme/ColorSchemes/components/issues.js +27 -35
- package/lib/theme/ColorSchemes/components/label.js +33 -41
- package/lib/theme/ColorSchemes/components/list-orb.js +8 -16
- package/lib/theme/ColorSchemes/components/loading.js +4 -12
- package/lib/theme/ColorSchemes/components/logo.js +6 -14
- package/lib/theme/ColorSchemes/components/modals.js +6 -14
- package/lib/theme/ColorSchemes/components/navigation.js +17 -25
- package/lib/theme/ColorSchemes/components/progress-bar.d.ts +5 -0
- package/lib/theme/ColorSchemes/components/progress-bar.js +5 -0
- package/lib/theme/ColorSchemes/components/selector.js +20 -28
- package/lib/theme/ColorSchemes/components/stepper.js +9 -17
- package/lib/theme/ColorSchemes/components/tables.js +12 -20
- package/lib/theme/ColorSchemes/components/tabs.js +13 -21
- package/lib/theme/ColorSchemes/components/tooltip.d.ts +6 -0
- package/lib/theme/ColorSchemes/components/tooltip.js +6 -0
- package/lib/theme/ColorSchemes/components/utils.js +1 -11
- package/lib/theme/ColorSchemes/dark/background.d.ts +27 -27
- package/lib/theme/ColorSchemes/dark/background.js +42 -50
- package/lib/theme/ColorSchemes/dark/border.d.ts +27 -27
- package/lib/theme/ColorSchemes/dark/border.js +37 -45
- package/lib/theme/ColorSchemes/dark/data.js +18 -24
- package/lib/theme/ColorSchemes/dark/icon.d.ts +27 -27
- package/lib/theme/ColorSchemes/dark/icon.js +40 -48
- package/lib/theme/ColorSchemes/dark/illustration.js +11 -17
- package/lib/theme/ColorSchemes/dark/index.js +60 -26
- package/lib/theme/ColorSchemes/dark/text.d.ts +27 -27
- package/lib/theme/ColorSchemes/dark/text.js +47 -54
- package/lib/theme/ColorSchemes/index.js +4 -49
- package/lib/theme/ColorSchemes/light/background.d.ts +27 -27
- package/lib/theme/ColorSchemes/light/background.js +42 -50
- package/lib/theme/ColorSchemes/light/border.d.ts +27 -27
- package/lib/theme/ColorSchemes/light/border.js +37 -45
- package/lib/theme/ColorSchemes/light/data.js +18 -24
- package/lib/theme/ColorSchemes/light/icon.d.ts +27 -27
- package/lib/theme/ColorSchemes/light/icon.js +40 -48
- package/lib/theme/ColorSchemes/light/illustration.js +11 -17
- package/lib/theme/ColorSchemes/light/index.d.ts +59 -54
- package/lib/theme/ColorSchemes/light/index.js +43 -19
- package/lib/theme/ColorSchemes/light/text.d.ts +27 -27
- package/lib/theme/ColorSchemes/light/text.js +47 -54
- package/lib/theme/ColorSchemes/primitives/blue.js +1 -7
- package/lib/theme/ColorSchemes/primitives/green.js +1 -7
- package/lib/theme/ColorSchemes/primitives/grey.js +1 -7
- package/lib/theme/ColorSchemes/primitives/index.d.ts +9 -9
- package/lib/theme/ColorSchemes/primitives/index.js +20 -18
- package/lib/theme/ColorSchemes/primitives/magenta.js +1 -7
- package/lib/theme/ColorSchemes/primitives/orange.js +1 -7
- package/lib/theme/ColorSchemes/primitives/purple.js +1 -7
- package/lib/theme/ColorSchemes/primitives/red.js +1 -7
- package/lib/theme/ColorSchemes/primitives/teal.js +1 -7
- package/lib/theme/ColorSchemes/primitives/yellow.js +1 -7
- package/lib/theme/ColorSchemes/semantics.js +7 -13
- package/lib/theme/index.js +2 -27
- package/lib/theme/theme.js +68 -77
- package/lib/types.js +1 -5
- package/lib/utils/hash.js +3 -9
- package/lib/utils/reactNodeToText.js +9 -17
- package/package.json +21 -11
package/lib/Toast/Toast.js
CHANGED
|
@@ -1,39 +1,29 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
var _styles = require("./styles");
|
|
12
|
-
var _Icons = require("../Icons");
|
|
13
|
-
var _reactToastify = require("react-toastify");
|
|
14
|
-
var _Typography = require("../Typography");
|
|
15
|
-
var _hash = require("../utils/hash");
|
|
16
|
-
var _reactNodeToText = require("../utils/reactNodeToText");
|
|
17
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
-
var DEFAULT_TOAST_TYPE = 'success';
|
|
19
|
-
var TypeIcons = {
|
|
20
|
-
"default": /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icons.SuccessIcon, {
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { StyledToastContainer } from './styles';
|
|
3
|
+
import { ErrorIcon, WarningIcon, InfoIcon, SuccessIcon } from '../Icons';
|
|
4
|
+
import { toast as launchToast, ToastContainer as ToastifyContainer } from 'react-toastify';
|
|
5
|
+
import { Subheader, Paragraph } from '../Typography';
|
|
6
|
+
import { hash } from '../utils/hash';
|
|
7
|
+
import { reactNodeToText } from '../utils/reactNodeToText';
|
|
8
|
+
const DEFAULT_TOAST_TYPE = 'success';
|
|
9
|
+
const TypeIcons = {
|
|
10
|
+
default: /*#__PURE__*/React.createElement(SuccessIcon, {
|
|
21
11
|
color: "alerts-success-icon"
|
|
22
12
|
}),
|
|
23
|
-
success: /*#__PURE__*/
|
|
13
|
+
success: /*#__PURE__*/React.createElement(SuccessIcon, {
|
|
24
14
|
color: "alerts-success-icon"
|
|
25
15
|
}),
|
|
26
|
-
error: /*#__PURE__*/
|
|
16
|
+
error: /*#__PURE__*/React.createElement(ErrorIcon, {
|
|
27
17
|
color: "alerts-danger-icon"
|
|
28
18
|
}),
|
|
29
|
-
info: /*#__PURE__*/
|
|
19
|
+
info: /*#__PURE__*/React.createElement(InfoIcon, {
|
|
30
20
|
color: "alerts-info-icon"
|
|
31
21
|
}),
|
|
32
|
-
warning: /*#__PURE__*/
|
|
22
|
+
warning: /*#__PURE__*/React.createElement(WarningIcon, {
|
|
33
23
|
color: "alerts-warning-icon"
|
|
34
24
|
})
|
|
35
25
|
};
|
|
36
|
-
|
|
26
|
+
const getInnerToastText = content => {
|
|
37
27
|
if (!content) return '';
|
|
38
28
|
switch (typeof content) {
|
|
39
29
|
case 'string':
|
|
@@ -41,61 +31,56 @@ var getInnerToastText = function getInnerToastText(content) {
|
|
|
41
31
|
case 'object':
|
|
42
32
|
if ('title' in content || 'description' in content) {
|
|
43
33
|
if (typeof content.description === 'object') {
|
|
44
|
-
return
|
|
34
|
+
return `${content.title || ''} ${reactNodeToText(content.description)}`;
|
|
45
35
|
} else {
|
|
46
|
-
return
|
|
36
|
+
return `${content.title || ''} ${content.description}`;
|
|
47
37
|
}
|
|
48
38
|
}
|
|
49
|
-
return
|
|
39
|
+
return reactNodeToText(content);
|
|
50
40
|
default:
|
|
51
41
|
return '';
|
|
52
42
|
}
|
|
53
43
|
};
|
|
54
|
-
|
|
55
|
-
|
|
44
|
+
const ToastContentWrapper = ({
|
|
45
|
+
content
|
|
46
|
+
}) => {
|
|
56
47
|
if (content && typeof content === 'object' && 'description' in content) {
|
|
57
|
-
return /*#__PURE__*/(
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
as: "div",
|
|
66
|
-
children: content.description
|
|
67
|
-
})]
|
|
68
|
-
});
|
|
48
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, content.title && /*#__PURE__*/React.createElement(Subheader, {
|
|
49
|
+
size: "lg",
|
|
50
|
+
color: "alerts-primary-text",
|
|
51
|
+
mb: 2
|
|
52
|
+
}, content.title), /*#__PURE__*/React.createElement(Paragraph, {
|
|
53
|
+
color: "alerts-secondary-text",
|
|
54
|
+
as: "div"
|
|
55
|
+
}, content.description));
|
|
69
56
|
}
|
|
70
|
-
return /*#__PURE__*/
|
|
57
|
+
return /*#__PURE__*/React.createElement(Paragraph, {
|
|
71
58
|
color: "alerts-primary-text",
|
|
72
|
-
as: "div"
|
|
73
|
-
|
|
74
|
-
});
|
|
59
|
+
as: "div"
|
|
60
|
+
}, content);
|
|
75
61
|
};
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
content: content
|
|
82
|
-
}), (0, _objectSpread2["default"])((0, _objectSpread2["default"])({}, ops), {}, {
|
|
83
|
-
toastId: (0, _hash.hash)(getInnerToastText(content)),
|
|
84
|
-
icon: TypeIcons[(ops === null || ops === void 0 ? void 0 : ops.type) || DEFAULT_TOAST_TYPE],
|
|
85
|
-
autoClose: (ops === null || ops === void 0 ? void 0 : ops.duration) === null ? false : ops === null || ops === void 0 ? void 0 : ops.duration
|
|
86
|
-
}));
|
|
62
|
+
const useToast = defaultOptions => {
|
|
63
|
+
const showToastFn = useMemo(() => (content, options) => {
|
|
64
|
+
const ops = {
|
|
65
|
+
...defaultOptions,
|
|
66
|
+
...options
|
|
87
67
|
};
|
|
68
|
+
launchToast( /*#__PURE__*/React.createElement(ToastContentWrapper, {
|
|
69
|
+
content: content
|
|
70
|
+
}), {
|
|
71
|
+
...ops,
|
|
72
|
+
toastId: hash(getInnerToastText(content)),
|
|
73
|
+
icon: TypeIcons[(ops === null || ops === void 0 ? void 0 : ops.type) || DEFAULT_TOAST_TYPE],
|
|
74
|
+
autoClose: (ops === null || ops === void 0 ? void 0 : ops.duration) === null ? false : ops === null || ops === void 0 ? void 0 : ops.duration
|
|
75
|
+
});
|
|
88
76
|
}, [defaultOptions]);
|
|
89
77
|
return showToastFn;
|
|
90
78
|
};
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
})
|
|
100
|
-
});
|
|
101
|
-
};
|
|
79
|
+
const ToastContainer = () => /*#__PURE__*/React.createElement(StyledToastContainer, null, /*#__PURE__*/React.createElement(ToastifyContainer, {
|
|
80
|
+
position: "bottom-right",
|
|
81
|
+
autoClose: 3000,
|
|
82
|
+
hideProgressBar: true,
|
|
83
|
+
newestOnTop: true,
|
|
84
|
+
pauseOnHover: true
|
|
85
|
+
}));
|
|
86
|
+
export { useToast, ToastContainer };
|
package/lib/Toast/index.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _Toast = require("./Toast");
|
|
7
|
-
Object.keys(_Toast).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _Toast[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _Toast[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
1
|
+
export * from './Toast';
|
package/lib/Toast/styles.js
CHANGED
|
@@ -1,53 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
Object.defineProperty(exports, "__esModule", {
|
|
5
|
-
value: true
|
|
6
|
-
});
|
|
7
|
-
exports.StyledToastContainer = void 0;
|
|
8
|
-
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
-
var StyledToastContainer = exports.StyledToastContainer = /*#__PURE__*/(0, _base["default"])("div", process.env.NODE_ENV === "production" ? {
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
export const StyledToastContainer = /*#__PURE__*/_styled("div", process.env.NODE_ENV === "production" ? {
|
|
10
3
|
target: "e1250ir80"
|
|
11
4
|
} : {
|
|
12
5
|
target: "e1250ir80",
|
|
13
6
|
label: "codacy"
|
|
14
|
-
})(".Toastify__toast-container{width:30rem;}.Toastify__close-button{color:",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, ";
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, ";border-left:",
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
}, ";border-left:",
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}, ";}.Toastify__toast--warning{background-color:", function (_ref10) {
|
|
42
|
-
var theme = _ref10.theme;
|
|
43
|
-
return theme.colors['alerts-warning-background'];
|
|
44
|
-
}, ";border-left:", function (_ref11) {
|
|
45
|
-
var theme = _ref11.theme;
|
|
46
|
-
return "".concat(theme.borderWidths[2], " solid ").concat(theme.colors['alerts-warning-border']);
|
|
47
|
-
}, ";}.Toastify__toast--error{background-color:", function (_ref12) {
|
|
48
|
-
var theme = _ref12.theme;
|
|
49
|
-
return theme.colors['alerts-danger-background'];
|
|
50
|
-
}, ";border-left:", function (_ref13) {
|
|
51
|
-
var theme = _ref13.theme;
|
|
52
|
-
return "".concat(theme.borderWidths[2], " solid ").concat(theme.colors['alerts-danger-border']);
|
|
53
|
-
}, ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Ub2FzdC9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRXVFIiwiZmlsZSI6Ii4uLy4uL3NyYy9Ub2FzdC9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCd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SA9PiB0aGVtZS5jb2xvcnNbJ2FsZXJ0cy1kYW5nZXItYmFja2dyb3VuZCddfTtcbiAgICBib3JkZXItbGVmdDogJHsoeyB0aGVtZSB9KSA9PiBgJHt0aGVtZS5ib3JkZXJXaWR0aHNbMl19IHNvbGlkICR7dGhlbWUuY29sb3JzWydhbGVydHMtZGFuZ2VyLWJvcmRlciddfWB9O1xuICB9XG5gXG4iXX0= */"));
|
|
7
|
+
})(".Toastify__toast-container{width:30rem;}.Toastify__close-button{color:", ({
|
|
8
|
+
theme
|
|
9
|
+
}) => theme.colors['alerts-primary-icon'], ";}.Toastify__toast{font-family:", ({
|
|
10
|
+
theme
|
|
11
|
+
}) => theme.fonts.normal, ";box-shadow:", ({
|
|
12
|
+
theme
|
|
13
|
+
}) => theme.shadows[1], ";}.Toastify__toast-body{align-items:flex-start;}.Toastify__toast--default{background-color:", ({
|
|
14
|
+
theme
|
|
15
|
+
}) => theme.colors['alerts-success-background'], ";border-left:", ({
|
|
16
|
+
theme
|
|
17
|
+
}) => `${theme.borderWidths[2]} solid ${theme.colors['alerts-success-border']}`, ";}.Toastify__toast--info{background-color:", ({
|
|
18
|
+
theme
|
|
19
|
+
}) => theme.colors['alerts-info-background'], ";border-left:", ({
|
|
20
|
+
theme
|
|
21
|
+
}) => `${theme.borderWidths[2]} solid ${theme.colors['alerts-info-border']}`, ";}.Toastify__toast--success{background-color:", ({
|
|
22
|
+
theme
|
|
23
|
+
}) => theme.colors['alerts-success-background'], ";border-left:", ({
|
|
24
|
+
theme
|
|
25
|
+
}) => `${theme.borderWidths[2]} solid ${theme.colors['alerts-success-border']}`, ";}.Toastify__toast--warning{background-color:", ({
|
|
26
|
+
theme
|
|
27
|
+
}) => theme.colors['alerts-warning-background'], ";border-left:", ({
|
|
28
|
+
theme
|
|
29
|
+
}) => `${theme.borderWidths[2]} solid ${theme.colors['alerts-warning-border']}`, ";}.Toastify__toast--error{background-color:", ({
|
|
30
|
+
theme
|
|
31
|
+
}) => theme.colors['alerts-danger-background'], ";border-left:", ({
|
|
32
|
+
theme
|
|
33
|
+
}) => `${theme.borderWidths[2]} solid ${theme.colors['alerts-danger-border']}`, ";}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Ub2FzdC9zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRXVFIiwiZmlsZSI6Ii4uLy4uL3NyYy9Ub2FzdC9zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcblxuZXhwb3J0IGNvbnN0IFN0eWxlZFRvYXN0Q29udGFpbmVyID0gc3R5bGVkLmRpdjxSZWNvcmQ8c3RyaW5nLCB1bmtub3duPj5gXG4gIC8qKiBVc2VkIHRvIGRlZmluZSBjb250YWluZXIgYmVoYXZpb3I6IHdpZHRoLCBwb3NpdGlvbjogZml4ZWQgZXRjLi4uICoqL1xuICAuVG9hc3RpZnlfX3RvYXN0LWNvbnRhaW5lciB7XG4gICAgd2lkdGg6IDMwcmVtO1xuICB9XG4gIC5Ub2FzdGlmeV9fY2xvc2UtYnV0dG9uIHtcbiAgICBjb2xvcjogJHsoeyB0aGVtZSB9KSA9PiB0aGVtZS5jb2xvcnNbJ2FsZXJ0cy1wcmltYXJ5LWljb24nXX07XG4gIH1cblxuICAvKiogQ2xhc3NlcyBmb3IgdGhlIGRpc3BsYXllZCB0b2FzdCAqKi9cbiAgLlRvYXN0aWZ5X190b2FzdCB7XG4gICAgZm9udC1mYW1pbHk6ICR7KHsgdGhlbWUgfSkgPT4gdGhlbWUuZm9udHMubm9ybWFsfTtcbiAgICBib3gtc2hhZG93OiAkeyh7IHRoZW1lIH0pID0+IHRoZW1lLnNoYWRvd3NbMV19O1xuICB9XG5cbiAgLlRvYXN0aWZ5X190b2FzdC1ib2R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uVG9hc3RpZnlfX3RvYXN0LS13YXJuaW5nIHtcbiAgICBiYWNrZ3JvdW5kLWNvbG9yOiAkeyh7IHRoZW1lIH0pID0+IHRoZW1lLmNvbG9yc1snYWxlcnRzLXdhcm5pbmctYmFja2dyb3VuZCddfTtcbiAgICBib3JkZXItbGVmdDogJHsoeyB0aGVtZSB9KSA9PiBgJHt0aGVtZS5ib3JkZXJXaWR0aHNbMl19IHNvbGlkICR7dGhlbWUuY29sb3JzWydhbGVydHMtd2FybmluZy1ib3JkZXInXX1gfTtcbiAgfVxuICAuVG9hc3RpZnlfX3RvYXN0LS1lcnJvciB7XG4gICAgYmFja2dyb3VuZC1jb2xvcjogJHsoeyB0aGVtZSB9KSA9PiB0aGVtZS5jb2xvcnNbJ2FsZXJ0cy1kYW5nZXItYmFja2dyb3VuZCddfTtcbiAgICBib3JkZXItbGVmdDogJHsoeyB0aGVtZSB9KSA9PiBgJHt0aGVtZS5ib3JkZXJXaWR0aHNbMl19IHNvbGlkICR7dGhlbWUuY29sb3JzWydhbGVydHMtZGFuZ2VyLWJvcmRlciddfWB9O1xuICB9XG5gXG4iXX0= */"));
|
package/lib/Toast/types.js
CHANGED
package/lib/Toggle/Toggle.js
CHANGED
|
@@ -1,77 +1,60 @@
|
|
|
1
|
-
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { HiddenCheckboxInput, ToggleSwitch, ToggleHandler, LabelWrap } from './styles';
|
|
4
|
+
import { Paragraph, Icon, CheckIcon, CloseIcon } from '../';
|
|
5
|
+
import { useCallback } from 'react';
|
|
2
6
|
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
-
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard")["default"];
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.Toggle = void 0;
|
|
9
|
-
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
10
|
-
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _styles = require("./styles");
|
|
13
|
-
var _ = require("../");
|
|
14
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["children", "id", "disabled", "name", "size", "value", "checked", "inline", "onChange", "onFocus", "onBlur"];
|
|
16
7
|
/**
|
|
17
8
|
* Basic Toggle
|
|
18
9
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var handleChange = function handleChange() {
|
|
10
|
+
const Toggle = ({
|
|
11
|
+
children,
|
|
12
|
+
id,
|
|
13
|
+
disabled,
|
|
14
|
+
name,
|
|
15
|
+
size = 'md',
|
|
16
|
+
value,
|
|
17
|
+
checked = false,
|
|
18
|
+
inline,
|
|
19
|
+
onChange,
|
|
20
|
+
onFocus,
|
|
21
|
+
onBlur,
|
|
22
|
+
...props
|
|
23
|
+
}) => {
|
|
24
|
+
const isIndeterminate = checked === 'indeterminate';
|
|
25
|
+
const isChecked = !isIndeterminate && !!checked;
|
|
26
|
+
const handleChange = () => {
|
|
37
27
|
if (!!onChange && !disabled) {
|
|
38
28
|
onChange(!checked, name, value);
|
|
39
29
|
}
|
|
40
30
|
};
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}, []);
|
|
44
|
-
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styles.LabelWrap, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
31
|
+
const wrapperClickHandler = useCallback(e => e.stopPropagation(), []);
|
|
32
|
+
return /*#__PURE__*/React.createElement(LabelWrap, _extends({
|
|
45
33
|
inline: inline,
|
|
46
34
|
disabled: disabled,
|
|
47
35
|
as: 'label',
|
|
48
36
|
onClick: wrapperClickHandler
|
|
49
|
-
}, props),
|
|
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
|
-
};
|
|
37
|
+
}, props), children && /*#__PURE__*/React.createElement(Paragraph, {
|
|
38
|
+
size: size,
|
|
39
|
+
mr: 4
|
|
40
|
+
}, children), /*#__PURE__*/React.createElement(HiddenCheckboxInput, {
|
|
41
|
+
type: "checkbox",
|
|
42
|
+
id: id,
|
|
43
|
+
disabled: disabled,
|
|
44
|
+
name: name,
|
|
45
|
+
value: !!value ? value : undefined,
|
|
46
|
+
checked: isChecked,
|
|
47
|
+
onFocus: onFocus,
|
|
48
|
+
onBlur: onBlur,
|
|
49
|
+
onChange: handleChange
|
|
50
|
+
}), /*#__PURE__*/React.createElement(ToggleSwitch, {
|
|
51
|
+
checked: checked,
|
|
52
|
+
size: size
|
|
53
|
+
}, /*#__PURE__*/React.createElement(ToggleHandler, null, !isIndeterminate && /*#__PURE__*/React.createElement(Icon, {
|
|
54
|
+
icon: isChecked ? CheckIcon : CloseIcon,
|
|
55
|
+
color: 'icon-subtle-inverted',
|
|
56
|
+
size: size === 'md' ? 'sm' : 'xs',
|
|
57
|
+
bold: true
|
|
58
|
+
}))));
|
|
59
|
+
};
|
|
60
|
+
export { Toggle };
|
package/lib/Toggle/index.js
CHANGED
|
@@ -1,16 +1 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
var _Toggle = require("./Toggle");
|
|
7
|
-
Object.keys(_Toggle).forEach(function (key) {
|
|
8
|
-
if (key === "default" || key === "__esModule") return;
|
|
9
|
-
if (key in exports && exports[key] === _Toggle[key]) return;
|
|
10
|
-
Object.defineProperty(exports, key, {
|
|
11
|
-
enumerable: true,
|
|
12
|
-
get: function get() {
|
|
13
|
-
return _Toggle[key];
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
});
|
|
1
|
+
export * from './Toggle';
|
package/lib/Toggle/styles.d.ts
CHANGED
|
@@ -15,7 +15,7 @@ export declare const LabelWrap: import("@emotion/styled").StyledComponent<{
|
|
|
15
15
|
fontWeight?: import("styled-system").ResponsiveValue<number | import("../theme").FontWeights, import("../theme").CodacyTheme> | undefined;
|
|
16
16
|
} & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
17
17
|
theme?: import("@emotion/react").Theme | undefined;
|
|
18
|
-
} & import("..").FlexboxProps & import("..").GridboxProps & Pick<ToggleProps, "
|
|
18
|
+
} & import("..").FlexboxProps & import("..").GridboxProps & Pick<ToggleProps, "disabled" | "size" | "inline">, {}, {}>;
|
|
19
19
|
export declare const ToggleSwitch: import("@emotion/styled").StyledComponent<{
|
|
20
20
|
theme?: import("@emotion/react").Theme | undefined;
|
|
21
21
|
as?: import("react").ElementType<any> | undefined;
|