@tap-payments/os-micro-frontend-shared 0.1.63 → 0.1.65
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/LICENSE +21 -21
- package/README.md +12 -12
- package/build/components/ColorPicker/ColorPicker.d.ts +10 -0
- package/build/components/ColorPicker/ColorPicker.js +59 -0
- package/build/components/ColorPicker/index.d.ts +2 -0
- package/build/components/ColorPicker/index.js +2 -0
- package/build/components/ColorPicker/style.d.ts +14 -0
- package/build/components/ColorPicker/style.js +85 -0
- package/build/components/FileUploader/FileUploader.d.ts +1 -1
- package/build/components/FileUploader/FileUploader.js +3 -3
- package/build/components/FileUploader/type.d.ts +5 -0
- package/build/components/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.d.ts +1 -1
- package/build/components/RightLeftExpandingCenterChip/RightLeftExpandingCenterChip.js +40 -16
- package/build/components/RightLeftExpandingCenterChip/style.js +1 -4
- package/build/components/RightLeftExpandingCenterChip/type.d.ts +2 -1
- package/build/components/RightLeftExpandingCenterChip/useRightLeftExpandingCenterChip.d.ts +10 -5
- package/build/components/RightLeftExpandingCenterChip/useRightLeftExpandingCenterChip.js +36 -20
- package/build/components/index.d.ts +1 -0
- package/build/components/index.js +1 -0
- package/build/constants/assets.d.ts +9 -0
- package/build/constants/assets.js +9 -0
- package/build/constants/table/cell/refundTableCellWidth.d.ts +3 -3
- package/build/constants/table/cell/refundTableCellWidth.js +3 -3
- package/package.json +137 -135
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Tap Payments
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Tap Payments
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# os-micro-frontend-shared
|
|
2
|
-
|
|
3
|
-
## Publishing Workflow
|
|
4
|
-
|
|
5
|
-
1. Update version in package.json
|
|
6
|
-
2. Commit changes
|
|
7
|
-
3. Create and push a tag:
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm version patch # or minor, major
|
|
11
|
-
git push origin main --tags
|
|
12
|
-
```
|
|
1
|
+
# os-micro-frontend-shared
|
|
2
|
+
|
|
3
|
+
## Publishing Workflow
|
|
4
|
+
|
|
5
|
+
1. Update version in package.json
|
|
6
|
+
2. Commit changes
|
|
7
|
+
3. Create and push a tag:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm version patch # or minor, major
|
|
11
|
+
git push origin main --tags
|
|
12
|
+
```
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type SxProps } from '@mui/material/styles';
|
|
2
|
+
type ColorPickerProps = {
|
|
3
|
+
id: string;
|
|
4
|
+
value?: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
onReset?: () => void;
|
|
7
|
+
sx?: SxProps;
|
|
8
|
+
};
|
|
9
|
+
declare const ColorPicker: ({ id, value, onChange, onReset, sx }: ColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default ColorPicker;
|
|
@@ -0,0 +1,59 @@
|
|
|
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, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import { useCallback, useRef, useState } from 'react';
|
|
14
|
+
import { RgbaColorPicker } from 'react-colorful';
|
|
15
|
+
import { useTranslation } from 'react-i18next';
|
|
16
|
+
import Color from 'color';
|
|
17
|
+
import Box from '@mui/material/Box';
|
|
18
|
+
import ClickAwayListener from '@mui/material/ClickAwayListener';
|
|
19
|
+
import Divider from '@mui/material/Divider';
|
|
20
|
+
import Popper from '@mui/material/Popper';
|
|
21
|
+
import Stack from '@mui/material/Stack';
|
|
22
|
+
import Typography from '@mui/material/Typography';
|
|
23
|
+
import { CancelButton, ConfirmButton, Footer, StyledCloseButtonWrapper, StyledColorWidgetWrapper } from './style';
|
|
24
|
+
import { closeXIcon } from '../../constants/index.js';
|
|
25
|
+
const hexa2Rgba = (value) => {
|
|
26
|
+
const colorInstance = Color(value).rgb();
|
|
27
|
+
const { r, g, b, alpha = 1 } = colorInstance.object();
|
|
28
|
+
return {
|
|
29
|
+
value: { r, g, b, alpha },
|
|
30
|
+
stringified: `rgba(${r},${g},${b},${alpha})`,
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const rgba2Hexa = (value) => Color(value).hexa();
|
|
34
|
+
const ColorPicker = ({ id, value = '#ffffff', onChange, onReset, sx }) => {
|
|
35
|
+
const { t } = useTranslation();
|
|
36
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
37
|
+
const rootRef = useRef(null);
|
|
38
|
+
const [color, setColor] = useState(() => {
|
|
39
|
+
const _a = hexa2Rgba(value).value, { alpha: a } = _a, rest = __rest(_a, ["alpha"]);
|
|
40
|
+
return Object.assign(Object.assign({}, rest), { a });
|
|
41
|
+
});
|
|
42
|
+
const handleOpen = useCallback(() => {
|
|
43
|
+
setAnchorEl(rootRef.current);
|
|
44
|
+
const _a = hexa2Rgba(value).value, { alpha: a } = _a, rest = __rest(_a, ["alpha"]);
|
|
45
|
+
setColor(Object.assign(Object.assign({}, rest), { a }));
|
|
46
|
+
}, [value]);
|
|
47
|
+
const handleCancel = useCallback(() => {
|
|
48
|
+
const _a = hexa2Rgba(value).value, { alpha: a } = _a, rest = __rest(_a, ["alpha"]);
|
|
49
|
+
setColor(Object.assign(Object.assign({}, rest), { a }));
|
|
50
|
+
setAnchorEl(null);
|
|
51
|
+
}, [value]);
|
|
52
|
+
const handleConfirm = useCallback(() => {
|
|
53
|
+
const { a: alpha } = color, rest = __rest(color, ["a"]);
|
|
54
|
+
onChange(rgba2Hexa(Object.assign(Object.assign({}, rest), { alpha })));
|
|
55
|
+
setAnchorEl(null);
|
|
56
|
+
}, [onChange, color]);
|
|
57
|
+
return (_jsx(ClickAwayListener, Object.assign({ onClickAway: () => setAnchorEl(null) }, { children: _jsxs(Stack, Object.assign({ ref: rootRef, bgcolor: "grey.400", borderRadius: "4px", p: "4px", pr: "12px", direction: "row", justifyContent: "space-between", spacing: 1, alignItems: "center", className: "color-picker" }, { children: [_jsxs(Stack, Object.assign({ sx: sx, direction: "row", spacing: 1, alignItems: "center", className: "color-picker__controls-wrapper" }, { children: [_jsx(Box, { borderRadius: "5px", width: 32, height: 32, sx: { backgroundColor: value }, className: "color-picker__viewer" }), _jsxs(Box, Object.assign({ className: "color-picker__actions-wrapper" }, { children: [_jsx(Typography, Object.assign({ className: "color-picker__label", fontWeight: 500, fontSize: 9, color: "text.primary", textTransform: "uppercase" }, { children: value })), _jsx(Typography, Object.assign({ className: "color-picker__edit-btn", role: "button", onClick: handleOpen, htmlFor: id, fontWeight: 500, fontSize: 9, color: "info.dark", component: "label", sx: { textDecoration: 'underline', cursor: 'pointer' } }, { children: "Edit" }))] }))] })), _jsx(StyledCloseButtonWrapper, Object.assign({ className: "color-picker__close-btn", type: "button", onClick: onReset }, { children: _jsx(Box, { component: "img", src: closeXIcon, width: 10, height: 10 }) })), _jsx(Popper, Object.assign({ anchorEl: anchorEl, open: !!anchorEl, placement: "top" }, { children: _jsxs(StyledColorWidgetWrapper, Object.assign({ className: "color-picker__widget" }, { children: [_jsx(RgbaColorPicker, { color: color, onChange: setColor }), _jsx(Divider, { sx: { my: '12px' } }), _jsxs(Footer, Object.assign({ className: "color-picker__widget-actions" }, { children: [_jsx(CancelButton, Object.assign({ className: "color-picker__widget-actions__cancel", onClick: handleCancel }, { children: t('cancel') })), _jsx(ConfirmButton, Object.assign({ className: "color-picker__widget-actions__confirm", onClick: handleConfirm }, { children: t('okay') }))] }))] })) }))] })) })));
|
|
58
|
+
};
|
|
59
|
+
export default ColorPicker;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledCloseButtonWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, {}>;
|
|
3
|
+
export declare const StyledColorWidgetWrapper: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
4
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
5
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
6
|
+
export declare const Footer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
7
|
+
ref?: ((instance: HTMLDivElement | null) => void) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
8
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
9
|
+
export declare const ConfirmButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
10
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
11
|
+
}, "disabled" | "style" | "color" | "className" | "classes" | "tabIndex" | "children" | "sx" | "variant" | "size" | "fullWidth" | "href" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
12
|
+
export declare const CancelButton: import("@emotion/styled").StyledComponent<import("@mui/material").ButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
13
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
14
|
+
}, "disabled" | "style" | "color" | "className" | "classes" | "tabIndex" | "children" | "sx" | "variant" | "size" | "fullWidth" | "href" | "action" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "TouchRippleProps" | "touchRippleRef" | "disableElevation" | "disableFocusRipple" | "endIcon" | "startIcon"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Box, Button } from '@mui/material';
|
|
2
|
+
import { styled } from '@mui/material/styles';
|
|
3
|
+
export const StyledCloseButtonWrapper = styled('button')({
|
|
4
|
+
background: 'transparent',
|
|
5
|
+
border: 'none',
|
|
6
|
+
padding: 0,
|
|
7
|
+
margin: 0,
|
|
8
|
+
cursor: 'pointer',
|
|
9
|
+
width: 10,
|
|
10
|
+
height: 10,
|
|
11
|
+
display: 'flex',
|
|
12
|
+
justifyContent: 'center',
|
|
13
|
+
alignItems: 'center'
|
|
14
|
+
});
|
|
15
|
+
export const StyledColorWidgetWrapper = styled(Box)(({ theme }) => ({
|
|
16
|
+
boxShadow: '0px 8px 30px rgba(0, 0, 0, 0.16)',
|
|
17
|
+
minWidth: 264,
|
|
18
|
+
backgroundColor: '#ffffff',
|
|
19
|
+
padding: '12px',
|
|
20
|
+
borderRadius: theme.spacing(1),
|
|
21
|
+
'& .react-colorful': {
|
|
22
|
+
width: '100%',
|
|
23
|
+
'&__saturation': {
|
|
24
|
+
minHeight: 152,
|
|
25
|
+
borderRadius: '4px',
|
|
26
|
+
marginBottom: theme.spacing(2),
|
|
27
|
+
border: 0,
|
|
28
|
+
'&-pointer': {
|
|
29
|
+
width: 13,
|
|
30
|
+
height: 13
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
'&__hue': {
|
|
34
|
+
marginBottom: theme.spacing(2),
|
|
35
|
+
borderRadius: '4px',
|
|
36
|
+
height: '16px',
|
|
37
|
+
'&-pointer': {
|
|
38
|
+
width: 10,
|
|
39
|
+
height: 10
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
'&__alpha': {
|
|
43
|
+
border: 0,
|
|
44
|
+
borderRadius: '4px',
|
|
45
|
+
height: '16px',
|
|
46
|
+
'&-pointer': {
|
|
47
|
+
width: 10,
|
|
48
|
+
height: 10
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
export const Footer = styled(Box)(() => ({
|
|
54
|
+
display: 'flex',
|
|
55
|
+
gap: '8px',
|
|
56
|
+
justifyContent: 'flex-end'
|
|
57
|
+
}));
|
|
58
|
+
export const ConfirmButton = styled(Button)(({ theme }) => ({
|
|
59
|
+
textTransform: 'capitalize',
|
|
60
|
+
minWidth: 'auto',
|
|
61
|
+
width: 74,
|
|
62
|
+
borderRadius: '4px',
|
|
63
|
+
border: `1px solid ${theme.palette.info.dark}`,
|
|
64
|
+
backgroundColor: theme.palette.info.dark,
|
|
65
|
+
fontWeight: 700,
|
|
66
|
+
fontSize: '11px',
|
|
67
|
+
color: theme.palette.common.white,
|
|
68
|
+
'&:hover': {
|
|
69
|
+
backgroundColor: theme.palette.info.dark
|
|
70
|
+
}
|
|
71
|
+
}));
|
|
72
|
+
export const CancelButton = styled(Button)(({ theme }) => ({
|
|
73
|
+
textTransform: 'capitalize',
|
|
74
|
+
minWidth: 'auto',
|
|
75
|
+
width: 74,
|
|
76
|
+
borderRadius: '4px',
|
|
77
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
78
|
+
backgroundColor: theme.palette.common.white,
|
|
79
|
+
fontWeight: 500,
|
|
80
|
+
fontSize: '11px',
|
|
81
|
+
color: theme.palette.text.primary,
|
|
82
|
+
'&:hover': {
|
|
83
|
+
background: 'transparent'
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { FileUploaderComponentProps } from './type';
|
|
2
|
-
declare const FileUploader: ({ getRootProps, getInputProps, open, onChangeFiles, processFiles, disabled, errorMessage, maxFileSize, preventDuplicates, }: FileUploaderComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
declare const FileUploader: ({ getRootProps, getInputProps, open, onChangeFiles, processFiles, disabled, errorMessage, maxFileSize, preventDuplicates, label, hintText, sx, }: FileUploaderComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default FileUploader;
|
|
@@ -2,12 +2,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import Box from '@mui/material/Box';
|
|
3
3
|
import { redVerifyIcon, uploadBlueIcon } from '../../constants/index.js';
|
|
4
4
|
import { Content, ErrorMessage, StyledFileUploader, IconWrapper, Maximum, TextWrapper, Upload } from './style';
|
|
5
|
-
const FileUploader = ({ getRootProps, getInputProps, open, onChangeFiles, processFiles, disabled, errorMessage, maxFileSize, preventDuplicates, }) => {
|
|
6
|
-
return (_jsxs(StyledFileUploader, Object.assign({}, getRootProps(), { onClick: open }, { children: [_jsx("input", Object.assign({}, getInputProps(), { onChange: (e) => {
|
|
5
|
+
const FileUploader = ({ getRootProps, getInputProps, open, onChangeFiles, processFiles, disabled, errorMessage, maxFileSize, preventDuplicates, label = 'Click to upload', hintText, sx, }) => {
|
|
6
|
+
return (_jsxs(StyledFileUploader, Object.assign({}, getRootProps(), { sx: sx, onClick: open }, { children: [_jsx("input", Object.assign({ "data-slot": "input" }, getInputProps(), { onChange: (e) => {
|
|
7
7
|
const processedFiles = processFiles(Array.from(e.target.files || []));
|
|
8
8
|
if (processedFiles.length > 0 || !preventDuplicates) {
|
|
9
9
|
onChangeFiles(processedFiles);
|
|
10
10
|
}
|
|
11
|
-
}, disabled: disabled })), _jsxs(Content, { children: [_jsx(IconWrapper, { children: _jsx(Box, { component: "img", src: errorMessage ? redVerifyIcon : uploadBlueIcon, width: 16, height: 16 }) }), errorMessage ? (_jsxs(TextWrapper, { children: [_jsx(ErrorMessage, { children: errorMessage }), _jsx(Upload, { children: "Click to upload again" })] })) : (_jsxs(TextWrapper, { children: [_jsx(Upload, { children:
|
|
11
|
+
}, disabled: disabled })), _jsxs(Content, Object.assign({ "data-slot": "content" }, { children: [_jsx(IconWrapper, Object.assign({ "data-slot": "icon-wrapper" }, { children: _jsx(Box, { component: "img", src: errorMessage ? redVerifyIcon : uploadBlueIcon, width: 16, height: 16 }) })), errorMessage ? (_jsxs(TextWrapper, { children: [_jsx(ErrorMessage, { children: errorMessage }), _jsx(Upload, { children: "Click to upload again" })] })) : (_jsxs(TextWrapper, { children: [_jsx(Upload, { children: label }), _jsx(Maximum, { children: hintText || `PDF, JPG or PNG files up to ${maxFileSize}` })] }))] }))] })));
|
|
12
12
|
};
|
|
13
13
|
export default FileUploader;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import type { DropzoneInputProps, DropzoneRootProps } from 'react-dropzone';
|
|
2
3
|
import type { FileType } from '../../types/index.js';
|
|
4
|
+
import { SxProps, Theme } from '@mui/material/styles';
|
|
3
5
|
export interface FileUploaderComponentProps {
|
|
4
6
|
getRootProps: <T extends DropzoneRootProps>(props?: T | undefined) => T;
|
|
5
7
|
getInputProps: <T extends DropzoneInputProps>(props?: T | undefined) => T;
|
|
@@ -10,4 +12,7 @@ export interface FileUploaderComponentProps {
|
|
|
10
12
|
errorMessage?: string;
|
|
11
13
|
maxFileSize: string;
|
|
12
14
|
preventDuplicates?: boolean;
|
|
15
|
+
label?: React.ReactNode;
|
|
16
|
+
hintText?: React.ReactNode;
|
|
17
|
+
sx?: SxProps<Theme>;
|
|
13
18
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { RightLeftExpandingCenterChipProps } from './type';
|
|
2
|
-
declare function RightLeftExpandingCenterChip({ leftIcons, rightIcons, centerIcon,
|
|
2
|
+
declare function RightLeftExpandingCenterChip({ leftIcons, rightIcons, centerIcon, expandableCenterRight, expandableCenterLeft, expandedZIndex, ...props }: Readonly<RightLeftExpandingCenterChipProps>): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default RightLeftExpandingCenterChip;
|
|
@@ -15,22 +15,45 @@ import { AnimatePresence } from 'framer-motion';
|
|
|
15
15
|
import { CenterIconWrapper, ExpandedSection, PeekContainer, CenterChip, LeftPeekChip, RightPeekChip, LeftExpandIcon, RightExpandIcon, ExpandChip, CenterShiftWrapper, CenterContent, ExpandableContainer, ExpandableInner, tableCellSx, CHIP_GAP, HoverBridge, } from './style';
|
|
16
16
|
import { useRightLeftExpandingCenterChip, DEFAULT_CHIP_MIN_WIDTH } from './useRightLeftExpandingCenterChip';
|
|
17
17
|
function RightLeftExpandingCenterChip(_a) {
|
|
18
|
-
var { leftIcons = [], rightIcons = [], centerIcon,
|
|
19
|
-
const { isHovering, handleMouseEnter, handleMouseLeave, centerWrapRef, centerContentRef, centerChipRef, anchors, leftChipRefs, rightChipRefs, leftOffsets, rightOffsets,
|
|
18
|
+
var { leftIcons = [], rightIcons = [], centerIcon, expandableCenterRight, expandableCenterLeft, expandedZIndex = 1000 } = _a, props = __rest(_a, ["leftIcons", "rightIcons", "centerIcon", "expandableCenterRight", "expandableCenterLeft", "expandedZIndex"]);
|
|
19
|
+
const { isHovering, handleMouseEnter, handleMouseLeave, centerWrapRef, centerContentRef, centerChipRef, anchors, leftChipRefs, rightChipRefs, leftOffsets, rightOffsets, expandableRightInnerRef, expandableLeftInnerRef, expandedRightMV, expandedLeftMV, shiftX, rightShift, leftShift, leftHoverWidth, rightHoverWidth, } = useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerIcon, expandableCenterRight, expandableCenterLeft });
|
|
20
20
|
return (_jsx(Box, Object.assign({}, props, { "data-testid": "RightLeftExpandingCenterChipBox", sx: tableCellSx }, { children: _jsx(CenterShiftWrapper, Object.assign({ "data-testid": "CenterShiftWrapper", initial: false, style: { x: shiftX } }, { children: _jsxs(CenterIconWrapper, Object.assign({ "data-testid": "CenterIconWrapper", ref: centerWrapRef, onMouseLeave: handleMouseLeave }, { children: [_jsxs(PeekContainer, Object.assign({ "data-testid": "PeekContainer" }, { children: [_jsx(AnimatePresence, Object.assign({ initial: false }, { children: leftIcons.length > 0 && (_jsx(LeftPeekChip, { "data-testid": "LeftPeekChip", initial: { opacity: 0, scale: 0.95, x: -4 }, animate: isHovering ? { opacity: 0, scale: 0.9, x: -6 } : { opacity: 1, scale: 1, x: -5 }, exit: { opacity: 0, scale: 0.95, x: -4 }, transition: { duration: 0.18, ease: 'easeOut' } }, "left-peek")) })), _jsx(CenterChip, Object.assign({ "data-testid": "CenterChip", ref: centerChipRef, onMouseEnter: handleMouseEnter, style: {
|
|
21
|
-
borderRadius:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
21
|
+
borderRadius: (() => {
|
|
22
|
+
const hasLeftExpanded = expandableCenterLeft && isHovering;
|
|
23
|
+
const hasRightExpanded = expandableCenterRight && isHovering;
|
|
24
|
+
if (hasLeftExpanded && hasRightExpanded)
|
|
25
|
+
return '0';
|
|
26
|
+
if (hasLeftExpanded)
|
|
27
|
+
return '0 12px 12px 0';
|
|
28
|
+
if (hasRightExpanded)
|
|
29
|
+
return '12px 0 0 12px';
|
|
30
|
+
return '12px';
|
|
31
|
+
})(),
|
|
32
|
+
borderLeft: expandableCenterLeft && isHovering ? 'none' : undefined,
|
|
33
|
+
borderRight: expandableCenterRight && isHovering ? 'none' : undefined,
|
|
34
|
+
} }, { children: _jsx(CenterContent, Object.assign({ "data-testid": "CenterContent", ref: centerContentRef }, { children: centerIcon })) })), expandableCenterLeft && (_jsx(ExpandableContainer, Object.assign({ "data-testid": "ExpandableLeftContainer", style: {
|
|
35
|
+
width: expandedLeftMV,
|
|
36
|
+
position: 'absolute',
|
|
37
|
+
right: '100%',
|
|
38
|
+
top: 0,
|
|
39
|
+
height: '24px',
|
|
40
|
+
zIndex: 1,
|
|
41
|
+
opacity: isHovering ? 1 : 0,
|
|
42
|
+
pointerEvents: isHovering ? 'auto' : 'none',
|
|
43
|
+
borderRadius: '12px 0 0 12px',
|
|
44
|
+
borderRight: 'none',
|
|
45
|
+
}, initial: false, transition: { duration: 0.2, ease: 'easeOut' } }, { children: _jsx(ExpandableInner, Object.assign({ "data-testid": "ExpandableLeftInner", ref: expandableLeftInnerRef }, { children: expandableCenterLeft })) }))), expandableCenterRight && (_jsx(ExpandableContainer, Object.assign({ "data-testid": "ExpandableRightContainer", style: {
|
|
46
|
+
width: expandedRightMV,
|
|
47
|
+
position: 'absolute',
|
|
48
|
+
left: '100%',
|
|
49
|
+
top: 0,
|
|
50
|
+
height: '24px',
|
|
51
|
+
zIndex: 1,
|
|
52
|
+
opacity: isHovering ? 1 : 0,
|
|
53
|
+
pointerEvents: isHovering ? 'auto' : 'none',
|
|
54
|
+
borderRadius: '0 12px 12px 0',
|
|
55
|
+
borderLeft: 'none',
|
|
56
|
+
}, initial: false, transition: { duration: 0.2, ease: 'easeOut' } }, { children: _jsx(ExpandableInner, Object.assign({ "data-testid": "ExpandableRightInner", ref: expandableRightInnerRef }, { children: expandableCenterRight })) }))), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: rightIcons.length > 0 && (_jsx(RightPeekChip, { "data-testid": "RightPeekChip", initial: { opacity: 0, scale: 0.95, x: 4 }, animate: isHovering ? { opacity: 0, scale: 0.9, x: 6 } : { opacity: 1, scale: 1, x: 5 }, exit: { opacity: 0, scale: 0.95, x: 4 }, transition: { duration: 0.18, ease: 'easeOut' } }, "right-peek")) }))] })), isHovering && leftIcons.length > 0 && (_jsx(HoverBridge, { "data-testid": "LeftHoverBridge", side: "left", style: { width: leftHoverWidth, right: `calc(100% - ${anchors.left}px)`, zIndex: expandedZIndex, pointerEvents: 'auto' } })), isHovering && rightIcons.length > 0 && (_jsx(HoverBridge, { "data-testid": "RightHoverBridge", side: "right", style: { width: rightHoverWidth, left: `${anchors.right}px`, zIndex: expandedZIndex, pointerEvents: 'auto' } })), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: leftIcons.length > 0 && (_jsx(ExpandedSection, Object.assign({ "data-testid": "LeftExpandedSection", side: "left", style: {
|
|
34
57
|
right: `calc(100% - ${anchors.left}px)`,
|
|
35
58
|
top: '50%',
|
|
36
59
|
position: 'absolute',
|
|
@@ -39,7 +62,8 @@ function RightLeftExpandingCenterChip(_a) {
|
|
|
39
62
|
}, initial: { opacity: 0, x: 0, y: '-50%' }, animate: isHovering ? { opacity: 1, x: 0, y: '-50%' } : { opacity: 0, x: 0, y: '-50%' }, exit: { opacity: 0, x: 0, y: '-50%' }, transition: { duration: 0.25, ease: 'easeOut' } }, { children: leftIcons.map((icon, index) => {
|
|
40
63
|
var _a;
|
|
41
64
|
const leftOffset = (_a = leftOffsets[index]) !== null && _a !== void 0 ? _a : (DEFAULT_CHIP_MIN_WIDTH + CHIP_GAP) * (index + 1);
|
|
42
|
-
|
|
65
|
+
const totalOffset = leftOffset + leftShift;
|
|
66
|
+
return (_jsx(LeftExpandIcon, Object.assign({ "data-testid": `LeftExpandIcon-${index}`, initial: { opacity: 0, x: 0 }, animate: isHovering ? { opacity: 1, x: -totalOffset } : { opacity: 0, x: 0 }, exit: { opacity: 0, x: 0 }, transition: { duration: 0.25 + index * 0.04, ease: 'easeOut' }, style: { zIndex: expandedZIndex + (leftIcons.length - index) } }, { children: _jsx(ExpandChip, Object.assign({ "data-testid": `LeftExpandChip-${index}`, ref: (el) => (leftChipRefs.current[index] = el) }, { children: icon })) }), `left-${index}`));
|
|
43
67
|
}) }), "left-expanded")) })), _jsx(AnimatePresence, Object.assign({ initial: false }, { children: rightIcons.length > 0 && (_jsx(ExpandedSection, Object.assign({ "data-testid": "RightExpandedSection", side: "right", style: {
|
|
44
68
|
left: `${anchors.right}px`,
|
|
45
69
|
top: '50%',
|
|
@@ -85,17 +85,14 @@ export const ExpandableContainer = styled(motion.span)(({ theme }) => ({
|
|
|
85
85
|
boxSizing: 'border-box',
|
|
86
86
|
willChange: 'width',
|
|
87
87
|
border: `1px solid ${theme.palette.divider}`,
|
|
88
|
-
borderLeft: 'none',
|
|
89
|
-
borderRadius: '0 12px 12px 0',
|
|
90
88
|
backgroundColor: theme.palette.background.paper,
|
|
91
89
|
height: '24px',
|
|
92
90
|
alignItems: 'center',
|
|
91
|
+
paddingInline: '0px',
|
|
93
92
|
}));
|
|
94
93
|
export const ExpandableInner = styled(motion.span)(() => ({
|
|
95
94
|
display: 'inline-flex',
|
|
96
95
|
whiteSpace: 'nowrap',
|
|
97
|
-
paddingLeft: '1px',
|
|
98
|
-
paddingRight: '8px',
|
|
99
96
|
alignItems: 'center',
|
|
100
97
|
height: '100%',
|
|
101
98
|
}));
|
|
@@ -4,7 +4,8 @@ export interface RightLeftExpandingCenterChipProps {
|
|
|
4
4
|
leftIcons?: React.ReactNode[];
|
|
5
5
|
rightIcons?: React.ReactNode[];
|
|
6
6
|
centerIcon: React.ReactNode;
|
|
7
|
-
|
|
7
|
+
expandableCenterRight?: React.ReactNode;
|
|
8
|
+
expandableCenterLeft?: React.ReactNode;
|
|
8
9
|
sx?: SxProps;
|
|
9
10
|
expandedZIndex?: number;
|
|
10
11
|
}
|
|
@@ -4,9 +4,10 @@ export type UseRightLeftExpandingCenterChipArgs = {
|
|
|
4
4
|
leftIcons: ReactNode[];
|
|
5
5
|
rightIcons: ReactNode[];
|
|
6
6
|
centerIcon: ReactNode;
|
|
7
|
-
|
|
7
|
+
expandableCenterRight?: ReactNode;
|
|
8
|
+
expandableCenterLeft?: ReactNode;
|
|
8
9
|
};
|
|
9
|
-
export declare function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerIcon,
|
|
10
|
+
export declare function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerIcon, expandableCenterRight, expandableCenterLeft, }: UseRightLeftExpandingCenterChipArgs): {
|
|
10
11
|
isHovering: boolean;
|
|
11
12
|
handleMouseEnter: () => void;
|
|
12
13
|
handleMouseLeave: () => void;
|
|
@@ -21,11 +22,15 @@ export declare function useRightLeftExpandingCenterChip({ leftIcons, rightIcons,
|
|
|
21
22
|
rightChipRefs: import("react").MutableRefObject<(HTMLDivElement | null)[]>;
|
|
22
23
|
leftOffsets: number[];
|
|
23
24
|
rightOffsets: number[];
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
expandableRightInnerRef: import("react").MutableRefObject<HTMLSpanElement | null>;
|
|
26
|
+
expandableLeftInnerRef: import("react").MutableRefObject<HTMLSpanElement | null>;
|
|
27
|
+
expandableRightWidth: number;
|
|
28
|
+
expandableLeftWidth: number;
|
|
29
|
+
expandedRightMV: import("framer-motion").MotionValue<number>;
|
|
30
|
+
expandedLeftMV: import("framer-motion").MotionValue<number>;
|
|
27
31
|
shiftX: import("framer-motion").MotionValue<number>;
|
|
28
32
|
rightShift: number;
|
|
33
|
+
leftShift: number;
|
|
29
34
|
leftHoverWidth: number;
|
|
30
35
|
rightHoverWidth: number;
|
|
31
36
|
};
|
|
@@ -2,19 +2,21 @@ import { useRef, useEffect, useState, useMemo, useCallback, useLayoutEffect } fr
|
|
|
2
2
|
import { animate, useMotionValue } from 'framer-motion';
|
|
3
3
|
import { CHIP_GAP } from './style';
|
|
4
4
|
export const DEFAULT_CHIP_MIN_WIDTH = 24;
|
|
5
|
-
export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerIcon,
|
|
5
|
+
export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerIcon, expandableCenterRight, expandableCenterLeft, }) {
|
|
6
6
|
const [isHovering, setIsHovering] = useState(false);
|
|
7
7
|
const [anchors, setAnchors] = useState({ left: 0, right: 0 });
|
|
8
8
|
const [leftWidths, setLeftWidths] = useState([]);
|
|
9
9
|
const [rightWidths, setRightWidths] = useState([]);
|
|
10
|
-
const [
|
|
10
|
+
const [expandableRightWidth, setExpandableRightWidth] = useState(0);
|
|
11
|
+
const [expandableLeftWidth, setExpandableLeftWidth] = useState(0);
|
|
11
12
|
const hoverTimeoutRef = useRef(null);
|
|
12
13
|
const centerWrapRef = useRef(null);
|
|
13
14
|
const centerContentRef = useRef(null);
|
|
14
15
|
const centerChipRef = useRef(null);
|
|
15
16
|
const leftChipRefs = useRef([]);
|
|
16
17
|
const rightChipRefs = useRef([]);
|
|
17
|
-
const
|
|
18
|
+
const expandableRightInnerRef = useRef(null);
|
|
19
|
+
const expandableLeftInnerRef = useRef(null);
|
|
18
20
|
const resizeRaf = useRef(null);
|
|
19
21
|
const arraysEqual = useCallback((a, b) => {
|
|
20
22
|
if (a === b)
|
|
@@ -29,7 +31,8 @@ export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerI
|
|
|
29
31
|
const anchorsEqual = useCallback((a, b) => {
|
|
30
32
|
return a.left === b.left && a.right === b.right;
|
|
31
33
|
}, []);
|
|
32
|
-
const
|
|
34
|
+
const expandedRightMV = useMotionValue(0);
|
|
35
|
+
const expandedLeftMV = useMotionValue(0);
|
|
33
36
|
const shiftX = useMotionValue(0);
|
|
34
37
|
const leftOffsets = useMemo(() => {
|
|
35
38
|
if (!leftWidths.length)
|
|
@@ -55,8 +58,9 @@ export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerI
|
|
|
55
58
|
}
|
|
56
59
|
return acc;
|
|
57
60
|
}, [rightWidths]);
|
|
58
|
-
const rightShift = isHovering &&
|
|
59
|
-
const
|
|
61
|
+
const rightShift = isHovering && expandableCenterRight ? expandableRightWidth : 0;
|
|
62
|
+
const leftShift = isHovering && expandableCenterLeft ? expandableLeftWidth : 0;
|
|
63
|
+
const maxRightShift = expandableCenterRight ? expandableRightWidth : 0;
|
|
60
64
|
const handleMouseEnter = useCallback(() => {
|
|
61
65
|
if (hoverTimeoutRef.current)
|
|
62
66
|
clearTimeout(hoverTimeoutRef.current);
|
|
@@ -68,7 +72,7 @@ export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerI
|
|
|
68
72
|
hoverTimeoutRef.current = setTimeout(() => setIsHovering(false), 120);
|
|
69
73
|
}, []);
|
|
70
74
|
const measureAll = useCallback(() => {
|
|
71
|
-
var _a, _b, _c;
|
|
75
|
+
var _a, _b, _c, _d, _e;
|
|
72
76
|
const wrap = centerWrapRef.current;
|
|
73
77
|
const chip = centerChipRef.current;
|
|
74
78
|
const content = centerContentRef.current;
|
|
@@ -84,16 +88,19 @@ export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerI
|
|
|
84
88
|
}
|
|
85
89
|
const nextLeftWidths = leftChipRefs.current.map((el) => (el ? el.offsetWidth : DEFAULT_CHIP_MIN_WIDTH));
|
|
86
90
|
const nextRightWidths = rightChipRefs.current.map((el) => (el ? el.offsetWidth : DEFAULT_CHIP_MIN_WIDTH));
|
|
87
|
-
const
|
|
91
|
+
const nextExpandableRightWidth = (_c = (_b = expandableRightInnerRef.current) === null || _b === void 0 ? void 0 : _b.scrollWidth) !== null && _c !== void 0 ? _c : 0;
|
|
92
|
+
const nextExpandableLeftWidth = (_e = (_d = expandableLeftInnerRef.current) === null || _d === void 0 ? void 0 : _d.scrollWidth) !== null && _e !== void 0 ? _e : 0;
|
|
88
93
|
if (!anchorsEqual(anchors, nextAnchors))
|
|
89
94
|
setAnchors(nextAnchors);
|
|
90
95
|
if (!arraysEqual(leftWidths, nextLeftWidths))
|
|
91
96
|
setLeftWidths(nextLeftWidths);
|
|
92
97
|
if (!arraysEqual(rightWidths, nextRightWidths))
|
|
93
98
|
setRightWidths(nextRightWidths);
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
if (expandableRightWidth !== nextExpandableRightWidth)
|
|
100
|
+
setExpandableRightWidth(nextExpandableRightWidth);
|
|
101
|
+
if (expandableLeftWidth !== nextExpandableLeftWidth)
|
|
102
|
+
setExpandableLeftWidth(nextExpandableLeftWidth);
|
|
103
|
+
}, [anchors, leftWidths, rightWidths, expandableRightWidth, expandableLeftWidth, anchorsEqual, arraysEqual]);
|
|
97
104
|
const onResize = useCallback(() => {
|
|
98
105
|
if (resizeRaf.current)
|
|
99
106
|
cancelAnimationFrame(resizeRaf.current);
|
|
@@ -109,7 +116,7 @@ export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerI
|
|
|
109
116
|
}, []);
|
|
110
117
|
useLayoutEffect(() => {
|
|
111
118
|
measureAll();
|
|
112
|
-
}, [centerIcon, leftIcons, rightIcons,
|
|
119
|
+
}, [centerIcon, leftIcons, rightIcons, expandableCenterRight, expandableCenterLeft, measureAll]);
|
|
113
120
|
useEffect(() => {
|
|
114
121
|
onResize();
|
|
115
122
|
window.addEventListener('resize', onResize);
|
|
@@ -120,19 +127,24 @@ export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerI
|
|
|
120
127
|
};
|
|
121
128
|
}, [onResize]);
|
|
122
129
|
useEffect(() => {
|
|
123
|
-
const target = isHovering &&
|
|
124
|
-
const controls = animate(
|
|
130
|
+
const target = isHovering && expandableCenterRight ? expandableRightWidth : 0;
|
|
131
|
+
const controls = animate(expandedRightMV, target, { duration: 0.2, ease: 'easeOut' });
|
|
125
132
|
return () => controls.stop();
|
|
126
|
-
}, [isHovering,
|
|
133
|
+
}, [isHovering, expandableCenterRight, expandableRightWidth, expandedRightMV]);
|
|
134
|
+
useEffect(() => {
|
|
135
|
+
const target = isHovering && expandableCenterLeft ? expandableLeftWidth : 0;
|
|
136
|
+
const controls = animate(expandedLeftMV, target, { duration: 0.2, ease: 'easeOut' });
|
|
137
|
+
return () => controls.stop();
|
|
138
|
+
}, [isHovering, expandableCenterLeft, expandableLeftWidth, expandedLeftMV]);
|
|
127
139
|
const leftHoverWidth = useMemo(() => {
|
|
128
140
|
var _a;
|
|
129
141
|
if (!leftOffsets.length)
|
|
130
142
|
return 0;
|
|
131
143
|
const last = leftOffsets.length - 1;
|
|
132
144
|
const lastWidth = (_a = leftWidths[last]) !== null && _a !== void 0 ? _a : DEFAULT_CHIP_MIN_WIDTH;
|
|
133
|
-
const farthest = leftOffsets[last] + lastWidth / 2;
|
|
145
|
+
const farthest = leftOffsets[last] + lastWidth / 2 + leftShift;
|
|
134
146
|
return farthest + CHIP_GAP;
|
|
135
|
-
}, [leftOffsets, leftWidths]);
|
|
147
|
+
}, [leftOffsets, leftWidths, leftShift]);
|
|
136
148
|
const rightHoverWidth = useMemo(() => {
|
|
137
149
|
var _a;
|
|
138
150
|
if (!rightOffsets.length)
|
|
@@ -154,11 +166,15 @@ export function useRightLeftExpandingCenterChip({ leftIcons, rightIcons, centerI
|
|
|
154
166
|
rightChipRefs,
|
|
155
167
|
leftOffsets,
|
|
156
168
|
rightOffsets,
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
169
|
+
expandableRightInnerRef,
|
|
170
|
+
expandableLeftInnerRef,
|
|
171
|
+
expandableRightWidth,
|
|
172
|
+
expandableLeftWidth,
|
|
173
|
+
expandedRightMV,
|
|
174
|
+
expandedLeftMV,
|
|
160
175
|
shiftX,
|
|
161
176
|
rightShift,
|
|
177
|
+
leftShift,
|
|
162
178
|
leftHoverWidth,
|
|
163
179
|
rightHoverWidth,
|
|
164
180
|
};
|
|
@@ -525,3 +525,12 @@ export declare const exclamationOutlinedCircle: string;
|
|
|
525
525
|
export declare const outlinedCircle: string;
|
|
526
526
|
export declare const greenCheck2ACE00: string;
|
|
527
527
|
export declare const blueCopyIcon: string;
|
|
528
|
+
export declare const blackLinkIcon: string;
|
|
529
|
+
export declare const blackSettingsIcon: string;
|
|
530
|
+
export declare const blackWallet: string;
|
|
531
|
+
export declare const blueGradientBrushIcon: string;
|
|
532
|
+
export declare const gadientLink: string;
|
|
533
|
+
export declare const gradientSettings: string;
|
|
534
|
+
export declare const gradientWallet: string;
|
|
535
|
+
export declare const manyCurrencyCoin: string;
|
|
536
|
+
export declare const manyCurrencyCoinGradient: string;
|
|
@@ -529,3 +529,12 @@ export const exclamationOutlinedCircle = `${lightUrl}/exclamationOutlinedCircle.
|
|
|
529
529
|
export const outlinedCircle = `${lightUrl}/outlinedCircle.svg`;
|
|
530
530
|
export const greenCheck2ACE00 = `${lightUrl}/greenCheck2ACE00.svg`;
|
|
531
531
|
export const blueCopyIcon = `${lightUrl}/blueCopyIcon.svg`;
|
|
532
|
+
export const blackLinkIcon = `${lightUrl}/blackLinkIcon.svg`;
|
|
533
|
+
export const blackSettingsIcon = `${lightUrl}/blackSettingsIcon.svg`;
|
|
534
|
+
export const blackWallet = `${lightUrl}/blackWallet.svg`;
|
|
535
|
+
export const blueGradientBrushIcon = `${lightUrl}/blueGradientBrushIcon.svg`;
|
|
536
|
+
export const gadientLink = `${lightUrl}/gadientLink.svg`;
|
|
537
|
+
export const gradientSettings = `${lightUrl}/gradientSettings.svg`;
|
|
538
|
+
export const gradientWallet = `${lightUrl}/gradientWallet.svg`;
|
|
539
|
+
export const manyCurrencyCoin = `${lightUrl}/manyCurrencyCoin.svg`;
|
|
540
|
+
export const manyCurrencyCoinGradient = `${lightUrl}/manyCurrencyCoinGradient.svg`;
|
|
@@ -70,9 +70,9 @@ export declare const refundTableCellWidth: {
|
|
|
70
70
|
readonly sheet: "100px";
|
|
71
71
|
};
|
|
72
72
|
readonly merchant: {
|
|
73
|
-
readonly default: "
|
|
74
|
-
readonly text: "
|
|
75
|
-
readonly sheet: "
|
|
73
|
+
readonly default: "110px";
|
|
74
|
+
readonly text: "150px";
|
|
75
|
+
readonly sheet: "150px";
|
|
76
76
|
};
|
|
77
77
|
readonly reference: {
|
|
78
78
|
readonly default: "95px";
|
package/package.json
CHANGED
|
@@ -1,135 +1,137 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
-
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
-
"version": "0.1.
|
|
5
|
-
"testVersion":
|
|
6
|
-
"type": "module",
|
|
7
|
-
"main": "build/index.js",
|
|
8
|
-
"module": "build/index.js",
|
|
9
|
-
"types": "build/index.d.ts",
|
|
10
|
-
"exports": {
|
|
11
|
-
".": {
|
|
12
|
-
"types": "./build/index.d.ts",
|
|
13
|
-
"import": "./build/index.js",
|
|
14
|
-
"require": "./build/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./constants": {
|
|
17
|
-
"types": "./build/constants/index.d.ts",
|
|
18
|
-
"import": "./build/constants/index.js",
|
|
19
|
-
"require": "./build/constants/index.js"
|
|
20
|
-
},
|
|
21
|
-
"./components": {
|
|
22
|
-
"types": "./build/components/index.d.ts",
|
|
23
|
-
"import": "./build/components/index.js",
|
|
24
|
-
"require": "./build/components/index.js"
|
|
25
|
-
},
|
|
26
|
-
"./components/*": {
|
|
27
|
-
"types": "./build/components/*/index.d.ts",
|
|
28
|
-
"import": "./build/components/*/index.js",
|
|
29
|
-
"require": "./build/components/*/index.js"
|
|
30
|
-
},
|
|
31
|
-
"./hooks": {
|
|
32
|
-
"types": "./build/hooks/index.d.ts",
|
|
33
|
-
"import": "./build/hooks/index.js",
|
|
34
|
-
"require": "./build/hooks/index.js"
|
|
35
|
-
},
|
|
36
|
-
"./utils": {
|
|
37
|
-
"types": "./build/utils/index.d.ts",
|
|
38
|
-
"import": "./build/utils/index.js",
|
|
39
|
-
"require": "./build/utils/index.js"
|
|
40
|
-
},
|
|
41
|
-
"./theme": {
|
|
42
|
-
"types": "./build/theme/index.d.ts",
|
|
43
|
-
"import": "./build/theme/index.js",
|
|
44
|
-
"require": "./build/theme/index.js"
|
|
45
|
-
},
|
|
46
|
-
"./types": {
|
|
47
|
-
"types": "./build/types/index.d.ts",
|
|
48
|
-
"import": "./build/types/index.js",
|
|
49
|
-
"require": "./build/types/index.js"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"license": "MIT",
|
|
53
|
-
"author": {
|
|
54
|
-
"name": "Ahmed Sharkawy",
|
|
55
|
-
"email": "a.elsharkawy@tap.company"
|
|
56
|
-
},
|
|
57
|
-
"files": [
|
|
58
|
-
"build",
|
|
59
|
-
"readme.md"
|
|
60
|
-
],
|
|
61
|
-
"scripts": {
|
|
62
|
-
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
63
|
-
"push:local": "yarn ts:build && yalc publish --push",
|
|
64
|
-
"push": "npm run ts:build && npm publish --access public",
|
|
65
|
-
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
66
|
-
"dev": "vite",
|
|
67
|
-
"build": "tsc -b && vite build ",
|
|
68
|
-
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
69
|
-
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
70
|
-
"lint": "eslint . --color",
|
|
71
|
-
"lint:fix": "eslint src --fix --color",
|
|
72
|
-
"preview": "vite preview",
|
|
73
|
-
"prepare": "husky"
|
|
74
|
-
},
|
|
75
|
-
"dependencies": {
|
|
76
|
-
"@emotion/react": "^11.11.0",
|
|
77
|
-
"@emotion/styled": "^11.11.0",
|
|
78
|
-
"@hookform/resolvers": "^3.3.1",
|
|
79
|
-
"@mui/material": "^5.12.3",
|
|
80
|
-
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
81
|
-
"axios": "^1.4.0",
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"
|
|
88
|
-
"react
|
|
89
|
-
"react-
|
|
90
|
-
"react-
|
|
91
|
-
"react-
|
|
92
|
-
"react-
|
|
93
|
-
"react-
|
|
94
|
-
"react-
|
|
95
|
-
"react-
|
|
96
|
-
"react-
|
|
97
|
-
"react-
|
|
98
|
-
"react-
|
|
99
|
-
"react-
|
|
100
|
-
"
|
|
101
|
-
"
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
"@
|
|
107
|
-
"@
|
|
108
|
-
"@types/
|
|
109
|
-
"@types/react
|
|
110
|
-
"@types/react-
|
|
111
|
-
"@types/react-
|
|
112
|
-
"@
|
|
113
|
-
"
|
|
114
|
-
"
|
|
115
|
-
"eslint
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"
|
|
122
|
-
"
|
|
123
|
-
"
|
|
124
|
-
"
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "@tap-payments/os-micro-frontend-shared",
|
|
3
|
+
"description": "Shared components and utilities for Tap Payments micro frontends",
|
|
4
|
+
"version": "0.1.65",
|
|
5
|
+
"testVersion": 0,
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "build/index.js",
|
|
8
|
+
"module": "build/index.js",
|
|
9
|
+
"types": "build/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./build/index.d.ts",
|
|
13
|
+
"import": "./build/index.js",
|
|
14
|
+
"require": "./build/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./constants": {
|
|
17
|
+
"types": "./build/constants/index.d.ts",
|
|
18
|
+
"import": "./build/constants/index.js",
|
|
19
|
+
"require": "./build/constants/index.js"
|
|
20
|
+
},
|
|
21
|
+
"./components": {
|
|
22
|
+
"types": "./build/components/index.d.ts",
|
|
23
|
+
"import": "./build/components/index.js",
|
|
24
|
+
"require": "./build/components/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./components/*": {
|
|
27
|
+
"types": "./build/components/*/index.d.ts",
|
|
28
|
+
"import": "./build/components/*/index.js",
|
|
29
|
+
"require": "./build/components/*/index.js"
|
|
30
|
+
},
|
|
31
|
+
"./hooks": {
|
|
32
|
+
"types": "./build/hooks/index.d.ts",
|
|
33
|
+
"import": "./build/hooks/index.js",
|
|
34
|
+
"require": "./build/hooks/index.js"
|
|
35
|
+
},
|
|
36
|
+
"./utils": {
|
|
37
|
+
"types": "./build/utils/index.d.ts",
|
|
38
|
+
"import": "./build/utils/index.js",
|
|
39
|
+
"require": "./build/utils/index.js"
|
|
40
|
+
},
|
|
41
|
+
"./theme": {
|
|
42
|
+
"types": "./build/theme/index.d.ts",
|
|
43
|
+
"import": "./build/theme/index.js",
|
|
44
|
+
"require": "./build/theme/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./types": {
|
|
47
|
+
"types": "./build/types/index.d.ts",
|
|
48
|
+
"import": "./build/types/index.js",
|
|
49
|
+
"require": "./build/types/index.js"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"license": "MIT",
|
|
53
|
+
"author": {
|
|
54
|
+
"name": "Ahmed Sharkawy",
|
|
55
|
+
"email": "a.elsharkawy@tap.company"
|
|
56
|
+
},
|
|
57
|
+
"files": [
|
|
58
|
+
"build",
|
|
59
|
+
"readme.md"
|
|
60
|
+
],
|
|
61
|
+
"scripts": {
|
|
62
|
+
"ts:build": "rm -rf build && tsc -p tsconfig.npm.json && tsc-alias -p tsconfig.npm.json",
|
|
63
|
+
"push:local": "yarn ts:build && yalc publish --push",
|
|
64
|
+
"push": "npm run ts:build && npm publish --access public",
|
|
65
|
+
"push:test": "node scripts/increment-test-version.cjs && npm run ts:build && npm publish --access public --tag test && node scripts/restore-version.cjs",
|
|
66
|
+
"dev": "vite",
|
|
67
|
+
"build": "tsc -b && vite build ",
|
|
68
|
+
"prettier": "prettier --list-different \"src/**/*.{md,mdx,ts,js,tsx,jsx,json}\"",
|
|
69
|
+
"prettier:fix": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,md,css,json}\"",
|
|
70
|
+
"lint": "eslint . --color",
|
|
71
|
+
"lint:fix": "eslint src --fix --color",
|
|
72
|
+
"preview": "vite preview",
|
|
73
|
+
"prepare": "husky"
|
|
74
|
+
},
|
|
75
|
+
"dependencies": {
|
|
76
|
+
"@emotion/react": "^11.11.0",
|
|
77
|
+
"@emotion/styled": "^11.11.0",
|
|
78
|
+
"@hookform/resolvers": "^3.3.1",
|
|
79
|
+
"@mui/material": "^5.12.3",
|
|
80
|
+
"@uiw/react-json-view": "^2.0.0-alpha.16",
|
|
81
|
+
"axios": "^1.4.0",
|
|
82
|
+
"color": "^5.0.0",
|
|
83
|
+
"dayjs": "^1.11.8",
|
|
84
|
+
"framer-motion": "10.11.0",
|
|
85
|
+
"i18next": "^22.4.15",
|
|
86
|
+
"memoize-one": "^6.0.0",
|
|
87
|
+
"re-resizable": "^6.9.9",
|
|
88
|
+
"react": "^18.2.0",
|
|
89
|
+
"react-colorful": "^5.6.1",
|
|
90
|
+
"react-currency-input-field": "^3.6.11",
|
|
91
|
+
"react-dom": "^18.2.0",
|
|
92
|
+
"react-draggable": "^4.4.6",
|
|
93
|
+
"react-dropzone": "^14.2.3",
|
|
94
|
+
"react-hook-form": "^7.45.4",
|
|
95
|
+
"react-hot-toast": "^2.4.1",
|
|
96
|
+
"react-i18next": "^12.2.2",
|
|
97
|
+
"react-multi-date-picker": "^4.1.2",
|
|
98
|
+
"react-router-dom": "^7.7.0",
|
|
99
|
+
"react-virtualized-auto-sizer": "^1.0.20",
|
|
100
|
+
"react-window": "^1.8.9",
|
|
101
|
+
"react-window-infinite-loader": "^1.0.9",
|
|
102
|
+
"react18-input-otp": "^1.1.4",
|
|
103
|
+
"recharts": "^2.15.1"
|
|
104
|
+
},
|
|
105
|
+
"devDependencies": {
|
|
106
|
+
"@eslint/js": "^9.17.0",
|
|
107
|
+
"@testing-library/jest-dom": "^5.16.5",
|
|
108
|
+
"@types/lodash": "^4.17.15",
|
|
109
|
+
"@types/react": "^18.2.6",
|
|
110
|
+
"@types/react-dom": "^18.3.5",
|
|
111
|
+
"@types/react-virtualized-auto-sizer": "^1.0.8",
|
|
112
|
+
"@types/react-window": "^1.8.5",
|
|
113
|
+
"@types/react-window-infinite-loader": "^1.0.6",
|
|
114
|
+
"@vitejs/plugin-react": "^4.3.4",
|
|
115
|
+
"eslint": "^9.17.0",
|
|
116
|
+
"eslint-plugin-react-hooks": "^5.0.0",
|
|
117
|
+
"eslint-plugin-react-refresh": "^0.4.16",
|
|
118
|
+
"globals": "^15.14.0",
|
|
119
|
+
"husky": "^8.0.3",
|
|
120
|
+
"lint-staged": "^13.2.2",
|
|
121
|
+
"prettier": "^2.8.8",
|
|
122
|
+
"tsc-alias": "^1.8.16",
|
|
123
|
+
"typescript": "5.0.2",
|
|
124
|
+
"typescript-eslint": "^8.18.2",
|
|
125
|
+
"vite": "6.0.5",
|
|
126
|
+
"vite-tsconfig-paths": "^4.2.0"
|
|
127
|
+
},
|
|
128
|
+
"lint-staged": {
|
|
129
|
+
"src/**/*.{ts,tsx,json,js,jsx}": [
|
|
130
|
+
"yarn run prettier:fix",
|
|
131
|
+
"yarn run lint"
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"publishConfig": {
|
|
135
|
+
"registry": "https://registry.npmjs.org/"
|
|
136
|
+
}
|
|
137
|
+
}
|