@codacy/ui-components 0.62.0 → 0.62.2
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/Dropdown/Dropdown.js +1 -1
- package/lib/Dropdown/Dropdown.types.d.ts +2 -2
- package/lib/Input/Input.js +1 -1
- package/lib/Input/types.d.ts +2 -1
- package/lib/Labeled/Labeled.js +1 -1
- package/lib/Labeled/types.d.ts +2 -1
- package/lib/MoreInfo/MoreInfo.js +3 -3
- package/lib/MoreInfo/types.d.ts +2 -3
- package/lib/TagsInput/types.d.ts +2 -1
- package/lib/Textarea/Textarea.js +1 -1
- package/lib/Textarea/Textarea.types.d.ts +2 -1
- package/package.json +1 -1
package/lib/Dropdown/Dropdown.js
CHANGED
|
@@ -84,7 +84,7 @@ export var Dropdown = function Dropdown(_ref) {
|
|
|
84
84
|
}, attributes.popper, {
|
|
85
85
|
size: size
|
|
86
86
|
}), children);
|
|
87
|
-
var containerElement = portal && document.querySelector('body');
|
|
87
|
+
var containerElement = portal && document.querySelector(portal === true ? 'body' : portal);
|
|
88
88
|
return /*#__PURE__*/React.createElement(DropdownContext.Provider, {
|
|
89
89
|
value: {
|
|
90
90
|
open: open,
|
|
@@ -6,7 +6,7 @@ import { Size } from '../theme';
|
|
|
6
6
|
import { InputProps } from '../Input/types';
|
|
7
7
|
import { BoxProps } from '../Flexbox';
|
|
8
8
|
export declare type DropdownPanelAlignment = 'left' | 'right';
|
|
9
|
-
export declare type DropdownValueType =
|
|
9
|
+
export declare type DropdownValueType = Record<symbol | string | number, unknown> | number | string | null;
|
|
10
10
|
export interface DropdownProps extends ContainerComponentProps, SpaceProps {
|
|
11
11
|
/** The content of the dropdown button */
|
|
12
12
|
trigger: React.ReactElement;
|
|
@@ -19,7 +19,7 @@ export interface DropdownProps extends ContainerComponentProps, SpaceProps {
|
|
|
19
19
|
/** Initial selected value on start */
|
|
20
20
|
initialValue?: DropdownValueType;
|
|
21
21
|
/** Adds the panel object to a portal on the document's root; useful for dropdowns to be shown in a different context like an iframe. */
|
|
22
|
-
portal?: boolean;
|
|
22
|
+
portal?: boolean | string;
|
|
23
23
|
/** Callback to run when opening the dropdown */
|
|
24
24
|
onOpen?: () => void;
|
|
25
25
|
/** Callback to run when closing the dropdown */
|
package/lib/Input/Input.js
CHANGED
|
@@ -125,7 +125,7 @@ var Input = React.forwardRef(function (_ref2, ref) {
|
|
|
125
125
|
onClick: !disabled ? onClick : undefined
|
|
126
126
|
})), !label && moreInfo && /*#__PURE__*/React.createElement(MoreInfo, {
|
|
127
127
|
ml: 2,
|
|
128
|
-
|
|
128
|
+
helpContent: moreInfo,
|
|
129
129
|
textAlignment: "center"
|
|
130
130
|
})), help && !hasError && /*#__PURE__*/React.createElement(InputHelp, {
|
|
131
131
|
id: "help-".concat(id)
|
package/lib/Input/types.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { ControlProps } from '../types';
|
|
|
3
3
|
import { Size } from '../theme';
|
|
4
4
|
import { SpaceProps } from '../system-props/types';
|
|
5
5
|
import { IconProps, IconFile } from '../Icon/Icon.types';
|
|
6
|
+
import { MoreInfoProps } from '../MoreInfo/types';
|
|
6
7
|
export declare type InputType = 'text' | 'email' | 'password' | 'number' | 'search' | 'tel' | 'url' | 'date';
|
|
7
8
|
export interface InputProps extends ControlProps, SpaceProps {
|
|
8
9
|
/** Display input as a required input field */
|
|
@@ -14,7 +15,7 @@ export interface InputProps extends ControlProps, SpaceProps {
|
|
|
14
15
|
/** The label of the input */
|
|
15
16
|
label?: string;
|
|
16
17
|
/** Display an information icon next to the input */
|
|
17
|
-
moreInfo?:
|
|
18
|
+
moreInfo?: MoreInfoProps['helpContent'];
|
|
18
19
|
/** Specifies the maximum number of character for an input field */
|
|
19
20
|
maxLength?: number;
|
|
20
21
|
/** Type of input */
|
package/lib/Labeled/Labeled.js
CHANGED
|
@@ -23,7 +23,7 @@ export var Labeled = function Labeled(_ref) {
|
|
|
23
23
|
htmlFor: forId
|
|
24
24
|
}, label, !required && /*#__PURE__*/React.createElement(Optional, null, "(optional)"), moreInfo && /*#__PURE__*/React.createElement(MoreInfo, {
|
|
25
25
|
ml: 2,
|
|
26
|
-
|
|
26
|
+
helpContent: moreInfo,
|
|
27
27
|
textAlignment: "center"
|
|
28
28
|
})), children);
|
|
29
29
|
};
|
package/lib/Labeled/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ContainerComponentProps } from '../types';
|
|
2
2
|
import { SpaceProps } from '../system-props/types';
|
|
3
3
|
import { Size } from '../theme';
|
|
4
|
+
import { MoreInfoProps } from '../MoreInfo/types';
|
|
4
5
|
export interface LabeledProps extends ContainerComponentProps, SpaceProps {
|
|
5
6
|
/** Is this control required? */
|
|
6
7
|
required?: boolean;
|
|
@@ -11,5 +12,5 @@ export interface LabeledProps extends ContainerComponentProps, SpaceProps {
|
|
|
11
12
|
/** ID of the associated component */
|
|
12
13
|
forId?: string;
|
|
13
14
|
/** Display an information icon next to the label */
|
|
14
|
-
moreInfo?:
|
|
15
|
+
moreInfo?: MoreInfoProps['helpContent'];
|
|
15
16
|
}
|
package/lib/MoreInfo/MoreInfo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["
|
|
2
|
+
var _excluded = ["helpContent", "textAlignment", "placement"];
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { Tooltip } from '../Tooltip';
|
|
5
5
|
import { Icon } from '..';
|
|
@@ -31,13 +31,13 @@ var HelpIcon = function HelpIcon() {
|
|
|
31
31
|
|
|
32
32
|
|
|
33
33
|
var MoreInfo = function MoreInfo(_ref) {
|
|
34
|
-
var
|
|
34
|
+
var helpContent = _ref.helpContent,
|
|
35
35
|
textAlignment = _ref.textAlignment,
|
|
36
36
|
placement = _ref.placement,
|
|
37
37
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
38
38
|
|
|
39
39
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
40
|
-
content:
|
|
40
|
+
content: helpContent,
|
|
41
41
|
textAlignment: textAlignment,
|
|
42
42
|
placement: placement
|
|
43
43
|
}, /*#__PURE__*/React.createElement(Icon, Object.assign({
|
package/lib/MoreInfo/types.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { TooltipPositionProps } from '../Tooltip/types';
|
|
1
|
+
import { TooltipContentProps, TooltipPositionProps } from '../Tooltip/types';
|
|
2
2
|
import { IconProps } from '../Icon/Icon.types';
|
|
3
3
|
export interface MoreInfoProps extends TooltipPositionProps, Omit<IconProps, 'icon'> {
|
|
4
|
-
|
|
5
|
-
title: string;
|
|
4
|
+
helpContent: TooltipContentProps['content'];
|
|
6
5
|
}
|
package/lib/TagsInput/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
import { MoreInfoProps } from '../MoreInfo/types';
|
|
2
3
|
import { Size } from '../theme';
|
|
3
4
|
import { ComponentProps } from '../types';
|
|
4
5
|
declare type Tags = string[];
|
|
@@ -9,7 +10,7 @@ export interface TagsInputProps extends ComponentProps {
|
|
|
9
10
|
required?: boolean;
|
|
10
11
|
label?: string;
|
|
11
12
|
size?: Size;
|
|
12
|
-
moreInfo?:
|
|
13
|
+
moreInfo?: MoreInfoProps['helpContent'];
|
|
13
14
|
}
|
|
14
15
|
export interface TagsInputPropsState extends TagsInputProps {
|
|
15
16
|
setTags: (tag: React.SetStateAction<string[]>) => void;
|
package/lib/Textarea/Textarea.js
CHANGED
|
@@ -54,7 +54,7 @@ export var Textarea = function Textarea(_ref) {
|
|
|
54
54
|
icon: ErrorIcon
|
|
55
55
|
})), !label && moreInfo && /*#__PURE__*/React.createElement(MoreInfo, {
|
|
56
56
|
ml: 2,
|
|
57
|
-
|
|
57
|
+
helpContent: moreInfo
|
|
58
58
|
})), help && !hasError && /*#__PURE__*/React.createElement(TextareaHelp, {
|
|
59
59
|
id: "help-".concat(id)
|
|
60
60
|
}, help), hasError && /*#__PURE__*/React.createElement(TextareaErrorMessage, {
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { ControlProps } from '../types';
|
|
3
3
|
import { SpaceProps } from '../system-props/types';
|
|
4
4
|
import { Size } from '../theme';
|
|
5
|
+
import { MoreInfoProps } from '../MoreInfo/types';
|
|
5
6
|
export interface TextareaProps extends ControlProps, SpaceProps {
|
|
6
7
|
/** Display input as a required input field */
|
|
7
8
|
required?: boolean;
|
|
@@ -12,7 +13,7 @@ export interface TextareaProps extends ControlProps, SpaceProps {
|
|
|
12
13
|
/** The label of the input */
|
|
13
14
|
label?: string;
|
|
14
15
|
/** Display an information icon next to the input */
|
|
15
|
-
moreInfo?:
|
|
16
|
+
moreInfo?: MoreInfoProps['helpContent'];
|
|
16
17
|
/** Specifies the maximum number of character for an input field */
|
|
17
18
|
maxLength?: number;
|
|
18
19
|
/** Size of input */
|