@tap-payments/os-micro-frontend-shared 0.1.222 → 0.1.223

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.
@@ -21,7 +21,7 @@ import { BalanceCellContainer, PercentageContainer } from './style';
21
21
  import { formatPercentage } from './utils';
22
22
  import { PiePercentage } from '../style';
23
23
  function BalanceCell(_a) {
24
- var { percentage, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
24
+ var { percentage = 0, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
25
25
  const theme = useTheme();
26
26
  const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
27
27
  const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
@@ -1,3 +1,3 @@
1
1
  import { BalanceCellSheetProps } from './type';
2
- declare function BalanceCellSheet({ percentage, remainingAmount, currency, selectionProps }: BalanceCellSheetProps): import("react/jsx-runtime").JSX.Element | null;
2
+ declare function BalanceCellSheet({ remainingAmount, currency, selectionProps }: BalanceCellSheetProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default BalanceCellSheet;
@@ -1,12 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CurrencyIcon, StatusChipWithCopy } from '../../../index.js';
3
3
  import { formatAmountWithCurrency } from '../../../../utils/index.js';
4
- function BalanceCellSheet({ percentage, remainingAmount, currency, selectionProps }) {
4
+ function BalanceCellSheet({ remainingAmount, currency, selectionProps }) {
5
5
  const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
6
6
  const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
7
7
  const amount = `${integerAmount}.${decimalAmount}`;
8
- if (percentage === 0)
9
- return null;
10
- return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: 0, copyText: `${integerAmount}.${decimalAmount}`, selectionProps: selectionProps }, { children: [percentage, "% | Remaining balance - ", currencyIcon, " ", amount] })));
8
+ return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: 0, copyText: `${integerAmount}.${decimalAmount}`, selectionProps: selectionProps }, { children: [currencyIcon, " ", amount] })));
11
9
  }
12
10
  export default BalanceCellSheet;
@@ -1,4 +1,3 @@
1
1
  export { default as BalanceCell } from './BalanceCell';
2
2
  export { default as BalanceCellSheet } from './BalanceCellSheet';
3
- export { default as BalanceCellText } from './BalanceCellText';
4
3
  export * from './type';
@@ -1,4 +1,3 @@
1
1
  export { default as BalanceCell } from './BalanceCell';
2
2
  export { default as BalanceCellSheet } from './BalanceCellSheet';
3
- export { default as BalanceCellText } from './BalanceCellText';
4
3
  export * from './type';
@@ -1,7 +1,7 @@
1
1
  import { TableCellProps } from '@mui/material';
2
2
  import { SelectionProps } from '../../../../types/index.js';
3
3
  export interface BalanceCellCommonProps {
4
- percentage: number;
4
+ percentage?: number;
5
5
  remainingAmount?: number;
6
6
  currency?: string;
7
7
  }
@@ -17,7 +17,7 @@ export declare const authorizationTableCellWidth: {
17
17
  readonly balance: {
18
18
  readonly default: "60px";
19
19
  readonly text: "60px";
20
- readonly sheet: "250px";
20
+ readonly sheet: "150px";
21
21
  };
22
22
  readonly product: {
23
23
  readonly default: "85px";
@@ -17,7 +17,7 @@ export const authorizationTableCellWidth = {
17
17
  balance: {
18
18
  default: '60px',
19
19
  text: '60px',
20
- sheet: '250px',
20
+ sheet: '150px',
21
21
  },
22
22
  product: {
23
23
  default: '85px',
@@ -132,7 +132,7 @@ export declare const refundTableCellWidth: {
132
132
  readonly balance: {
133
133
  readonly default: "120px";
134
134
  readonly text: "150px";
135
- readonly sheet: "280px";
135
+ readonly sheet: "150px";
136
136
  };
137
137
  readonly status: {
138
138
  readonly default: "100px";
@@ -132,7 +132,7 @@ export const refundTableCellWidth = {
132
132
  balance: {
133
133
  default: '120px',
134
134
  text: '150px',
135
- sheet: '280px',
135
+ sheet: '150px',
136
136
  },
137
137
  status: {
138
138
  default: '100px',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.222",
4
+ "version": "0.1.223",
5
5
  "testVersion": 0,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
@@ -1,3 +0,0 @@
1
- import { BalanceCellProps } from './type';
2
- declare function BalanceCellText({ percentage, days, remainingAmount, currency, ...props }: BalanceCellProps): import("react/jsx-runtime").JSX.Element | null;
3
- export default BalanceCellText;
@@ -1,44 +0,0 @@
1
- var __rest = (this && this.__rest) || function (s, e) {
2
- var t = {};
3
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
- t[p] = s[p];
5
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
- t[p[i]] = s[p[i]];
9
- }
10
- return t;
11
- };
12
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { useMemo } from 'react';
14
- import { useTheme } from '@mui/material/styles';
15
- import Tooltip from '../../../Tooltip';
16
- import { TableCell } from '../../../TableCells';
17
- import { CurrencyIcon } from '../../../index.js';
18
- import { formatAmountWithCurrency } from '../../../../utils/index.js';
19
- import { BalanceCellContainer } from './style';
20
- import { TextLabel } from '../style';
21
- function BalanceCellText(_a) {
22
- var { percentage, days, remainingAmount, currency } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency"]);
23
- const theme = useTheme();
24
- const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
25
- const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
26
- const amount = `${integerAmount}.${decimalAmount}`;
27
- const generatedTooltip = useMemo(() => {
28
- return (_jsxs(_Fragment, { children: ["Remaining Authorized Balance - ", currencyIcon, " ", amount] }));
29
- }, [remainingAmount, currency]);
30
- if (percentage === 0)
31
- return null;
32
- return (_jsx(TableCell, Object.assign({}, props, { children: _jsx("div", Object.assign({ style: {
33
- display: 'flex',
34
- alignItems: 'center',
35
- justifyContent: 'flex-start',
36
- gap: '8px',
37
- } }, { children: _jsx(Tooltip, Object.assign({ title: generatedTooltip }, { children: _jsx(BalanceCellContainer, Object.assign({ whileHover: ['animate', 'fadeIn'], animate: "start", sx: {
38
- zIndex: 22,
39
- height: 'auto',
40
- padding: '0',
41
- backgroundColor: `${theme.palette.grey.A700}1a`,
42
- } }, { children: _jsxs(TextLabel, { children: [percentage, "%"] }) })) })) })) })));
43
- }
44
- export default BalanceCellText;