@qiwi/pijma-desktop 1.161.2 → 1.162.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qiwi/pijma-desktop",
3
- "version": "1.161.2",
3
+ "version": "1.162.0",
4
4
  "type": "module",
5
5
  "main": "./target/es5/index.js",
6
6
  "module": "./target/es6/index.js",
@@ -39,7 +39,8 @@
39
39
  "target/es6/**/*"
40
40
  ],
41
41
  "dependencies": {
42
- "@qiwi/pijma-core": "1.162.0"
42
+ "@qiwi/pijma-core": "1.163.0",
43
+ "@swc/helpers": "^0.5.1"
43
44
  },
44
45
  "devDependencies": {
45
46
  "@qiwi/pijma-infra": "1.11.1",
@@ -0,0 +1,10 @@
1
+ import { FC, ReactNode } from 'react';
2
+ export interface CustomAlertProps {
3
+ icon?: ReactNode;
4
+ shadow?: string;
5
+ bg: string;
6
+ textColor: 'inverse' | 'default';
7
+ children?: ReactNode;
8
+ onHide?: () => void;
9
+ }
10
+ export declare const CustomAlert: FC<CustomAlertProps>;
@@ -0,0 +1 @@
1
+ export * from './CustomAlert';
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "CustomAlert", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return CustomAlert;
9
+ }
10
+ });
11
+ var _extends = require("@swc/helpers/_/_extends");
12
+ var _interop_require_default = require("@swc/helpers/_/_interop_require_default");
13
+ var _object_without_properties_loose = require("@swc/helpers/_/_object_without_properties_loose");
14
+ var _jsxruntime = require("react/jsx-runtime");
15
+ var _pijmacore = require("@qiwi/pijma-core");
16
+ var _react = /*#__PURE__*/ _interop_require_default._(require("react"));
17
+ var _typography = require("../typography/index.js");
18
+ var CustomAlert = function(_param) {
19
+ var children = _param.children, icon = _param.icon, bg = _param.bg, shadow = _param.shadow, textColor = _param.textColor, onHide = _param.onHide, rest = _object_without_properties_loose._(_param, [
20
+ "children",
21
+ "icon",
22
+ "bg",
23
+ "shadow",
24
+ "textColor",
25
+ "onHide"
26
+ ]);
27
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pijmacore.AlertBlockControl, {
28
+ onHide: onHide,
29
+ children: function(renderProps) {
30
+ return /*#__PURE__*/ (0, _jsxruntime.jsx)(_pijmacore.Card, _extends._({}, (0, _pijmacore.getDataProps)(rest), {
31
+ bg: bg,
32
+ r: 10,
33
+ transition: "all 300ms cubic-bezier(0.4, 0.0, 0.2, 1)",
34
+ s: shadow,
35
+ children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_pijmacore.FlexPos, {
36
+ display: "flex",
37
+ type: "relative",
38
+ py: 5,
39
+ pl: 6,
40
+ pr: onHide !== undefined ? 18 : 6,
41
+ children: [
42
+ icon && /*#__PURE__*/ (0, _jsxruntime.jsx)(_pijmacore.FlexItem, {
43
+ mr: 3,
44
+ children: icon
45
+ }),
46
+ /*#__PURE__*/ (0, _jsxruntime.jsx)(_pijmacore.FlexItem, {
47
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_typography.Paragraph, {
48
+ color: textColor,
49
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pijmacore.Breaker, {
50
+ children: children
51
+ })
52
+ })
53
+ }),
54
+ onHide !== undefined ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_pijmacore.Pos, {
55
+ cursor: "pointer",
56
+ type: "absolute",
57
+ right: 6,
58
+ top: 5,
59
+ onClick: renderProps.onCloseClick,
60
+ onMouseEnter: renderProps.onCloseMouseEnter,
61
+ onMouseLeave: renderProps.onCloseMouseLeave,
62
+ children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_pijmacore.Icon, {
63
+ size: 6,
64
+ color: textColor === "inverse" ? "#999" : "#666",
65
+ name: "cross-small"
66
+ })
67
+ }) : null
68
+ ]
69
+ })
70
+ }));
71
+ }
72
+ });
73
+ };
74
+ CustomAlert.displayName = "CustomAlert";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ var _export_star = require("@swc/helpers/_/_export_star");
6
+ _export_star._(require("./CustomAlert.js"), exports);
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { AlertBlockControl, Breaker, Card, FlexItem, FlexPos, getDataProps, Icon, Pos } from '@qiwi/pijma-core';
3
+ import React from 'react';
4
+ import { Paragraph } from '../typography/index.js';
5
+ export const CustomAlert = ({ children , icon , bg , shadow , textColor , onHide , ...rest })=>{
6
+ return /*#__PURE__*/ _jsx(AlertBlockControl, {
7
+ onHide: onHide,
8
+ children: (renderProps)=>/*#__PURE__*/ _jsx(Card, {
9
+ ...getDataProps(rest),
10
+ bg: bg,
11
+ r: 10,
12
+ transition: "all 300ms cubic-bezier(0.4, 0.0, 0.2, 1)",
13
+ s: shadow,
14
+ children: /*#__PURE__*/ _jsxs(FlexPos, {
15
+ display: "flex",
16
+ type: "relative",
17
+ py: 5,
18
+ pl: 6,
19
+ pr: onHide !== undefined ? 18 : 6,
20
+ children: [
21
+ icon && /*#__PURE__*/ _jsx(FlexItem, {
22
+ mr: 3,
23
+ children: icon
24
+ }),
25
+ /*#__PURE__*/ _jsx(FlexItem, {
26
+ children: /*#__PURE__*/ _jsx(Paragraph, {
27
+ color: textColor,
28
+ children: /*#__PURE__*/ _jsx(Breaker, {
29
+ children: children
30
+ })
31
+ })
32
+ }),
33
+ onHide !== undefined ? /*#__PURE__*/ _jsx(Pos, {
34
+ cursor: "pointer",
35
+ type: "absolute",
36
+ right: 6,
37
+ top: 5,
38
+ onClick: renderProps.onCloseClick,
39
+ onMouseEnter: renderProps.onCloseMouseEnter,
40
+ onMouseLeave: renderProps.onCloseMouseLeave,
41
+ children: /*#__PURE__*/ _jsx(Icon, {
42
+ size: 6,
43
+ color: textColor === 'inverse' ? '#999' : '#666',
44
+ name: "cross-small"
45
+ })
46
+ }) : null
47
+ ]
48
+ })
49
+ })
50
+ });
51
+ };
52
+ CustomAlert.displayName = 'CustomAlert';
@@ -0,0 +1 @@
1
+ export * from './CustomAlert.js';