@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/Input/Input.js
CHANGED
|
@@ -1,160 +1,132 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
var _Icon = require("../Icon");
|
|
15
|
-
var _Icons = require("../Icons");
|
|
16
|
-
var _jsxRuntime = require("react/jsx-runtime");
|
|
17
|
-
var _excluded = ["id", "disabled", "required", "name", "maxLength", "type", "size", "value", "label", "aria-label", "placeholder", "readOnly", "showClearButton", "help", "hasError", "hasSuccess", "isLoading", "errorMessage", "onChange", "onClick", "onClear", "onFocus", "onBlur", "leftIcon", "rightIcon", "moreInfo", "min", "max", "step"];
|
|
18
|
-
var InputIcon = function InputIcon(_ref) {
|
|
19
|
-
var icon = _ref.icon,
|
|
20
|
-
_ref$toRight = _ref.toRight,
|
|
21
|
-
toRight = _ref$toRight === void 0 ? false : _ref$toRight,
|
|
22
|
-
onClick = _ref.onClick;
|
|
23
|
-
var IconComponent = toRight ? _styles.RightIcon : _styles.LeftIcon;
|
|
24
|
-
return icon.hasOwnProperty('icon') ? /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
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, { useCallback } from 'react';
|
|
3
|
+
import { InputElement, InputHelp, InputErrorMessage, InputContainer, InputWrapper, LeftIcon, RightIcon, RightIcons } from './styles';
|
|
4
|
+
import { MoreInfo, Labeled } from '../';
|
|
5
|
+
import { Icon } from '../Icon';
|
|
6
|
+
import { SpinnerIcon, CloseIcon } from '../Icons';
|
|
7
|
+
const InputIcon = ({
|
|
8
|
+
icon,
|
|
9
|
+
toRight = false,
|
|
10
|
+
onClick
|
|
11
|
+
}) => {
|
|
12
|
+
const IconComponent = toRight ? RightIcon : LeftIcon;
|
|
13
|
+
return icon.hasOwnProperty('icon') ? /*#__PURE__*/React.createElement(IconComponent, {
|
|
25
14
|
isClickable: !!onClick,
|
|
26
|
-
onClick: onClick
|
|
27
|
-
|
|
28
|
-
}) : /*#__PURE__*/(0, _jsxRuntime.jsx)(IconComponent, {
|
|
15
|
+
onClick: onClick
|
|
16
|
+
}, /*#__PURE__*/React.createElement(Icon, icon)) : /*#__PURE__*/React.createElement(IconComponent, {
|
|
29
17
|
isClickable: !!onClick,
|
|
30
|
-
onClick: onClick
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
18
|
+
onClick: onClick
|
|
19
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
20
|
+
icon: icon,
|
|
21
|
+
color: "input-icon-enabled"
|
|
22
|
+
}));
|
|
36
23
|
};
|
|
37
24
|
|
|
38
25
|
/**
|
|
39
26
|
* Basic Input
|
|
40
27
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
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
|
-
onFocus === null || onFocus === void 0 ? void 0 : onFocus(event);
|
|
28
|
+
const Input = /*#__PURE__*/React.forwardRef(({
|
|
29
|
+
id,
|
|
30
|
+
disabled,
|
|
31
|
+
required,
|
|
32
|
+
name,
|
|
33
|
+
maxLength,
|
|
34
|
+
type,
|
|
35
|
+
size,
|
|
36
|
+
value,
|
|
37
|
+
label,
|
|
38
|
+
'aria-label': ariaLabel,
|
|
39
|
+
placeholder,
|
|
40
|
+
readOnly = false,
|
|
41
|
+
showClearButton = false,
|
|
42
|
+
help,
|
|
43
|
+
hasError,
|
|
44
|
+
hasSuccess,
|
|
45
|
+
isLoading,
|
|
46
|
+
errorMessage,
|
|
47
|
+
onChange,
|
|
48
|
+
onClick,
|
|
49
|
+
onClear,
|
|
50
|
+
onFocus,
|
|
51
|
+
onBlur,
|
|
52
|
+
leftIcon,
|
|
53
|
+
rightIcon,
|
|
54
|
+
moreInfo,
|
|
55
|
+
min,
|
|
56
|
+
max,
|
|
57
|
+
step,
|
|
58
|
+
...props
|
|
59
|
+
}, ref) => {
|
|
60
|
+
const handleFocus = useCallback(event => {
|
|
61
|
+
onFocus === null || onFocus === void 0 || onFocus(event);
|
|
76
62
|
}, [onFocus]);
|
|
77
|
-
|
|
78
|
-
onBlur === null || onBlur === void 0
|
|
63
|
+
const handleBlur = useCallback(event => {
|
|
64
|
+
onBlur === null || onBlur === void 0 || onBlur(event);
|
|
79
65
|
}, [onBlur]);
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
textAlignment: "center"
|
|
134
|
-
})]
|
|
135
|
-
}), help && !hasError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.InputHelp, {
|
|
136
|
-
id: "help-".concat(id),
|
|
137
|
-
disabled: disabled,
|
|
138
|
-
children: help
|
|
139
|
-
}), hasError && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styles.InputErrorMessage, {
|
|
140
|
-
id: "error-".concat(id),
|
|
141
|
-
children: errorMessage
|
|
142
|
-
})]
|
|
143
|
-
});
|
|
66
|
+
const content = /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(InputContainer, null, /*#__PURE__*/React.createElement(InputElement, {
|
|
67
|
+
id: id,
|
|
68
|
+
ref: ref,
|
|
69
|
+
name: name,
|
|
70
|
+
value: value === null || value === undefined ? '' : value,
|
|
71
|
+
type: type || 'text',
|
|
72
|
+
maxLength: maxLength,
|
|
73
|
+
disabled: disabled,
|
|
74
|
+
readOnly: readOnly || !onChange,
|
|
75
|
+
placeholder: placeholder,
|
|
76
|
+
required: required,
|
|
77
|
+
"aria-label": ariaLabel || label || undefined,
|
|
78
|
+
"aria-describedby": id && `help-${id}`,
|
|
79
|
+
"aria-errormessage": id && `error-${id}`,
|
|
80
|
+
hasError: hasError,
|
|
81
|
+
hasLeftIcon: !!leftIcon,
|
|
82
|
+
hasRightIcon: !!rightIcon,
|
|
83
|
+
hasClearButton: showClearButton,
|
|
84
|
+
onChange: !disabled ? onChange : undefined,
|
|
85
|
+
onClick: !disabled ? onClick : undefined,
|
|
86
|
+
onFocus: handleFocus,
|
|
87
|
+
onBlur: handleBlur,
|
|
88
|
+
min: min,
|
|
89
|
+
max: max,
|
|
90
|
+
step: step
|
|
91
|
+
}), !!leftIcon && /*#__PURE__*/React.createElement(InputIcon, {
|
|
92
|
+
icon: leftIcon
|
|
93
|
+
}), /*#__PURE__*/React.createElement(RightIcons, null, isLoading && /*#__PURE__*/React.createElement(RightIcon, null, /*#__PURE__*/React.createElement(Icon, {
|
|
94
|
+
icon: SpinnerIcon,
|
|
95
|
+
spin: true,
|
|
96
|
+
color: "input-icon-enabled",
|
|
97
|
+
title: "spinner-icon"
|
|
98
|
+
})), showClearButton && !!value && /*#__PURE__*/React.createElement(RightIcon, {
|
|
99
|
+
isClickable: true,
|
|
100
|
+
onClick: onClear
|
|
101
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
102
|
+
icon: CloseIcon,
|
|
103
|
+
color: "input-icon-enabled",
|
|
104
|
+
title: "close-icon"
|
|
105
|
+
})), !!rightIcon && /*#__PURE__*/React.createElement(InputIcon, {
|
|
106
|
+
icon: rightIcon,
|
|
107
|
+
toRight: true,
|
|
108
|
+
onClick: !disabled ? onClick : undefined
|
|
109
|
+
})), !label && moreInfo && /*#__PURE__*/React.createElement(MoreInfo, {
|
|
110
|
+
ml: 2,
|
|
111
|
+
helpContent: moreInfo,
|
|
112
|
+
textAlignment: "center"
|
|
113
|
+
})), help && !hasError && /*#__PURE__*/React.createElement(InputHelp, {
|
|
114
|
+
id: `help-${id}`,
|
|
115
|
+
disabled: disabled
|
|
116
|
+
}, help), hasError && /*#__PURE__*/React.createElement(InputErrorMessage, {
|
|
117
|
+
id: `error-${id}`
|
|
118
|
+
}, errorMessage));
|
|
144
119
|
if (!!label) {
|
|
145
|
-
return /*#__PURE__*/
|
|
120
|
+
return /*#__PURE__*/React.createElement(Labeled, _extends({
|
|
146
121
|
forId: id,
|
|
147
122
|
moreInfo: moreInfo,
|
|
148
123
|
label: label,
|
|
149
124
|
required: required,
|
|
150
125
|
size: size
|
|
151
|
-
}, props),
|
|
152
|
-
children: content
|
|
153
|
-
}));
|
|
126
|
+
}, props), content);
|
|
154
127
|
}
|
|
155
|
-
return /*#__PURE__*/
|
|
128
|
+
return /*#__PURE__*/React.createElement(InputWrapper, _extends({
|
|
156
129
|
size: size
|
|
157
|
-
}, props),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
});
|
|
130
|
+
}, props), content);
|
|
131
|
+
});
|
|
132
|
+
export { Input };
|