@tap-payments/os-micro-frontend-shared 0.0.16-OTP-fix-v4 → 0.0.17
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/build/components/CardHeadline/CardHeadline.js +1 -2
- package/build/components/{OtpInputField/OtpInputField.d.ts → OTPInput/OTPInput.d.ts} +2 -2
- package/build/components/{OtpInputField/OtpInputField.js → OTPInput/OTPInput.js} +8 -3
- package/build/components/OTPInput/index.d.ts +2 -0
- package/build/components/OTPInput/index.js +2 -0
- package/build/components/index.d.ts +1 -1
- package/build/components/index.js +1 -1
- package/build/types/merchant.d.ts +3 -0
- package/package.json +1 -1
- package/build/components/OtpInputField/index.d.ts +0 -2
- package/build/components/OtpInputField/index.js +0 -2
- /package/build/components/{OtpInputField → OTPInput}/style.d.ts +0 -0
- /package/build/components/{OtpInputField → OTPInput}/style.js +0 -0
|
@@ -3,7 +3,6 @@ import { memo } from 'react';
|
|
|
3
3
|
import Box from '@mui/material/Box';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
5
|
import Text from '../Text';
|
|
6
|
-
import { OtpInputField } from '../index.js';
|
|
7
6
|
const Wrapper = styled(Box)(({ theme }) => ({
|
|
8
7
|
textAlign: 'center',
|
|
9
8
|
color: theme.palette.text.primary,
|
|
@@ -11,6 +10,6 @@ const Wrapper = styled(Box)(({ theme }) => ({
|
|
|
11
10
|
const HeadlineText = styled(Text)(({ theme }) => (Object.assign(Object.assign({}, theme.typography.h3), { marginBottom: '7px', lineHeight: '48px', fontWeight: theme.typography.fontWeightMedium, textTransform: 'capitalize' })));
|
|
12
11
|
const SubHeadlineText = styled(Text)(({ theme }) => (Object.assign(Object.assign({}, theme.typography.h5), { lineHeight: '29px', opacity: 0.3, fontWeight: theme.typography.fontWeightMedium })));
|
|
13
12
|
function CardHeadline({ headline, subHeadline }) {
|
|
14
|
-
return (_jsxs(Wrapper, { children: [headline && _jsx(HeadlineText, { children: headline }), subHeadline && _jsx(SubHeadlineText, { children: subHeadline })
|
|
13
|
+
return (_jsxs(Wrapper, { children: [headline && _jsx(HeadlineText, { children: headline }), subHeadline && _jsx(SubHeadlineText, { children: subHeadline })] }));
|
|
15
14
|
}
|
|
16
15
|
export default memo(CardHeadline);
|
|
@@ -5,6 +5,6 @@ interface OTPInputProps extends Omit<OtpInputProps, 'numInputs' | 'onChange'> {
|
|
|
5
5
|
onChange?: (otp: string) => void;
|
|
6
6
|
onSubmitOtp?: (otp: string) => void;
|
|
7
7
|
}
|
|
8
|
-
declare function
|
|
9
|
-
declare const _default: import("react").MemoExoticComponent<typeof
|
|
8
|
+
declare function OTPInput({ numInputs, separateAfter, isInputSecure, isInputNum, onSubmitOtp, ...props }: OTPInputProps): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
declare const _default: import("react").MemoExoticComponent<typeof OTPInput>;
|
|
10
10
|
export default _default;
|
|
@@ -11,9 +11,10 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useState, memo } from 'react';
|
|
14
|
+
import Box from '@mui/material/Box';
|
|
14
15
|
import OtpInput from 'react18-input-otp';
|
|
15
16
|
import { inputFocusStyle, inputStyle, inputErrorStyle, Separator } from './style';
|
|
16
|
-
function
|
|
17
|
+
function OTPInput(_a) {
|
|
17
18
|
var { numInputs = 6, separateAfter = 3, isInputSecure = true, isInputNum = true, onSubmitOtp } = _a, props = __rest(_a, ["numInputs", "separateAfter", "isInputSecure", "isInputNum", "onSubmitOtp"]);
|
|
18
19
|
const [otp, setOtp] = useState('');
|
|
19
20
|
const handleChange = (enteredOtp) => {
|
|
@@ -22,6 +23,10 @@ function OtpInputField(_a) {
|
|
|
22
23
|
onSubmitOtp === null || onSubmitOtp === void 0 ? void 0 : onSubmitOtp(enteredOtp);
|
|
23
24
|
}
|
|
24
25
|
};
|
|
25
|
-
return (_jsx(
|
|
26
|
+
return (_jsx(Box, Object.assign({ sx: {
|
|
27
|
+
'::selection': {
|
|
28
|
+
background: 'transparent',
|
|
29
|
+
},
|
|
30
|
+
} }, { children: _jsx(OtpInput, Object.assign({ inputStyle: Object.assign(Object.assign({}, inputStyle), props.inputProps), focusStyle: inputFocusStyle, errorStyle: inputErrorStyle, value: otp, separator: _jsx(Separator, { children: "-" }), isInputNum: isInputNum, isInputSecure: isInputSecure, numInputs: numInputs, separateAfter: separateAfter, shouldAutoFocus: true, onChange: handleChange }, props)) })));
|
|
26
31
|
}
|
|
27
|
-
export default memo(
|
|
32
|
+
export default memo(OTPInput);
|
|
@@ -80,4 +80,4 @@ export { default as ConfirmDialog, type ConfirmDialogFunction, type ConfirmDialo
|
|
|
80
80
|
export { default as ControlPanelContainer } from './ControlPanelContainer';
|
|
81
81
|
export { default as CopyImage } from './CopyImage';
|
|
82
82
|
export { default as AccountDropdown } from './AccountDropdown';
|
|
83
|
-
export { default as
|
|
83
|
+
export { default as OTPInput } from './OTPInput';
|
|
@@ -80,4 +80,4 @@ export { default as ConfirmDialog } from './ConfirmDialog';
|
|
|
80
80
|
export { default as ControlPanelContainer } from './ControlPanelContainer';
|
|
81
81
|
export { default as CopyImage } from './CopyImage';
|
|
82
82
|
export { default as AccountDropdown } from './AccountDropdown';
|
|
83
|
-
export { default as
|
|
83
|
+
export { default as OTPInput } from './OTPInput';
|
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.0.
|
|
4
|
+
"version": "0.0.17",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|
|
7
7
|
"module": "build/index.js",
|
|
File without changes
|
|
File without changes
|