@codacy/ui-components 0.64.1 → 0.64.3
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/Checkbox/Checkbox.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
-
var _excluded = ["icon", "toRight", "children", "iconProps"];
|
|
2
|
+
var _excluded = ["icon", "toRight", "children", "iconProps", "textProps"];
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import { IconAndTextWrapper } from './IconAndText.styles';
|
|
5
5
|
import { Icon } from '../Icon';
|
|
6
|
+
import { Caption } from '../Typography';
|
|
6
7
|
/**
|
|
7
8
|
* Description for IconAndText
|
|
8
9
|
*/
|
|
@@ -13,6 +14,7 @@ export var IconAndText = React.forwardRef(function (_ref, ref) {
|
|
|
13
14
|
toRight = _ref$toRight === void 0 ? false : _ref$toRight,
|
|
14
15
|
children = _ref.children,
|
|
15
16
|
iconProps = _ref.iconProps,
|
|
17
|
+
textProps = _ref.textProps,
|
|
16
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
17
19
|
|
|
18
20
|
return /*#__PURE__*/React.createElement(IconAndTextWrapper, Object.assign({
|
|
@@ -20,6 +22,7 @@ export var IconAndText = React.forwardRef(function (_ref, ref) {
|
|
|
20
22
|
}, props, {
|
|
21
23
|
ref: ref
|
|
22
24
|
}), /*#__PURE__*/React.createElement(Icon, Object.assign({
|
|
23
|
-
icon: icon
|
|
24
|
-
|
|
25
|
+
icon: icon,
|
|
26
|
+
size: (iconProps === null || iconProps === void 0 ? void 0 : iconProps.size) || (textProps === null || textProps === void 0 ? void 0 : textProps.size)
|
|
27
|
+
}, iconProps)), textProps ? /*#__PURE__*/React.createElement(Caption, textProps, children) : /*#__PURE__*/React.createElement("span", null, children));
|
|
25
28
|
});
|
|
@@ -2,8 +2,10 @@
|
|
|
2
2
|
import { ContainerComponentProps } from '../types';
|
|
3
3
|
import { SpaceProps } from '../system-props/types';
|
|
4
4
|
import { IconProps } from '../Icon/Icon.types';
|
|
5
|
+
import { BaseTextProps } from '../Typography';
|
|
5
6
|
export interface IconAndTextProps extends ContainerComponentProps, SpaceProps {
|
|
6
7
|
icon: React.FunctionComponent<React.SVGProps<SVGSVGElement>>;
|
|
7
8
|
toRight?: boolean;
|
|
8
9
|
iconProps?: Pick<IconProps, 'scale' | 'spin' | 'easedSpin' | 'color' | 'title' | 'size'>;
|
|
10
|
+
textProps?: BaseTextProps;
|
|
9
11
|
}
|
|
@@ -12,7 +12,7 @@ export interface SubheaderProps extends ContainerComponentProps, BoxProps {
|
|
|
12
12
|
color?: TextColor;
|
|
13
13
|
}
|
|
14
14
|
export declare type TextSize = 'lg' | 'md' | 'sm' | 'xs';
|
|
15
|
-
interface BaseTextProps {
|
|
15
|
+
export interface BaseTextProps {
|
|
16
16
|
size?: TextSize;
|
|
17
17
|
color?: TextColor;
|
|
18
18
|
}
|
|
@@ -35,4 +35,3 @@ export interface DataPointProps extends ContainerComponentProps, Omit<BoxProps,
|
|
|
35
35
|
}
|
|
36
36
|
export interface ListProps extends ContainerComponentProps, Omit<BoxProps, 'size'>, BaseTextProps {
|
|
37
37
|
}
|
|
38
|
-
export {};
|