@qiwi/pijma-desktop 1.157.0 → 1.158.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qiwi/pijma-desktop",
3
- "version": "1.157.0",
3
+ "version": "1.158.1",
4
4
  "type": "module",
5
5
  "main": "./target/es5/index.js",
6
6
  "module": "./target/es6/index.js",
@@ -0,0 +1,10 @@
1
+ import { FC } from 'react';
2
+ export interface ExtendedProgressBarProps {
3
+ value: number;
4
+ maxValue?: number;
5
+ titleStart?: string;
6
+ titleEnd?: string;
7
+ stub?: boolean;
8
+ formatValue?: (value: number) => string;
9
+ }
10
+ export declare const ExtendedProgressBar: FC<ExtendedProgressBarProps>;
@@ -0,0 +1 @@
1
+ export * from './ExtendedProgressBar';
@@ -39,6 +39,7 @@ export * from './alert';
39
39
  export * from './rating';
40
40
  export * from './content-suggest';
41
41
  export * from './progress-bar';
42
+ export * from './extended-progress-bar';
42
43
  export * from './header-suggest';
43
44
  export * from './alert';
44
45
  export * from './checkbox';
@@ -0,0 +1,104 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "ExtendedProgressBar", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return ExtendedProgressBar;
9
+ }
10
+ });
11
+ var _interopRequireDefault = require("@swc/helpers/lib/_interop_require_default.js").default;
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ var _pijmaCore = require("@qiwi/pijma-core");
14
+ var _react = /*#__PURE__*/ _interopRequireDefault(require("react"));
15
+ var _typography = require("../typography/index.js");
16
+ var ExtendedProgressBar = function(param) {
17
+ var value = param.value, _maxValue = param.maxValue, maxValue = _maxValue === void 0 ? 1 : _maxValue, titleStart = param.titleStart, titleEnd = param.titleEnd, _stub = param.stub, stub = _stub === void 0 ? false : _stub, formatValue = param.formatValue;
18
+ return /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Spacer, {
19
+ size: "xs",
20
+ children: [
21
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Flex, {
22
+ children: [
23
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
24
+ width: stub ? 1 : value / maxValue,
25
+ minWidth: 2,
26
+ transition: "width 300ms cubic-bezier(0.4, 0.0, 0.2, 1)",
27
+ children: stub ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Stub, {
28
+ height: 2,
29
+ width: 1,
30
+ r: 4
31
+ }) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Card, {
32
+ height: 2,
33
+ width: 1,
34
+ r: 4,
35
+ bg: "#FF8C00"
36
+ })
37
+ }),
38
+ !stub && value < maxValue ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
39
+ ml: 1,
40
+ grow: 1,
41
+ minWidth: 2,
42
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Card, {
43
+ height: 2,
44
+ width: 1,
45
+ r: 4,
46
+ bg: "#F5F5F5"
47
+ })
48
+ }) : null
49
+ ]
50
+ }),
51
+ titleStart || titleEnd ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Flex, {
52
+ mt: 2,
53
+ justify: "space-between",
54
+ children: [
55
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
56
+ width: stub ? 0.15 : undefined,
57
+ children: stub && titleStart ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
58
+ size: "s",
59
+ display: "block",
60
+ stub: true
61
+ }) : titleStart ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_typography.Paragraph, {
62
+ size: "s",
63
+ children: [
64
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_typography.Text, {
65
+ color: "support",
66
+ children: [
67
+ titleStart,
68
+ ": "
69
+ ]
70
+ }),
71
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
72
+ children: formatValue !== undefined ? formatValue(value) : value
73
+ })
74
+ ]
75
+ }) : null
76
+ }),
77
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
78
+ width: stub ? 0.15 : undefined,
79
+ children: stub && titleEnd ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
80
+ size: "s",
81
+ display: "block",
82
+ stub: true
83
+ }) : titleEnd ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_typography.Paragraph, {
84
+ size: "s",
85
+ children: [
86
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_typography.Text, {
87
+ color: "support",
88
+ children: [
89
+ titleEnd,
90
+ ": "
91
+ ]
92
+ }),
93
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
94
+ children: formatValue !== undefined ? formatValue(maxValue - value) : maxValue - value
95
+ })
96
+ ]
97
+ }) : null
98
+ })
99
+ ]
100
+ }) : null
101
+ ]
102
+ });
103
+ };
104
+ ExtendedProgressBar.displayName = "ExtendedProgressBar";
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ var _exportStar = require("@swc/helpers/lib/_export_star.js").default;
6
+ _exportStar(require("./ExtendedProgressBar.js"), exports);
@@ -57,6 +57,7 @@ _exportStar(require("./header-bank-card-link/index.js"), exports);
57
57
  _exportStar(require("./alert/index.js"), exports);
58
58
  _exportStar(require("./rating/index.js"), exports);
59
59
  _exportStar(require("./progress-bar/index.js"), exports);
60
+ _exportStar(require("./extended-progress-bar/index.js"), exports);
60
61
  _exportStar(require("./header-suggest/index.js"), exports);
61
62
  _exportStar(require("./checkbox/index.js"), exports);
62
63
  _exportStar(require("./suggest-field/index.js"), exports);
@@ -0,0 +1,90 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Card, Flex, FlexItem, Spacer, Stub } from '@qiwi/pijma-core';
3
+ import React from 'react';
4
+ import { Paragraph, Text } from '../typography/index.js';
5
+ export const ExtendedProgressBar = ({ value , maxValue =1 , titleStart , titleEnd , stub =false , formatValue , })=>/*#__PURE__*/ _jsxs(Spacer, {
6
+ size: "xs",
7
+ children: [
8
+ /*#__PURE__*/ _jsxs(Flex, {
9
+ children: [
10
+ /*#__PURE__*/ _jsx(FlexItem, {
11
+ width: stub ? 1 : value / maxValue,
12
+ minWidth: 2,
13
+ transition: "width 300ms cubic-bezier(0.4, 0.0, 0.2, 1)",
14
+ children: stub ? /*#__PURE__*/ _jsx(Stub, {
15
+ height: 2,
16
+ width: 1,
17
+ r: 4
18
+ }) : /*#__PURE__*/ _jsx(Card, {
19
+ height: 2,
20
+ width: 1,
21
+ r: 4,
22
+ bg: "#FF8C00"
23
+ })
24
+ }),
25
+ !stub && value < maxValue ? /*#__PURE__*/ _jsx(FlexItem, {
26
+ ml: 1,
27
+ grow: 1,
28
+ minWidth: 2,
29
+ children: /*#__PURE__*/ _jsx(Card, {
30
+ height: 2,
31
+ width: 1,
32
+ r: 4,
33
+ bg: "#F5F5F5"
34
+ })
35
+ }) : null
36
+ ]
37
+ }),
38
+ titleStart || titleEnd ? /*#__PURE__*/ _jsxs(Flex, {
39
+ mt: 2,
40
+ justify: "space-between",
41
+ children: [
42
+ /*#__PURE__*/ _jsx(FlexItem, {
43
+ width: stub ? 0.15 : undefined,
44
+ children: stub && titleStart ? /*#__PURE__*/ _jsx(Text, {
45
+ size: "s",
46
+ display: "block",
47
+ stub: true
48
+ }) : titleStart ? /*#__PURE__*/ _jsxs(Paragraph, {
49
+ size: "s",
50
+ children: [
51
+ /*#__PURE__*/ _jsxs(Text, {
52
+ color: "support",
53
+ children: [
54
+ titleStart,
55
+ ": "
56
+ ]
57
+ }),
58
+ /*#__PURE__*/ _jsx(Text, {
59
+ children: formatValue !== undefined ? formatValue(value) : value
60
+ })
61
+ ]
62
+ }) : null
63
+ }),
64
+ /*#__PURE__*/ _jsx(FlexItem, {
65
+ width: stub ? 0.15 : undefined,
66
+ children: stub && titleEnd ? /*#__PURE__*/ _jsx(Text, {
67
+ size: "s",
68
+ display: "block",
69
+ stub: true
70
+ }) : titleEnd ? /*#__PURE__*/ _jsxs(Paragraph, {
71
+ size: "s",
72
+ children: [
73
+ /*#__PURE__*/ _jsxs(Text, {
74
+ color: "support",
75
+ children: [
76
+ titleEnd,
77
+ ": "
78
+ ]
79
+ }),
80
+ /*#__PURE__*/ _jsx(Text, {
81
+ children: formatValue !== undefined ? formatValue(maxValue - value) : maxValue - value
82
+ })
83
+ ]
84
+ }) : null
85
+ })
86
+ ]
87
+ }) : null
88
+ ]
89
+ });
90
+ ExtendedProgressBar.displayName = 'ExtendedProgressBar';
@@ -0,0 +1 @@
1
+ export * from './ExtendedProgressBar.js';
@@ -39,6 +39,7 @@ export * from './alert/index.js';
39
39
  export * from './rating/index.js';
40
40
  export * from './content-suggest/index.js';
41
41
  export * from './progress-bar/index.js';
42
+ export * from './extended-progress-bar/index.js';
42
43
  export * from './header-suggest/index.js';
43
44
  export * from './alert/index.js';
44
45
  export * from './checkbox/index.js';