@qiwi/pijma-desktop 1.152.1 → 1.154.1
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/dts/core/src/alert-block/AlertBlockControl.d.ts +21 -0
- package/lib/dts/core/src/alert-block/index.d.ts +1 -0
- package/lib/dts/core/src/index.d.ts +1 -0
- package/lib/dts/desktop/src/alert-block/AlertBlock.d.ts +8 -0
- package/lib/dts/desktop/src/alert-block/index.d.ts +1 -0
- package/lib/dts/desktop/src/index.d.ts +1 -0
- package/lib/es5/alert-block/AlertBlock.js +127 -0
- package/lib/es5/alert-block/index.js +6 -0
- package/lib/es5/index.js +1 -0
- package/lib/es6/alert-block/AlertBlock.js +113 -0
- package/lib/es6/alert-block/index.js +1 -0
- package/lib/es6/index.js +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
export interface AlertBlockControlProps {
|
|
3
|
+
onHide?: () => void;
|
|
4
|
+
children: FC<{
|
|
5
|
+
closeHover: boolean;
|
|
6
|
+
onCloseClick: React.MouseEventHandler;
|
|
7
|
+
onCloseMouseEnter: React.MouseEventHandler;
|
|
8
|
+
onCloseMouseLeave: React.MouseEventHandler;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export interface AlertBlockControlState {
|
|
12
|
+
closeHover: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare class AlertBlockControl extends React.Component<AlertBlockControlProps> {
|
|
15
|
+
static displayName: string;
|
|
16
|
+
state: AlertBlockControlState;
|
|
17
|
+
private onCloseClick;
|
|
18
|
+
private onCloseMouseEnter;
|
|
19
|
+
private onCloseMouseLeave;
|
|
20
|
+
render(): React.ReactElement<any, any> | null;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AlertBlockControl';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { FC, ReactNode } from 'react';
|
|
2
|
+
export interface AlertBlockProps {
|
|
3
|
+
type: 'success' | 'warning' | 'waiting' | 'failure' | 'info' | 'promo';
|
|
4
|
+
icon?: ReactNode;
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
onHide?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const AlertBlock: FC<AlertBlockProps>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AlertBlock';
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "AlertBlock", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return AlertBlock;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
var _interopRequireWildcard = require("@swc/helpers/lib/_interop_require_wildcard.js").default;
|
|
12
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
13
|
+
var _pijmaCore = require("@qiwi/pijma-core");
|
|
14
|
+
var _react = /*#__PURE__*/ _interopRequireWildcard(require("react"));
|
|
15
|
+
var _typography = require("../typography/index.js");
|
|
16
|
+
var AlertBlockBackground = {
|
|
17
|
+
success: "#EDF8EF",
|
|
18
|
+
waiting: "#FFF8E6",
|
|
19
|
+
warning: "#FF8C001A",
|
|
20
|
+
failure: "#FAE6E8",
|
|
21
|
+
info: "#F5F5F5",
|
|
22
|
+
promo: "#2D3540"
|
|
23
|
+
};
|
|
24
|
+
var AlertBlockIcon = {
|
|
25
|
+
success: {
|
|
26
|
+
name: "success",
|
|
27
|
+
color: "#4BBD5C",
|
|
28
|
+
bg: "#fff"
|
|
29
|
+
},
|
|
30
|
+
waiting: {
|
|
31
|
+
name: "clock-solid",
|
|
32
|
+
color: "#FFB800",
|
|
33
|
+
bg: "#fff"
|
|
34
|
+
},
|
|
35
|
+
warning: {
|
|
36
|
+
name: "attention",
|
|
37
|
+
color: "#FF8C00",
|
|
38
|
+
bg: "#fff"
|
|
39
|
+
},
|
|
40
|
+
failure: {
|
|
41
|
+
name: "attention",
|
|
42
|
+
color: "#D0021B",
|
|
43
|
+
bg: "#fff"
|
|
44
|
+
},
|
|
45
|
+
info: {
|
|
46
|
+
name: "info",
|
|
47
|
+
color: "#E6E6E6",
|
|
48
|
+
bg: "#666666"
|
|
49
|
+
},
|
|
50
|
+
promo: {
|
|
51
|
+
name: "success",
|
|
52
|
+
color: "#4BBD5C",
|
|
53
|
+
bg: "#fff"
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var AlertBlock = function(param) {
|
|
57
|
+
var children = param.children, icon = param.icon, type = param.type, onHide = param.onHide;
|
|
58
|
+
var iconComponent = /*#__PURE__*/ (0, _react.isValidElement)(icon) ? icon : icon === undefined ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Pos, {
|
|
59
|
+
type: "relative",
|
|
60
|
+
children: [
|
|
61
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Pos, {
|
|
62
|
+
type: "absolute",
|
|
63
|
+
top: "4px",
|
|
64
|
+
left: "4px",
|
|
65
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Card, {
|
|
66
|
+
bg: AlertBlockIcon[type].bg,
|
|
67
|
+
width: 4,
|
|
68
|
+
height: 4,
|
|
69
|
+
r: 8
|
|
70
|
+
})
|
|
71
|
+
}),
|
|
72
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Pos, {
|
|
73
|
+
type: "relative",
|
|
74
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Icon, {
|
|
75
|
+
name: AlertBlockIcon[type].name,
|
|
76
|
+
size: 6,
|
|
77
|
+
color: AlertBlockIcon[type].color
|
|
78
|
+
})
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}) : null;
|
|
82
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.AlertBlockControl, {
|
|
83
|
+
onHide: onHide,
|
|
84
|
+
children: function(renderProps) {
|
|
85
|
+
return /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Block, {
|
|
86
|
+
bg: AlertBlockBackground[type],
|
|
87
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.FlexPos, {
|
|
88
|
+
display: "flex",
|
|
89
|
+
type: "relative",
|
|
90
|
+
py: 5,
|
|
91
|
+
pl: 6,
|
|
92
|
+
pr: onHide !== undefined ? 18 : 6,
|
|
93
|
+
children: [
|
|
94
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
|
|
95
|
+
mr: 3,
|
|
96
|
+
children: iconComponent
|
|
97
|
+
}),
|
|
98
|
+
/*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
|
|
99
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Paragraph, {
|
|
100
|
+
bold: true,
|
|
101
|
+
color: type === "promo" ? "inverse" : "default",
|
|
102
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Breaker, {
|
|
103
|
+
children: children
|
|
104
|
+
})
|
|
105
|
+
})
|
|
106
|
+
}),
|
|
107
|
+
onHide !== undefined ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Pos, {
|
|
108
|
+
cursor: "pointer",
|
|
109
|
+
type: "absolute",
|
|
110
|
+
right: 6,
|
|
111
|
+
top: 5,
|
|
112
|
+
onClick: renderProps.onCloseClick,
|
|
113
|
+
onMouseEnter: renderProps.onCloseMouseEnter,
|
|
114
|
+
onMouseLeave: renderProps.onCloseMouseLeave,
|
|
115
|
+
children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Icon, {
|
|
116
|
+
size: 6,
|
|
117
|
+
color: type === "promo" ? "#999" : "#666",
|
|
118
|
+
name: "cross-small"
|
|
119
|
+
})
|
|
120
|
+
}) : null
|
|
121
|
+
]
|
|
122
|
+
})
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
};
|
|
127
|
+
AlertBlock.displayName = "AlertBlock";
|
package/lib/es5/index.js
CHANGED
|
@@ -18,6 +18,7 @@ _export(exports, {
|
|
|
18
18
|
});
|
|
19
19
|
var _exportStar = require("@swc/helpers/lib/_export_star.js").default;
|
|
20
20
|
_exportStar(require("@qiwi/pijma-core"), exports);
|
|
21
|
+
_exportStar(require("./alert-block/index.js"), exports);
|
|
21
22
|
_exportStar(require("./button/index.js"), exports);
|
|
22
23
|
_exportStar(require("./actions/index.js"), exports);
|
|
23
24
|
var _textField = _exportStar(require("./text-field/index.js"), exports);
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AlertBlockControl, Block, Breaker, Card, FlexItem, FlexPos, Icon, Pos } from '@qiwi/pijma-core';
|
|
3
|
+
import React, { isValidElement } from 'react';
|
|
4
|
+
import { Paragraph } from '../typography/index.js';
|
|
5
|
+
const AlertBlockBackground = {
|
|
6
|
+
success: '#EDF8EF',
|
|
7
|
+
waiting: '#FFF8E6',
|
|
8
|
+
warning: '#FF8C001A',
|
|
9
|
+
failure: '#FAE6E8',
|
|
10
|
+
info: '#F5F5F5',
|
|
11
|
+
promo: '#2D3540'
|
|
12
|
+
};
|
|
13
|
+
const AlertBlockIcon = {
|
|
14
|
+
success: {
|
|
15
|
+
name: 'success',
|
|
16
|
+
color: '#4BBD5C',
|
|
17
|
+
bg: '#fff'
|
|
18
|
+
},
|
|
19
|
+
waiting: {
|
|
20
|
+
name: 'clock-solid',
|
|
21
|
+
color: '#FFB800',
|
|
22
|
+
bg: '#fff'
|
|
23
|
+
},
|
|
24
|
+
warning: {
|
|
25
|
+
name: 'attention',
|
|
26
|
+
color: '#FF8C00',
|
|
27
|
+
bg: '#fff'
|
|
28
|
+
},
|
|
29
|
+
failure: {
|
|
30
|
+
name: 'attention',
|
|
31
|
+
color: '#D0021B',
|
|
32
|
+
bg: '#fff'
|
|
33
|
+
},
|
|
34
|
+
info: {
|
|
35
|
+
name: 'info',
|
|
36
|
+
color: '#E6E6E6',
|
|
37
|
+
bg: '#666666'
|
|
38
|
+
},
|
|
39
|
+
promo: {
|
|
40
|
+
name: 'success',
|
|
41
|
+
color: '#4BBD5C',
|
|
42
|
+
bg: '#fff'
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
export const AlertBlock = ({ children , icon , type , onHide , })=>{
|
|
46
|
+
const iconComponent = /*#__PURE__*/ isValidElement(icon) ? icon : icon === undefined ? /*#__PURE__*/ _jsxs(Pos, {
|
|
47
|
+
type: "relative",
|
|
48
|
+
children: [
|
|
49
|
+
/*#__PURE__*/ _jsx(Pos, {
|
|
50
|
+
type: "absolute",
|
|
51
|
+
top: "4px",
|
|
52
|
+
left: "4px",
|
|
53
|
+
children: /*#__PURE__*/ _jsx(Card, {
|
|
54
|
+
bg: AlertBlockIcon[type].bg,
|
|
55
|
+
width: 4,
|
|
56
|
+
height: 4,
|
|
57
|
+
r: 8
|
|
58
|
+
})
|
|
59
|
+
}),
|
|
60
|
+
/*#__PURE__*/ _jsx(Pos, {
|
|
61
|
+
type: "relative",
|
|
62
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
63
|
+
name: AlertBlockIcon[type].name,
|
|
64
|
+
size: 6,
|
|
65
|
+
color: AlertBlockIcon[type].color
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
]
|
|
69
|
+
}) : null;
|
|
70
|
+
return /*#__PURE__*/ _jsx(AlertBlockControl, {
|
|
71
|
+
onHide: onHide,
|
|
72
|
+
children: (renderProps)=>/*#__PURE__*/ _jsx(Block, {
|
|
73
|
+
bg: AlertBlockBackground[type],
|
|
74
|
+
children: /*#__PURE__*/ _jsxs(FlexPos, {
|
|
75
|
+
display: "flex",
|
|
76
|
+
type: "relative",
|
|
77
|
+
py: 5,
|
|
78
|
+
pl: 6,
|
|
79
|
+
pr: onHide !== undefined ? 18 : 6,
|
|
80
|
+
children: [
|
|
81
|
+
/*#__PURE__*/ _jsx(FlexItem, {
|
|
82
|
+
mr: 3,
|
|
83
|
+
children: iconComponent
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ _jsx(FlexItem, {
|
|
86
|
+
children: /*#__PURE__*/ _jsx(Paragraph, {
|
|
87
|
+
bold: true,
|
|
88
|
+
color: type === 'promo' ? 'inverse' : 'default',
|
|
89
|
+
children: /*#__PURE__*/ _jsx(Breaker, {
|
|
90
|
+
children: children
|
|
91
|
+
})
|
|
92
|
+
})
|
|
93
|
+
}),
|
|
94
|
+
onHide !== undefined ? /*#__PURE__*/ _jsx(Pos, {
|
|
95
|
+
cursor: "pointer",
|
|
96
|
+
type: "absolute",
|
|
97
|
+
right: 6,
|
|
98
|
+
top: 5,
|
|
99
|
+
onClick: renderProps.onCloseClick,
|
|
100
|
+
onMouseEnter: renderProps.onCloseMouseEnter,
|
|
101
|
+
onMouseLeave: renderProps.onCloseMouseLeave,
|
|
102
|
+
children: /*#__PURE__*/ _jsx(Icon, {
|
|
103
|
+
size: 6,
|
|
104
|
+
color: type === 'promo' ? '#999' : '#666',
|
|
105
|
+
name: "cross-small"
|
|
106
|
+
})
|
|
107
|
+
}) : null
|
|
108
|
+
]
|
|
109
|
+
})
|
|
110
|
+
})
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
AlertBlock.displayName = 'AlertBlock';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AlertBlock.js';
|
package/lib/es6/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qiwi/pijma-desktop",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.154.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./lib/es5/index.js",
|
|
6
6
|
"module": "./lib/es6/index.js",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"lib"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@qiwi/pijma-core": "1.
|
|
40
|
+
"@qiwi/pijma-core": "1.155.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@qiwi/pijma-infra": "1.9.0",
|