@codacy/ui-components 0.65.69 → 0.65.70
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/Bannerol/Bannerol.d.ts +6 -0
- package/lib/Bannerol/Bannerol.js +70 -0
- package/lib/Bannerol/Bannerol.styles.d.ts +10 -0
- package/lib/Bannerol/Bannerol.styles.js +22 -0
- package/lib/Bannerol/Bannerol.types.d.ts +19 -0
- package/lib/Bannerol/Bannerol.types.js +5 -0
- package/lib/Bannerol/index.d.ts +3 -0
- package/lib/Bannerol/index.js +38 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +11 -0
- package/package.json +2 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.Bannerol = void 0;
|
|
8
|
+
var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectSpread2"));
|
|
9
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/esm/objectWithoutProperties"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var _Bannerol = require("./Bannerol.styles");
|
|
12
|
+
var _Flexbox = require("../Flexbox");
|
|
13
|
+
var _Icon = require("../Icon");
|
|
14
|
+
var _Typography = require("../Typography");
|
|
15
|
+
var _Button = require("../Button");
|
|
16
|
+
var _CloseButton = require("../CloseButton");
|
|
17
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
18
|
+
var _excluded = ["title", "icon", "action", "description", "onDismiss", "variant"];
|
|
19
|
+
/**
|
|
20
|
+
* Description for Bannerol
|
|
21
|
+
*/
|
|
22
|
+
var Bannerol = exports.Bannerol = function Bannerol(_ref) {
|
|
23
|
+
var title = _ref.title,
|
|
24
|
+
icon = _ref.icon,
|
|
25
|
+
action = _ref.action,
|
|
26
|
+
description = _ref.description,
|
|
27
|
+
onDismiss = _ref.onDismiss,
|
|
28
|
+
_ref$variant = _ref.variant,
|
|
29
|
+
variant = _ref$variant === void 0 ? 'info' : _ref$variant,
|
|
30
|
+
props = (0, _objectWithoutProperties2["default"])(_ref, _excluded);
|
|
31
|
+
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Bannerol.StyledBannerol, (0, _objectSpread2["default"])((0, _objectSpread2["default"])({
|
|
32
|
+
variant: variant,
|
|
33
|
+
p: 5,
|
|
34
|
+
width: "100%",
|
|
35
|
+
position: "relative",
|
|
36
|
+
alignItems: "center"
|
|
37
|
+
}, props), {}, {
|
|
38
|
+
children: [icon && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Flexbox.Box, {
|
|
39
|
+
mr: 4,
|
|
40
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_Icon.Icon, {
|
|
41
|
+
icon: icon,
|
|
42
|
+
size: "lg",
|
|
43
|
+
color: "icon-".concat(variant)
|
|
44
|
+
})
|
|
45
|
+
}), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_Flexbox.Box, {
|
|
46
|
+
flex: 1,
|
|
47
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.Subheader, {
|
|
48
|
+
size: "lg",
|
|
49
|
+
mb: 1,
|
|
50
|
+
children: title
|
|
51
|
+
}), description && typeof description === 'string' ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_Typography.Paragraph, {
|
|
52
|
+
color: "secondary",
|
|
53
|
+
children: description
|
|
54
|
+
}) : description]
|
|
55
|
+
}), action && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Button.Button, {
|
|
56
|
+
variant: "primary",
|
|
57
|
+
color: variant === 'danger' ? 'danger' : 'primary',
|
|
58
|
+
onClick: action.onClick,
|
|
59
|
+
rightIcon: action.rightIcon,
|
|
60
|
+
leftIcon: action.leftIcon,
|
|
61
|
+
ml: 4,
|
|
62
|
+
children: action.label
|
|
63
|
+
}), onDismiss && /*#__PURE__*/(0, _jsxRuntime.jsx)(_Flexbox.Box, {
|
|
64
|
+
ml: 4,
|
|
65
|
+
children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_CloseButton.CloseButton, {
|
|
66
|
+
onClick: onDismiss
|
|
67
|
+
})
|
|
68
|
+
})]
|
|
69
|
+
}));
|
|
70
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { BannerolProps } from './Bannerol.types';
|
|
3
|
+
export declare const StyledBannerol: 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 & Pick<BannerolProps, "variant">, {}, {}>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault")["default"];
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.StyledBannerol = void 0;
|
|
8
|
+
var _base = _interopRequireDefault(require("@emotion/styled/base"));
|
|
9
|
+
var _Flexbox = require("../Flexbox");
|
|
10
|
+
var _Link = require("../Link");
|
|
11
|
+
var _react = require("@emotion/react");
|
|
12
|
+
var StyledBannerol = exports.StyledBannerol = /*#__PURE__*/(0, _base["default"])(_Flexbox.Flex, process.env.NODE_ENV === "production" ? {
|
|
13
|
+
target: "etdck960"
|
|
14
|
+
} : {
|
|
15
|
+
target: "etdck960",
|
|
16
|
+
label: "codacy"
|
|
17
|
+
})(function (_ref) {
|
|
18
|
+
var theme = _ref.theme,
|
|
19
|
+
_ref$variant = _ref.variant,
|
|
20
|
+
variant = _ref$variant === void 0 ? 'info' : _ref$variant;
|
|
21
|
+
return /*#__PURE__*/(0, _react.css)("background:", theme.colors[variant === 'info' ? 'background-brand' : "background-".concat(variant)], ";border-radius:", theme.radii[1], ";box-shadow:", theme.shadows[0], ";position:relative;", _Link.StyledLink, "{color:", theme.colors["text-".concat(variant)], ";font-weight:", theme.fontWeights['semi-bold'], ";&:hover{color:", theme.colors["".concat(variant, "-hover")], ";}}" + (process.env.NODE_ENV === "production" ? "" : ";label:codacy;"), process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9CYW5uZXJvbC9CYW5uZXJvbC5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBUXdDIiwiZmlsZSI6Ii4uLy4uL3NyYy9CYW5uZXJvbC9CYW5uZXJvbC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgc3R5bGVkIGZyb20gJ0BlbW90aW9uL3N0eWxlZCdcbmltcG9ydCB7IENvbG9yIH0gZnJvbSAnLi4vdGhlbWUnXG5pbXBvcnQgeyBGbGV4IH0gZnJvbSAnLi4vRmxleGJveCdcbmltcG9ydCB7IEJhbm5lcm9sUHJvcHMgfSBmcm9tICcuL0Jhbm5lcm9sLnR5cGVzJ1xuaW1wb3J0IHsgU3R5bGVkTGluayB9IGZyb20gJy4uL0xpbmsnXG5pbXBvcnQgeyBjc3MgfSBmcm9tICdAZW1vdGlvbi9yZWFjdCdcblxuZXhwb3J0IGNvbnN0IFN0eWxlZEJhbm5lcm9sID0gc3R5bGVkKEZsZXgpPFBpY2s8QmFubmVyb2xQcm9wcywgJ3ZhcmlhbnQnPj5gXG4gICR7KHsgdGhlbWUsIHZhcmlhbnQgPSAnaW5mbycgfSkgPT4gY3NzYFxuICAgIGJhY2tncm91bmQ6ICR7dGhlbWUuY29sb3JzW3ZhcmlhbnQgPT09ICdpbmZvJyA/ICdiYWNrZ3JvdW5kLWJyYW5kJyA6IChgYmFja2dyb3VuZC0ke3ZhcmlhbnR9YCBhcyBDb2xvcildfTtcbiAgICBib3JkZXItcmFkaXVzOiAke3RoZW1lLnJhZGlpWzFdfTtcbiAgICBib3gtc2hhZG93OiAke3RoZW1lLnNoYWRvd3NbMF19O1xuICAgIHBvc2l0aW9uOiByZWxhdGl2ZTtcblxuICAgICR7U3R5bGVkTGlua30ge1xuICAgICAgY29sb3I6ICR7dGhlbWUuY29sb3JzW2B0ZXh0LSR7dmFyaWFudH1gXX07XG4gICAgICBmb250LXdlaWdodDogJHt0aGVtZS5mb250V2VpZ2h0c1snc2VtaS1ib2xkJ119O1xuXG4gICAgICAmOmhvdmVyIHtcbiAgICAgICAgY29sb3I6ICR7dGhlbWUuY29sb3JzW2Ake3ZhcmlhbnR9LWhvdmVyYF19O1xuICAgICAgfVxuICAgIH1cbiAgYH1cbmBcbiJdfQ== */");
|
|
22
|
+
}, ";" + (process.env.NODE_ENV === "production" ? "" : "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9CYW5uZXJvbC9CYW5uZXJvbC5zdHlsZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBTzBFIiwiZmlsZSI6Ii4uLy4uL3NyYy9CYW5uZXJvbC9CYW5uZXJvbC5zdHlsZXMudHMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBv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 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ContainerComponentProps } from '../types';
|
|
3
|
+
import { IconFile } from '../Icon/Icon.types';
|
|
4
|
+
import { FlexProps } from '../Flexbox';
|
|
5
|
+
export declare type BannerolVariant = 'info' | 'warning' | 'success' | 'danger' | 'attention';
|
|
6
|
+
export declare type BannerolAction = {
|
|
7
|
+
label: string;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
leftIcon?: IconFile;
|
|
10
|
+
rightIcon?: IconFile;
|
|
11
|
+
};
|
|
12
|
+
export interface BannerolProps extends FlexProps, ContainerComponentProps {
|
|
13
|
+
title: string;
|
|
14
|
+
description?: React.ReactNode;
|
|
15
|
+
icon?: IconFile;
|
|
16
|
+
action?: BannerolAction;
|
|
17
|
+
onDismiss?: () => void;
|
|
18
|
+
variant?: BannerolVariant;
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
var _Bannerol = require("./Bannerol");
|
|
7
|
+
Object.keys(_Bannerol).forEach(function (key) {
|
|
8
|
+
if (key === "default" || key === "__esModule") return;
|
|
9
|
+
if (key in exports && exports[key] === _Bannerol[key]) return;
|
|
10
|
+
Object.defineProperty(exports, key, {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function get() {
|
|
13
|
+
return _Bannerol[key];
|
|
14
|
+
}
|
|
15
|
+
});
|
|
16
|
+
});
|
|
17
|
+
var _Bannerol2 = require("./Bannerol.types");
|
|
18
|
+
Object.keys(_Bannerol2).forEach(function (key) {
|
|
19
|
+
if (key === "default" || key === "__esModule") return;
|
|
20
|
+
if (key in exports && exports[key] === _Bannerol2[key]) return;
|
|
21
|
+
Object.defineProperty(exports, key, {
|
|
22
|
+
enumerable: true,
|
|
23
|
+
get: function get() {
|
|
24
|
+
return _Bannerol2[key];
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
});
|
|
28
|
+
var _Bannerol3 = require("./Bannerol.styles");
|
|
29
|
+
Object.keys(_Bannerol3).forEach(function (key) {
|
|
30
|
+
if (key === "default" || key === "__esModule") return;
|
|
31
|
+
if (key in exports && exports[key] === _Bannerol3[key]) return;
|
|
32
|
+
Object.defineProperty(exports, key, {
|
|
33
|
+
enumerable: true,
|
|
34
|
+
get: function get() {
|
|
35
|
+
return _Bannerol3[key];
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
});
|
package/lib/index.d.ts
CHANGED
package/lib/index.js
CHANGED
|
@@ -530,4 +530,15 @@ Object.keys(_ExpandableBox).forEach(function (key) {
|
|
|
530
530
|
return _ExpandableBox[key];
|
|
531
531
|
}
|
|
532
532
|
});
|
|
533
|
+
});
|
|
534
|
+
var _Bannerol = require("./Bannerol");
|
|
535
|
+
Object.keys(_Bannerol).forEach(function (key) {
|
|
536
|
+
if (key === "default" || key === "__esModule") return;
|
|
537
|
+
if (key in exports && exports[key] === _Bannerol[key]) return;
|
|
538
|
+
Object.defineProperty(exports, key, {
|
|
539
|
+
enumerable: true,
|
|
540
|
+
get: function get() {
|
|
541
|
+
return _Bannerol[key];
|
|
542
|
+
}
|
|
543
|
+
});
|
|
533
544
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codacy/ui-components",
|
|
3
|
-
"version": "0.65.
|
|
3
|
+
"version": "0.65.70",
|
|
4
4
|
"description": "",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"author": "",
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"@babel/runtime": "^7.23.6",
|
|
31
31
|
"@pathofdev/react-tag-input": "github:inesgomas/react-tag-input",
|
|
32
32
|
"@styled-system/should-forward-prop": "^5.1.5",
|
|
33
|
+
"@testing-library/user-event": "^14.6.1",
|
|
33
34
|
"autosize": "^4.0.2",
|
|
34
35
|
"md5": "^2.3.0",
|
|
35
36
|
"polished": "^3.6.7",
|