@codacy/ui-components 0.66.2 → 0.66.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.
|
@@ -3,7 +3,7 @@ import { ParagraphProps } from '../Typography/Typography.types';
|
|
|
3
3
|
import { SpaceProps } from '../system-props/types';
|
|
4
4
|
import { ContainerComponentProps } from '../types';
|
|
5
5
|
export declare type InlineMessageStatus = 'success' | 'info' | 'warning' | 'error';
|
|
6
|
-
export interface InlineMessageProps extends ContainerComponentProps, SpaceProps,
|
|
6
|
+
export interface InlineMessageProps extends ContainerComponentProps, SpaceProps, ParagraphProps {
|
|
7
7
|
/** Status of message */
|
|
8
8
|
status: InlineMessageStatus;
|
|
9
9
|
toRight?: boolean;
|
|
@@ -12,7 +12,7 @@ var _PillLabel = require("./PillLabel.styles");
|
|
|
12
12
|
var _Icon = require("../Icon");
|
|
13
13
|
var _Flexbox = require("../Flexbox");
|
|
14
14
|
var _jsxRuntime = require("react/jsx-runtime");
|
|
15
|
-
var _excluded = ["children", "status", "inline", "size", "rightIcon", "leftIcon"];
|
|
15
|
+
var _excluded = ["children", "status", "invert", "inline", "size", "rightIcon", "leftIcon"];
|
|
16
16
|
/**
|
|
17
17
|
* PillLabel Banner
|
|
18
18
|
*/
|
|
@@ -20,6 +20,8 @@ var PillLabel = exports.PillLabel = /*#__PURE__*/_react["default"].forwardRef(fu
|
|
|
20
20
|
var children = _ref.children,
|
|
21
21
|
_ref$status = _ref.status,
|
|
22
22
|
status = _ref$status === void 0 ? 'default' : _ref$status,
|
|
23
|
+
_ref$invert = _ref.invert,
|
|
24
|
+
invert = _ref$invert === void 0 ? false : _ref$invert,
|
|
23
25
|
_ref$inline = _ref.inline,
|
|
24
26
|
inline = _ref$inline === void 0 ? true : _ref$inline,
|
|
25
27
|
_ref$size = _ref.size,
|
|
@@ -41,6 +43,7 @@ var PillLabel = exports.PillLabel = /*#__PURE__*/_react["default"].forwardRef(fu
|
|
|
41
43
|
size: size,
|
|
42
44
|
display: inline ? 'inline-block' : 'block'
|
|
43
45
|
}, props), {}, {
|
|
46
|
+
invert: invert,
|
|
44
47
|
ref: ref,
|
|
45
48
|
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Flexbox.Flex, {
|
|
46
49
|
alignItems: "center",
|
|
@@ -42,6 +42,11 @@ var PillLabelWrapper = exports.PillLabelWrapper = /*#__PURE__*/(0, _base["defaul
|
|
|
42
42
|
}, ";", function (_ref8) {
|
|
43
43
|
var _ref8$status = _ref8.status,
|
|
44
44
|
status = _ref8$status === void 0 ? 'default' : _ref8$status,
|
|
45
|
-
theme = _ref8.theme
|
|
46
|
-
|
|
47
|
-
|
|
45
|
+
theme = _ref8.theme,
|
|
46
|
+
invert = _ref8.invert;
|
|
47
|
+
var colors = ["label-".concat(status, "-text"), "label-".concat(status, "-background")];
|
|
48
|
+
if (invert) {
|
|
49
|
+
colors.reverse();
|
|
50
|
+
}
|
|
51
|
+
return "\n color: ".concat(theme.colors[colors[0]], ";\n background-color: ").concat(theme.colors[colors[1]], ";\n ");
|
|
52
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9QaWxsTGFiZWwvUGlsbExhYmVsLnN0eWxlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFPMkQiLCJmaWxlIjoiLi4vLi4vc3JjL1BpbGxMYWJlbC9QaWxsTGFiZWwuc3R5bGVzLnRzIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgUGlsbExhYmVsUHJvcHMgfSBmcm9tICcuL1BpbGxMYWJlbC50eXBlcydcbmltcG9ydCB7IEJveCB9IGZyb20gJy4uL0ZsZXhib3gnXG5pbXBvcnQgeyBJY29uQW5kVGV4dFdyYXBwZXIgfSBmcm9tICcuLi9JY29uQW5kVGV4dC9JY29uQW5kVGV4dC5zdHl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A6ICd4cyddfTtcblxuICAkeyh7IHN0YXR1cyA9ICdkZWZhdWx0JywgdGhlbWUsIGludmVydCB9KSA9PiB7XG4gICAgY29uc3QgY29sb3JzOiBBbGxDb2xvcnNLZXlzW10gPSBbYGxhYmVsLSR7c3RhdHVzfS10ZXh0YCwgYGxhYmVsLSR7c3RhdHVzfS1iYWNrZ3JvdW5kYF1cblxuICAgIGlmIChpbnZlcnQpIHtcbiAgICAgIGNvbG9ycy5yZXZlcnNlKClcbiAgICB9XG5cbiAgICByZXR1cm4gYFxuICAgICAgY29sb3I6ICR7dGhlbWUuY29sb3JzW2NvbG9yc1swXV19O1xuICAgICAgYmFja2dyb3VuZC1jb2xvcjogJHt0aGVtZS5jb2xvcnNbY29sb3JzWzFdXX07XG4gICAgYFxuICB9fVxuYFxuIl19 */"));
|
|
@@ -10,6 +10,8 @@ export interface PillLabelProps extends ContainerComponentProps, SpaceProps, Lay
|
|
|
10
10
|
inline?: boolean;
|
|
11
11
|
/** Size */
|
|
12
12
|
size?: 'md' | 'sm';
|
|
13
|
+
/** Invert color scheme to make darker background and lighter text */
|
|
14
|
+
invert?: boolean;
|
|
13
15
|
/** Left icon */
|
|
14
16
|
leftIcon?: IconFile;
|
|
15
17
|
/** Right icon */
|