biometry-react-components 1.3.1 → 1.3.3

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 CHANGED
@@ -7289,6 +7289,7 @@ if (typeof window !== 'undefined' && typeof console !== 'undefined') {
7289
7289
  const RECORD_SECONDS$1 = VIDEO_LENGTH_MS / 1000;
7290
7290
  const PREP_SECONDS$1 = 3;
7291
7291
  const DIGITS_NUMBER$1 = 7;
7292
+ const VIDEO_DISPLAY_HEIGHT = 536; // fixed height for consistent zoom regardless of container size
7292
7293
  function generateRandomDigits$1(count) {
7293
7294
  const digits = Array.from({ length: 10 }, (_, i) => i);
7294
7295
  for (let i = digits.length - 1; i > 0; i--) {
@@ -7297,7 +7298,7 @@ function generateRandomDigits$1(count) {
7297
7298
  }
7298
7299
  return digits.slice(0, count);
7299
7300
  }
7300
- const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, onRecorded, className, style, noShadow = false, }) => {
7301
+ const FaceRecorder = ({ rectWidth = 360, rectHeight = 470, onConfirmRecording, onRecorded, className, style, noShadow = false, }) => {
7301
7302
  const [state, setState] = useState('preparation');
7302
7303
  const [prepTimer, setPrepTimer] = useState(PREP_SECONDS$1);
7303
7304
  const [recordTimer, setRecordTimer] = useState(RECORD_SECONDS$1);
@@ -7522,7 +7523,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
7522
7523
  alignItems: 'center',
7523
7524
  justifyContent: 'center',
7524
7525
  width: rectWidth,
7525
- height: rectHeight + 80,
7526
+ height: rectHeight + 100,
7526
7527
  margin: '0 auto',
7527
7528
  ...style,
7528
7529
  };
@@ -7573,28 +7574,26 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
7573
7574
  alignSelf: 'center',
7574
7575
  };
7575
7576
  const numberRow = {
7576
- position: 'absolute',
7577
- top: 10,
7578
- left: 12,
7579
- right: 12,
7580
7577
  display: 'flex',
7581
7578
  justifyContent: 'center',
7582
7579
  gap: 5,
7583
- zIndex: 10,
7580
+ marginBottom: 12,
7581
+ width: '100%',
7582
+ maxWidth: rectWidth - 40,
7584
7583
  };
7585
7584
  const numberBox = {
7586
7585
  minWidth: 24,
7587
7586
  minHeight: 32,
7588
- background: 'rgba(0, 0, 0, 0.6)',
7589
- border: '1.5px solid rgba(255, 255, 255, 0.5)',
7587
+ background: '#f5f5f5',
7588
+ border: '2px solid #333',
7590
7589
  borderRadius: 4,
7591
7590
  fontSize: 16,
7592
7591
  fontWeight: 600,
7593
- color: '#fff',
7592
+ color: '#333',
7594
7593
  display: 'flex',
7595
7594
  alignItems: 'center',
7596
7595
  justifyContent: 'center',
7597
- backdropFilter: 'blur(4px)',
7596
+ boxShadow: '0 1px 4px rgba(0,0,0,0.08)',
7598
7597
  transition: 'background 0.3s',
7599
7598
  flex: '1',
7600
7599
  maxWidth: '28px',
@@ -7698,13 +7697,12 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
7698
7697
  if (!permission) {
7699
7698
  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
7699
  }
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: {
7700
+ 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: VIDEO_DISPLAY_HEIGHT, className: "facerecorder-video", style: {
7702
7701
  width: rectWidth - 40,
7703
- height: rectHeight - 40,
7702
+ height: VIDEO_DISPLAY_HEIGHT,
7704
7703
  objectFit: 'cover',
7705
- borderRadius: noShadow ? 0 : 8,
7706
7704
  zIndex: 0,
7707
- transform: 'scaleX(-1)'
7705
+ transform: 'scaleX(-1)',
7708
7706
  }, playsInline: true, muted: true, autoPlay: true }), jsx("div", { className: "facerecorder-dark-overlay", style: {
7709
7707
  position: 'absolute',
7710
7708
  top: 0,
@@ -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` } })] })), jsx("div", { style: numberRow, children: (state === 'recording' ? digits : Array(DIGITS_NUMBER$1).fill('*')).map((num, i) => (jsx("div", { style: numberBox, children: num }, i))) })] }), 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: {
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
@@ -7289,6 +7289,7 @@ if (typeof window !== 'undefined' && typeof console !== 'undefined') {
7289
7289
  const RECORD_SECONDS$1 = VIDEO_LENGTH_MS / 1000;
7290
7290
  const PREP_SECONDS$1 = 3;
7291
7291
  const DIGITS_NUMBER$1 = 7;
7292
+ const VIDEO_DISPLAY_HEIGHT = 536; // fixed height for consistent zoom regardless of container size
7292
7293
  function generateRandomDigits$1(count) {
7293
7294
  const digits = Array.from({ length: 10 }, (_, i) => i);
7294
7295
  for (let i = digits.length - 1; i > 0; i--) {
@@ -7297,7 +7298,7 @@ function generateRandomDigits$1(count) {
7297
7298
  }
7298
7299
  return digits.slice(0, count);
7299
7300
  }
7300
- const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, onRecorded, className, style, noShadow = false, }) => {
7301
+ const FaceRecorder = ({ rectWidth = 360, rectHeight = 470, onConfirmRecording, onRecorded, className, style, noShadow = false, }) => {
7301
7302
  const [state, setState] = React.useState('preparation');
7302
7303
  const [prepTimer, setPrepTimer] = React.useState(PREP_SECONDS$1);
7303
7304
  const [recordTimer, setRecordTimer] = React.useState(RECORD_SECONDS$1);
@@ -7522,7 +7523,7 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
7522
7523
  alignItems: 'center',
7523
7524
  justifyContent: 'center',
7524
7525
  width: rectWidth,
7525
- height: rectHeight + 80,
7526
+ height: rectHeight + 100,
7526
7527
  margin: '0 auto',
7527
7528
  ...style,
7528
7529
  };
@@ -7573,28 +7574,26 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
7573
7574
  alignSelf: 'center',
7574
7575
  };
7575
7576
  const numberRow = {
7576
- position: 'absolute',
7577
- top: 10,
7578
- left: 12,
7579
- right: 12,
7580
7577
  display: 'flex',
7581
7578
  justifyContent: 'center',
7582
7579
  gap: 5,
7583
- zIndex: 10,
7580
+ marginBottom: 12,
7581
+ width: '100%',
7582
+ maxWidth: rectWidth - 40,
7584
7583
  };
7585
7584
  const numberBox = {
7586
7585
  minWidth: 24,
7587
7586
  minHeight: 32,
7588
- background: 'rgba(0, 0, 0, 0.6)',
7589
- border: '1.5px solid rgba(255, 255, 255, 0.5)',
7587
+ background: '#f5f5f5',
7588
+ border: '2px solid #333',
7590
7589
  borderRadius: 4,
7591
7590
  fontSize: 16,
7592
7591
  fontWeight: 600,
7593
- color: '#fff',
7592
+ color: '#333',
7594
7593
  display: 'flex',
7595
7594
  alignItems: 'center',
7596
7595
  justifyContent: 'center',
7597
- backdropFilter: 'blur(4px)',
7596
+ boxShadow: '0 1px 4px rgba(0,0,0,0.08)',
7598
7597
  transition: 'background 0.3s',
7599
7598
  flex: '1',
7600
7599
  maxWidth: '28px',
@@ -7698,13 +7697,12 @@ const FaceRecorder = ({ rectWidth = 360, rectHeight = 576, onConfirmRecording, o
7698
7697
  if (!permission) {
7699
7698
  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
7699
  }
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: {
7700
+ 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: VIDEO_DISPLAY_HEIGHT, className: "facerecorder-video", style: {
7702
7701
  width: rectWidth - 40,
7703
- height: rectHeight - 40,
7702
+ height: VIDEO_DISPLAY_HEIGHT,
7704
7703
  objectFit: 'cover',
7705
- borderRadius: noShadow ? 0 : 8,
7706
7704
  zIndex: 0,
7707
- transform: 'scaleX(-1)'
7705
+ transform: 'scaleX(-1)',
7708
7706
  }, playsInline: true, muted: true, autoPlay: true }), jsxRuntime.jsx("div", { className: "facerecorder-dark-overlay", style: {
7709
7707
  position: 'absolute',
7710
7708
  top: 0,
@@ -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` } })] })), jsxRuntime.jsx("div", { style: numberRow, children: (state === 'recording' ? digits : Array(DIGITS_NUMBER$1).fill('*')).map((num, i) => (jsxRuntime.jsx("div", { style: numberBox, children: num }, i))) })] }), 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: {
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.1",
3
+ "version": "1.3.3",
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",