@codacy/ui-components 0.66.40 → 0.66.42
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/Orb/Orb.d.ts +4 -0
- package/lib/Orb/Orb.js +36 -0
- package/lib/Orb/index.d.ts +3 -0
- package/lib/Orb/index.js +3 -0
- package/lib/Orb/styles.d.ts +10 -0
- package/lib/Orb/styles.js +17 -0
- package/lib/Orb/types.d.ts +15 -0
- package/lib/Orb/types.js +1 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +2 -1
- package/package.json +1 -1
package/lib/Orb/Orb.d.ts
ADDED
package/lib/Orb/Orb.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
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 { Icon } from '../Icon';
|
|
4
|
+
import { Tooltip } from '../Tooltip';
|
|
5
|
+
import { DataPoint } from '../Typography';
|
|
6
|
+
import { OrbWrapper } from './styles';
|
|
7
|
+
export const Orb = ({
|
|
8
|
+
type,
|
|
9
|
+
icon,
|
|
10
|
+
dataPointValue,
|
|
11
|
+
dataPointColor,
|
|
12
|
+
dataPointSize,
|
|
13
|
+
tooltipContent,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
const OrbContent = () => {
|
|
17
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, icon && /*#__PURE__*/React.createElement(Icon, {
|
|
18
|
+
icon: icon,
|
|
19
|
+
color: type === 'default' ? 'icon-enabled' : `icon-${type}`
|
|
20
|
+
}), dataPointValue && /*#__PURE__*/React.createElement(DataPoint, {
|
|
21
|
+
value: dataPointValue,
|
|
22
|
+
color: dataPointColor,
|
|
23
|
+
size: dataPointSize
|
|
24
|
+
}));
|
|
25
|
+
};
|
|
26
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, tooltipContent ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
27
|
+
content: tooltipContent,
|
|
28
|
+
portal: true
|
|
29
|
+
}, /*#__PURE__*/React.createElement(OrbWrapper, _extends({
|
|
30
|
+
type: type
|
|
31
|
+
}, props, {
|
|
32
|
+
id: "orb"
|
|
33
|
+
}), /*#__PURE__*/React.createElement(OrbContent, null))) : /*#__PURE__*/React.createElement(OrbWrapper, _extends({
|
|
34
|
+
type: type
|
|
35
|
+
}, props), /*#__PURE__*/React.createElement(OrbContent, null)));
|
|
36
|
+
};
|
package/lib/Orb/index.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { OrbWrapperProps } from './types';
|
|
3
|
+
export declare const OrbWrapper: import("@emotion/styled").StyledComponent<{
|
|
4
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
5
|
+
as?: import("react").ElementType<any> | undefined;
|
|
6
|
+
} & import("..").ColorProps & Omit<import("..").LayoutProps, "size"> & import("..").SpaceProps & import("..").BorderProps & import("..").PositionProps & import("..").ShadowProps & import("..").TextAlignProps & Omit<import("..").TypographyProps, "fontWeight"> & import("../Flexbox").As & {
|
|
7
|
+
fontWeight?: import("styled-system").ResponsiveValue<number | import("../theme").FontWeights, import("../theme").CodacyTheme> | undefined;
|
|
8
|
+
} & import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
|
|
9
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
10
|
+
} & import("..").FlexboxProps & OrbWrapperProps, {}, {}>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import _styled from "@emotion/styled/base";
|
|
2
|
+
import { Flex } from '../Flexbox';
|
|
3
|
+
export const OrbWrapper = /*#__PURE__*/_styled(Flex, process.env.NODE_ENV === "production" ? {
|
|
4
|
+
target: "e19rotow0"
|
|
5
|
+
} : {
|
|
6
|
+
target: "e19rotow0",
|
|
7
|
+
label: "codacy"
|
|
8
|
+
})("width:", ({
|
|
9
|
+
theme,
|
|
10
|
+
...props
|
|
11
|
+
}) => props.width || theme.space[6], ";height:", ({
|
|
12
|
+
theme,
|
|
13
|
+
...props
|
|
14
|
+
}) => props.height || theme.space[6], ";border-radius:100%;justify-content:center;align-items:center;background-color:", ({
|
|
15
|
+
theme,
|
|
16
|
+
type
|
|
17
|
+
}) => theme.colors[type === 'default' ? 'label-default-background' : `background-${type}`], ";svg{pointer-events:none;}" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9PcmIvc3R5bGVzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUt1RCIsImZpbGUiOiIuLi8uLi9zcmMvT3JiL3N0eWxlcy50cyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCBzdHlsZWQgZnJvbSAnQGVtb3Rpb24vc3R5bGVkJ1xuaW1wb3J0IHsgRmxleCB9IGZyb20gJy4uL0ZsZXhib3gnXG5pbXBvcnQgeyBBbGxDb2xvcnNLZXlzIH0gZnJvbSAnLi4vdGhlbWUnXG5pbXBvcnQgeyBPcmJXcmFwcGVyUHJvcHMgfSBmcm9tICcuL3R5cGVzJ1xuXG5leHBvcnQgY29uc3QgT3JiV3JhcHBlciA9IHN0eWxlZChGbGV4KTxPcmJXcmFwcGVyUHJvcHM+YFxuICB3aWR0aDogJHsoeyB0aGVtZSwgLi4ucHJvcHMgfSkgPT4gcHJvcHMud2lkdGggfHwgdGhlbWUuc3BhY2VbNl19O1xuICBoZWlnaHQ6ICR7KHsgdGhlbWUsIC4uLnByb3BzIH0pID0+IHByb3BzLmhlaWdodCB8fCB0aGVtZS5zcGFjZVs2XX07XG4gIGJvcmRlci1yYWRpdXM6IDEwMCU7XG4gIGp1c3RpZnktY29udGVudDogY2VudGVyO1xuICBhbGlnbi1pdGVtczogY2VudGVyO1xuXG4gIGJhY2tncm91bmQtY29sb3I6ICR7KHsgdGhlbWUsIHR5cGUgfSkgPT5cbiAgICB0aGVtZS5jb2xvcnNbdHlwZSA9PT0gJ2RlZmF1bHQnID8gJ2xhYmVsLWRlZmF1bHQtYmFja2dyb3VuZCcgOiAoYGJhY2tncm91bmQtJHt0eXBlfWAgYXMgQWxsQ29sb3JzS2V5cyldfTtcblxuICBzdmcge1xuICAgIHBvaW50ZXItZXZlbnRzOiBub25lO1xuICB9XG5gXG4iXX0= */"));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactChild } from 'react';
|
|
2
|
+
import { IconFile } from '../Icon';
|
|
3
|
+
import { DataPointProps } from '../Typography';
|
|
4
|
+
export declare type OrbType = 'info' | 'success' | 'danger' | 'warning' | 'default';
|
|
5
|
+
export interface OrbWrapperProps {
|
|
6
|
+
type: OrbType;
|
|
7
|
+
}
|
|
8
|
+
export interface OrbProps {
|
|
9
|
+
type: OrbType;
|
|
10
|
+
icon?: IconFile;
|
|
11
|
+
dataPointValue?: DataPointProps['value'];
|
|
12
|
+
dataPointColor?: DataPointProps['color'];
|
|
13
|
+
dataPointSize?: DataPointProps['size'];
|
|
14
|
+
tooltipContent?: ReactChild;
|
|
15
|
+
}
|
package/lib/Orb/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED