@tap-payments/os-micro-frontend-shared 0.1.70-test.21 → 0.1.70-test.22

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.
@@ -1,3 +1,3 @@
1
1
  import { BalanceCellProps } from './type';
2
- declare function BalanceCell({ percentage, days, remainingAmount, currency, isTextShown, ...props }: BalanceCellProps): import("react/jsx-runtime").JSX.Element;
2
+ declare function BalanceCell({ percentage, days, remainingAmount, currency, isTextShown, isSheetViewShown, selectionProps, ...props }: BalanceCellProps): import("react/jsx-runtime").JSX.Element;
3
3
  export default BalanceCell;
@@ -15,19 +15,23 @@ import { useTheme } from '@mui/material/styles';
15
15
  import { motion } from 'framer-motion';
16
16
  import Tooltip from '../../../Tooltip';
17
17
  import { TableCell } from '../../../TableCells';
18
- import { CurrencyIcon } from '../../../index.js';
18
+ import { CurrencyIcon, StatusChipWithCopy } from '../../../index.js';
19
19
  import { formatAmountWithCurrency } from '../../../../utils/index.js';
20
20
  import { BalanceCellContainer, PercentageContainer } from './style';
21
21
  import { formatPercentage } from './utils';
22
22
  import { TextLabel, PiePercentage } from '../style';
23
23
  function BalanceCell(_a) {
24
- var { percentage, days, remainingAmount, currency, isTextShown } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency", "isTextShown"]);
24
+ var { percentage, days, remainingAmount, currency, isTextShown, isSheetViewShown, selectionProps = {} } = _a, props = __rest(_a, ["percentage", "days", "remainingAmount", "currency", "isTextShown", "isSheetViewShown", "selectionProps"]);
25
25
  const theme = useTheme();
26
+ const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
27
+ const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
28
+ const amount = `${integerAmount}.${decimalAmount}`;
26
29
  const generatedTooltip = useMemo(() => {
27
- const { integerAmount, decimalAmount } = formatAmountWithCurrency(remainingAmount, currency);
28
- const currencyIcon = _jsx(CurrencyIcon, { currency: currency });
29
- return (_jsxs(_Fragment, { children: ["Remaining Authorized Balance - ", currencyIcon, " ", integerAmount, ".", decimalAmount] }));
30
+ return (_jsxs(_Fragment, { children: ["Remaining Authorized Balance - ", currencyIcon, " ", amount] }));
30
31
  }, [remainingAmount, currency]);
32
+ if (isSheetViewShown) {
33
+ return (_jsxs(StatusChipWithCopy, Object.assign({ chipIndex: 0, copyText: `${integerAmount}.${decimalAmount}`, selectionProps: selectionProps }, { children: [percentage, "% | Remaining balance - ", currencyIcon, " ", amount] })));
34
+ }
31
35
  return (_jsx(TableCell, Object.assign({}, props, { children: _jsx("div", Object.assign({ style: {
32
36
  display: 'flex',
33
37
  alignItems: 'center',
@@ -1,8 +1,11 @@
1
1
  import { TableCellProps } from '@mui/material';
2
+ import { SelectionProps } from '../../../../types/index.js';
2
3
  export interface BalanceCellProps extends TableCellProps {
3
4
  percentage: number;
4
5
  days?: number;
5
6
  remainingAmount?: number;
6
7
  currency?: string;
7
8
  isTextShown?: boolean;
9
+ isSheetViewShown?: boolean;
10
+ selectionProps?: SelectionProps;
8
11
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
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.70-test.21",
5
- "testVersion": 21,
4
+ "version": "0.1.70-test.22",
5
+ "testVersion": 22,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",