@qiwi/pijma-mobile 1.157.0 → 1.158.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-mobile",
3
- "version": "1.157.0",
3
+ "version": "1.158.0",
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';
@@ -0,0 +1,110 @@
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: "xxs",
20
+ children: [
21
+ titleStart || titleEnd ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Flex, {
22
+ justify: "space-between",
23
+ children: [
24
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
25
+ width: stub ? 0.15 : undefined,
26
+ children: titleStart ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
27
+ size: "s",
28
+ bold: false,
29
+ stub: stub,
30
+ display: stub ? "block" : undefined,
31
+ children: stub ? undefined : formatValue !== undefined ? formatValue(value) : value,
32
+ compact: true
33
+ }) : null
34
+ }),
35
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
36
+ width: stub ? 0.15 : undefined,
37
+ children: titleEnd ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
38
+ size: "s",
39
+ bold: false,
40
+ stub: stub,
41
+ display: stub ? "block" : undefined,
42
+ children: stub ? undefined : formatValue !== undefined ? formatValue(maxValue - value) : maxValue - value,
43
+ compact: true
44
+ }) : null
45
+ })
46
+ ]
47
+ }) : null,
48
+ /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Flex, {
49
+ children: [
50
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
51
+ width: stub ? 1 : value / maxValue,
52
+ minWidth: "4px",
53
+ transition: "width 300ms cubic-bezier(0.4, 0.0, 0.2, 1)",
54
+ children: stub ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Stub, {
55
+ height: "4px",
56
+ width: 1,
57
+ r: 2
58
+ }) : /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Card, {
59
+ height: "4px",
60
+ width: 1,
61
+ r: 2,
62
+ bg: "#FF8C00"
63
+ })
64
+ }),
65
+ !stub && value < maxValue ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
66
+ ml: "2px",
67
+ grow: 1,
68
+ minWidth: "4px",
69
+ children: /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.Card, {
70
+ height: "4px",
71
+ width: 1,
72
+ r: 2,
73
+ bg: "#F5F5F5"
74
+ })
75
+ }) : null
76
+ ]
77
+ }),
78
+ titleStart || titleEnd ? /*#__PURE__*/ (0, _jsxRuntime.jsxs)(_pijmaCore.Flex, {
79
+ justify: "space-between",
80
+ children: [
81
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
82
+ width: stub ? 0.2 : undefined,
83
+ children: titleStart ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
84
+ size: "s",
85
+ bold: false,
86
+ stub: stub,
87
+ color: "support",
88
+ display: stub ? "block" : undefined,
89
+ children: titleStart,
90
+ compact: true
91
+ }) : null
92
+ }),
93
+ /*#__PURE__*/ (0, _jsxRuntime.jsx)(_pijmaCore.FlexItem, {
94
+ width: stub ? 0.2 : undefined,
95
+ children: titleEnd ? /*#__PURE__*/ (0, _jsxRuntime.jsx)(_typography.Text, {
96
+ size: "s",
97
+ bold: false,
98
+ stub: stub,
99
+ color: "support",
100
+ display: stub ? "block" : undefined,
101
+ children: titleEnd,
102
+ compact: true
103
+ }) : null
104
+ })
105
+ ]
106
+ }) : null
107
+ ]
108
+ });
109
+ };
110
+ 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);
@@ -0,0 +1,96 @@
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 { Text } from '../typography/index.js';
5
+ export const ExtendedProgressBar = ({ value , maxValue =1 , titleStart , titleEnd , stub =false , formatValue , })=>/*#__PURE__*/ _jsxs(Spacer, {
6
+ size: "xxs",
7
+ children: [
8
+ titleStart || titleEnd ? /*#__PURE__*/ _jsxs(Flex, {
9
+ justify: "space-between",
10
+ children: [
11
+ /*#__PURE__*/ _jsx(FlexItem, {
12
+ width: stub ? 0.15 : undefined,
13
+ children: titleStart ? /*#__PURE__*/ _jsx(Text, {
14
+ size: "s",
15
+ bold: false,
16
+ stub: stub,
17
+ display: stub ? 'block' : undefined,
18
+ children: stub ? undefined : formatValue !== undefined ? formatValue(value) : value,
19
+ compact: true
20
+ }) : null
21
+ }),
22
+ /*#__PURE__*/ _jsx(FlexItem, {
23
+ width: stub ? 0.15 : undefined,
24
+ children: titleEnd ? /*#__PURE__*/ _jsx(Text, {
25
+ size: "s",
26
+ bold: false,
27
+ stub: stub,
28
+ display: stub ? 'block' : undefined,
29
+ children: stub ? undefined : formatValue !== undefined ? formatValue(maxValue - value) : maxValue - value,
30
+ compact: true
31
+ }) : null
32
+ })
33
+ ]
34
+ }) : null,
35
+ /*#__PURE__*/ _jsxs(Flex, {
36
+ children: [
37
+ /*#__PURE__*/ _jsx(FlexItem, {
38
+ width: stub ? 1 : value / maxValue,
39
+ minWidth: "4px",
40
+ transition: "width 300ms cubic-bezier(0.4, 0.0, 0.2, 1)",
41
+ children: stub ? /*#__PURE__*/ _jsx(Stub, {
42
+ height: "4px",
43
+ width: 1,
44
+ r: 2
45
+ }) : /*#__PURE__*/ _jsx(Card, {
46
+ height: "4px",
47
+ width: 1,
48
+ r: 2,
49
+ bg: "#FF8C00"
50
+ })
51
+ }),
52
+ !stub && value < maxValue ? /*#__PURE__*/ _jsx(FlexItem, {
53
+ ml: "2px",
54
+ grow: 1,
55
+ minWidth: "4px",
56
+ children: /*#__PURE__*/ _jsx(Card, {
57
+ height: "4px",
58
+ width: 1,
59
+ r: 2,
60
+ bg: "#F5F5F5"
61
+ })
62
+ }) : null
63
+ ]
64
+ }),
65
+ titleStart || titleEnd ? /*#__PURE__*/ _jsxs(Flex, {
66
+ justify: "space-between",
67
+ children: [
68
+ /*#__PURE__*/ _jsx(FlexItem, {
69
+ width: stub ? 0.2 : undefined,
70
+ children: titleStart ? /*#__PURE__*/ _jsx(Text, {
71
+ size: "s",
72
+ bold: false,
73
+ stub: stub,
74
+ color: "support",
75
+ display: stub ? 'block' : undefined,
76
+ children: titleStart,
77
+ compact: true
78
+ }) : null
79
+ }),
80
+ /*#__PURE__*/ _jsx(FlexItem, {
81
+ width: stub ? 0.2 : undefined,
82
+ children: titleEnd ? /*#__PURE__*/ _jsx(Text, {
83
+ size: "s",
84
+ bold: false,
85
+ stub: stub,
86
+ color: "support",
87
+ display: stub ? 'block' : undefined,
88
+ children: titleEnd,
89
+ compact: true
90
+ }) : null
91
+ })
92
+ ]
93
+ }) : null
94
+ ]
95
+ });
96
+ ExtendedProgressBar.displayName = 'ExtendedProgressBar';
@@ -0,0 +1 @@
1
+ export * from './ExtendedProgressBar.js';