biometry-react-components 1.3.1 → 1.3.2
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/dist/index.esm.js +11 -13
- package/dist/index.js +11 -13
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -7297,7 +7297,7 @@ function generateRandomDigits$1(count) {
|
|
|
7297
7297
|
}
|
|
7298
7298
|
return digits.slice(0, count);
|
|
7299
7299
|
}
|
|
7300
|
-
const FaceRecorder = ({ rectWidth = 360, rectHeight =
|
|
7300
|
+
const FaceRecorder = ({ rectWidth = 360, rectHeight = 470, onConfirmRecording, onRecorded, className, style, noShadow = false, }) => {
|
|
7301
7301
|
const [state, setState] = useState('preparation');
|
|
7302
7302
|
const [prepTimer, setPrepTimer] = useState(PREP_SECONDS$1);
|
|
7303
7303
|
const [recordTimer, setRecordTimer] = useState(RECORD_SECONDS$1);
|
|
@@ -7522,7 +7522,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7522
7522
|
alignItems: 'center',
|
|
7523
7523
|
justifyContent: 'center',
|
|
7524
7524
|
width: rectWidth,
|
|
7525
|
-
height: rectHeight +
|
|
7525
|
+
height: rectHeight + 100,
|
|
7526
7526
|
margin: '0 auto',
|
|
7527
7527
|
...style,
|
|
7528
7528
|
};
|
|
@@ -7573,28 +7573,26 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7573
7573
|
alignSelf: 'center',
|
|
7574
7574
|
};
|
|
7575
7575
|
const numberRow = {
|
|
7576
|
-
position: 'absolute',
|
|
7577
|
-
top: 10,
|
|
7578
|
-
left: 12,
|
|
7579
|
-
right: 12,
|
|
7580
7576
|
display: 'flex',
|
|
7581
7577
|
justifyContent: 'center',
|
|
7582
7578
|
gap: 5,
|
|
7583
|
-
|
|
7579
|
+
marginBottom: 12,
|
|
7580
|
+
width: '100%',
|
|
7581
|
+
maxWidth: rectWidth - 40,
|
|
7584
7582
|
};
|
|
7585
7583
|
const numberBox = {
|
|
7586
7584
|
minWidth: 24,
|
|
7587
7585
|
minHeight: 32,
|
|
7588
|
-
background: '
|
|
7589
|
-
border: '
|
|
7586
|
+
background: '#f5f5f5',
|
|
7587
|
+
border: '2px solid #333',
|
|
7590
7588
|
borderRadius: 4,
|
|
7591
7589
|
fontSize: 16,
|
|
7592
7590
|
fontWeight: 600,
|
|
7593
|
-
color: '#
|
|
7591
|
+
color: '#333',
|
|
7594
7592
|
display: 'flex',
|
|
7595
7593
|
alignItems: 'center',
|
|
7596
7594
|
justifyContent: 'center',
|
|
7597
|
-
|
|
7595
|
+
boxShadow: '0 1px 4px rgba(0,0,0,0.08)',
|
|
7598
7596
|
transition: 'background 0.3s',
|
|
7599
7597
|
flex: '1',
|
|
7600
7598
|
maxWidth: '28px',
|
|
@@ -7698,7 +7696,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7698
7696
|
if (!permission) {
|
|
7699
7697
|
return (jsx("div", { className: className, style: wrapperStyle, children: jsxs("div", { style: { textAlign: 'center', padding: '20px' }, children: [jsx("h3", { children: "Camera Permission Required" }), jsx("p", { children: "Please allow camera and microphone access to use this component." }), jsx("button", { type: "button", style: actionButton, onClick: requestPermissions, children: "Grant Permissions" })] }) }));
|
|
7700
7698
|
}
|
|
7701
|
-
return (jsxs("div", { className: className, style: wrapperStyle, children: [state !== 'result' && state !== 'processing' && !isConfirming && (jsxs(Fragment, { children: [jsxs("div", { className: "facerecorder-camera-area", style: cameraArea, children: [jsx("video", { ref: videoRef, width: rectWidth - 40, height: rectHeight - 40, className: "facerecorder-video", style: {
|
|
7699
|
+
return (jsxs("div", { className: className, style: wrapperStyle, children: [state !== 'result' && state !== 'processing' && !isConfirming && (jsxs(Fragment, { children: [jsx("div", { className: "facerecorder-number-row", style: numberRow, children: (state === 'recording' ? digits : Array(DIGITS_NUMBER$1).fill('*')).map((num, i) => (jsx("div", { style: numberBox, children: num }, i))) }), jsxs("div", { className: "facerecorder-camera-area", style: cameraArea, children: [jsx("video", { ref: videoRef, width: rectWidth - 40, height: rectHeight - 40, className: "facerecorder-video", style: {
|
|
7702
7700
|
width: rectWidth - 40,
|
|
7703
7701
|
height: rectHeight - 40,
|
|
7704
7702
|
objectFit: 'cover',
|
|
@@ -7714,7 +7712,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7714
7712
|
background: 'rgba(0,0,0,0.4)',
|
|
7715
7713
|
zIndex: 1,
|
|
7716
7714
|
borderRadius: noShadow ? 0 : 8,
|
|
7717
|
-
} }), jsxs("div", { className: "facerecorder-oval-area", style: ovalArea, children: [jsx("span", { className: "facerecorder-guidance-text", style: guidanceText, children: "Place your face in the oval" }), jsx("div", { className: "facerecorder-oval-dashed", style: ovalDashed })] }), state === 'countdown' && (jsx("div", { style: prepTimerStyle, children: prepTimer })), state === 'recording' && (jsx("div", { style: timerStyle, children: recordTimer })), (state === 'recording' || state === 'preparation') && (jsxs("div", { style: soundwaveStyle, children: [jsx("div", { style: { ...barBase, height: `${8 + micLevel * 30}px` } }), jsx("div", { style: { ...barBase, height: `${4 + micLevel * 40}px` } }), jsx("div", { style: { ...barBase, height: `${10 + micLevel * 20}px` } })] }))
|
|
7715
|
+
} }), jsxs("div", { className: "facerecorder-oval-area", style: ovalArea, children: [jsx("span", { className: "facerecorder-guidance-text", style: guidanceText, children: "Place your face in the oval" }), jsx("div", { className: "facerecorder-oval-dashed", style: ovalDashed })] }), state === 'countdown' && (jsx("div", { style: prepTimerStyle, children: prepTimer })), state === 'recording' && (jsx("div", { style: timerStyle, children: recordTimer })), (state === 'recording' || state === 'preparation') && (jsxs("div", { style: soundwaveStyle, children: [jsx("div", { style: { ...barBase, height: `${8 + micLevel * 30}px` } }), jsx("div", { style: { ...barBase, height: `${4 + micLevel * 40}px` } }), jsx("div", { style: { ...barBase, height: `${10 + micLevel * 20}px` } })] }))] }), state === 'preparation' && (jsx("button", { type: "button", style: actionButton, onClick: startRecording, children: "Start recording" })), state === 'recording' && (jsx("button", { type: "button", style: { ...actionButton, background: '#d32f2f' }, onClick: handleCancel, children: "Cancel" }))] })), state === 'processing' && (jsx(Fragment, { children: jsx("div", { className: "facerecorder-processing", style: preview, children: jsxs("div", { style: {
|
|
7718
7716
|
display: 'flex',
|
|
7719
7717
|
flexDirection: 'column',
|
|
7720
7718
|
alignItems: 'center',
|
package/dist/index.js
CHANGED
|
@@ -7297,7 +7297,7 @@ function generateRandomDigits$1(count) {
|
|
|
7297
7297
|
}
|
|
7298
7298
|
return digits.slice(0, count);
|
|
7299
7299
|
}
|
|
7300
|
-
const FaceRecorder = ({ rectWidth = 360, rectHeight =
|
|
7300
|
+
const FaceRecorder = ({ rectWidth = 360, rectHeight = 470, onConfirmRecording, onRecorded, className, style, noShadow = false, }) => {
|
|
7301
7301
|
const [state, setState] = React.useState('preparation');
|
|
7302
7302
|
const [prepTimer, setPrepTimer] = React.useState(PREP_SECONDS$1);
|
|
7303
7303
|
const [recordTimer, setRecordTimer] = React.useState(RECORD_SECONDS$1);
|
|
@@ -7522,7 +7522,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7522
7522
|
alignItems: 'center',
|
|
7523
7523
|
justifyContent: 'center',
|
|
7524
7524
|
width: rectWidth,
|
|
7525
|
-
height: rectHeight +
|
|
7525
|
+
height: rectHeight + 100,
|
|
7526
7526
|
margin: '0 auto',
|
|
7527
7527
|
...style,
|
|
7528
7528
|
};
|
|
@@ -7573,28 +7573,26 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7573
7573
|
alignSelf: 'center',
|
|
7574
7574
|
};
|
|
7575
7575
|
const numberRow = {
|
|
7576
|
-
position: 'absolute',
|
|
7577
|
-
top: 10,
|
|
7578
|
-
left: 12,
|
|
7579
|
-
right: 12,
|
|
7580
7576
|
display: 'flex',
|
|
7581
7577
|
justifyContent: 'center',
|
|
7582
7578
|
gap: 5,
|
|
7583
|
-
|
|
7579
|
+
marginBottom: 12,
|
|
7580
|
+
width: '100%',
|
|
7581
|
+
maxWidth: rectWidth - 40,
|
|
7584
7582
|
};
|
|
7585
7583
|
const numberBox = {
|
|
7586
7584
|
minWidth: 24,
|
|
7587
7585
|
minHeight: 32,
|
|
7588
|
-
background: '
|
|
7589
|
-
border: '
|
|
7586
|
+
background: '#f5f5f5',
|
|
7587
|
+
border: '2px solid #333',
|
|
7590
7588
|
borderRadius: 4,
|
|
7591
7589
|
fontSize: 16,
|
|
7592
7590
|
fontWeight: 600,
|
|
7593
|
-
color: '#
|
|
7591
|
+
color: '#333',
|
|
7594
7592
|
display: 'flex',
|
|
7595
7593
|
alignItems: 'center',
|
|
7596
7594
|
justifyContent: 'center',
|
|
7597
|
-
|
|
7595
|
+
boxShadow: '0 1px 4px rgba(0,0,0,0.08)',
|
|
7598
7596
|
transition: 'background 0.3s',
|
|
7599
7597
|
flex: '1',
|
|
7600
7598
|
maxWidth: '28px',
|
|
@@ -7698,7 +7696,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7698
7696
|
if (!permission) {
|
|
7699
7697
|
return (jsxRuntime.jsx("div", { className: className, style: wrapperStyle, children: jsxRuntime.jsxs("div", { style: { textAlign: 'center', padding: '20px' }, children: [jsxRuntime.jsx("h3", { children: "Camera Permission Required" }), jsxRuntime.jsx("p", { children: "Please allow camera and microphone access to use this component." }), jsxRuntime.jsx("button", { type: "button", style: actionButton, onClick: requestPermissions, children: "Grant Permissions" })] }) }));
|
|
7700
7698
|
}
|
|
7701
|
-
return (jsxRuntime.jsxs("div", { className: className, style: wrapperStyle, children: [state !== 'result' && state !== 'processing' && !isConfirming && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsxs("div", { className: "facerecorder-camera-area", style: cameraArea, children: [jsxRuntime.jsx("video", { ref: videoRef, width: rectWidth - 40, height: rectHeight - 40, className: "facerecorder-video", style: {
|
|
7699
|
+
return (jsxRuntime.jsxs("div", { className: className, style: wrapperStyle, children: [state !== 'result' && state !== 'processing' && !isConfirming && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx("div", { className: "facerecorder-number-row", style: numberRow, children: (state === 'recording' ? digits : Array(DIGITS_NUMBER$1).fill('*')).map((num, i) => (jsxRuntime.jsx("div", { style: numberBox, children: num }, i))) }), jsxRuntime.jsxs("div", { className: "facerecorder-camera-area", style: cameraArea, children: [jsxRuntime.jsx("video", { ref: videoRef, width: rectWidth - 40, height: rectHeight - 40, className: "facerecorder-video", style: {
|
|
7702
7700
|
width: rectWidth - 40,
|
|
7703
7701
|
height: rectHeight - 40,
|
|
7704
7702
|
objectFit: 'cover',
|
|
@@ -7714,7 +7712,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
|
|
|
7714
7712
|
background: 'rgba(0,0,0,0.4)',
|
|
7715
7713
|
zIndex: 1,
|
|
7716
7714
|
borderRadius: noShadow ? 0 : 8,
|
|
7717
|
-
} }), jsxRuntime.jsxs("div", { className: "facerecorder-oval-area", style: ovalArea, children: [jsxRuntime.jsx("span", { className: "facerecorder-guidance-text", style: guidanceText, children: "Place your face in the oval" }), jsxRuntime.jsx("div", { className: "facerecorder-oval-dashed", style: ovalDashed })] }), state === 'countdown' && (jsxRuntime.jsx("div", { style: prepTimerStyle, children: prepTimer })), state === 'recording' && (jsxRuntime.jsx("div", { style: timerStyle, children: recordTimer })), (state === 'recording' || state === 'preparation') && (jsxRuntime.jsxs("div", { style: soundwaveStyle, children: [jsxRuntime.jsx("div", { style: { ...barBase, height: `${8 + micLevel * 30}px` } }), jsxRuntime.jsx("div", { style: { ...barBase, height: `${4 + micLevel * 40}px` } }), jsxRuntime.jsx("div", { style: { ...barBase, height: `${10 + micLevel * 20}px` } })] }))
|
|
7715
|
+
} }), jsxRuntime.jsxs("div", { className: "facerecorder-oval-area", style: ovalArea, children: [jsxRuntime.jsx("span", { className: "facerecorder-guidance-text", style: guidanceText, children: "Place your face in the oval" }), jsxRuntime.jsx("div", { className: "facerecorder-oval-dashed", style: ovalDashed })] }), state === 'countdown' && (jsxRuntime.jsx("div", { style: prepTimerStyle, children: prepTimer })), state === 'recording' && (jsxRuntime.jsx("div", { style: timerStyle, children: recordTimer })), (state === 'recording' || state === 'preparation') && (jsxRuntime.jsxs("div", { style: soundwaveStyle, children: [jsxRuntime.jsx("div", { style: { ...barBase, height: `${8 + micLevel * 30}px` } }), jsxRuntime.jsx("div", { style: { ...barBase, height: `${4 + micLevel * 40}px` } }), jsxRuntime.jsx("div", { style: { ...barBase, height: `${10 + micLevel * 20}px` } })] }))] }), state === 'preparation' && (jsxRuntime.jsx("button", { type: "button", style: actionButton, onClick: startRecording, children: "Start recording" })), state === 'recording' && (jsxRuntime.jsx("button", { type: "button", style: { ...actionButton, background: '#d32f2f' }, onClick: handleCancel, children: "Cancel" }))] })), state === 'processing' && (jsxRuntime.jsx(jsxRuntime.Fragment, { children: jsxRuntime.jsx("div", { className: "facerecorder-processing", style: preview, children: jsxRuntime.jsxs("div", { style: {
|
|
7718
7716
|
display: 'flex',
|
|
7719
7717
|
flexDirection: 'column',
|
|
7720
7718
|
alignItems: 'center',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biometry-react-components",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React UI component library for capturing high-quality biometric data (voice, face, documents, video) to facilitate integration with 'Biometry' services",
|
|
6
6
|
"main": "dist/index.js",
|