@omniumretail/component-library 1.1.30 → 1.1.31

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.
@@ -19,10 +19,24 @@ OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
19
19
  PERFORMANCE OF THIS SOFTWARE.
20
20
  ***************************************************************************** */
21
21
 
22
+ /*! exports provided: default */
23
+
24
+ /*! no static exports found */
25
+
26
+ /*! react */
27
+
22
28
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
23
29
 
24
30
  /*! sheetjs (C) 2013-present SheetJS -- http://sheetjs.com */
25
31
 
32
+ /*!******************************!*\
33
+ !*** ./src/react-webcam.tsx ***!
34
+ \******************************/
35
+
36
+ /*!**************************************************************************************!*\
37
+ !*** external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} ***!
38
+ \**************************************************************************************/
39
+
26
40
  /**
27
41
  * @license React
28
42
  * react-jsx-runtime.production.min.js
package/dist/main.css CHANGED
@@ -27,3 +27,4 @@
27
27
  .zsvRMmfrmqBj9iRjtQpO{display:grid;grid-template-columns:300px auto;gap:16px;height:100%}.pb4QP8qfuDG2T6wfXkUC{overflow:auto;background:#ebeced}.gP05vt1R1r67eWteznvr{overflow:auto;background:var(--color-white)}.pb4QP8qfuDG2T6wfXkUC,.gP05vt1R1r67eWteznvr{padding:20px}.btRPAI8631Q2XXYP6nZ7{font-size:var(--font-size-body-4);color:var(--color-blue);margin-bottom:36px;font-weight:var(--font-weight-semibold);text-transform:uppercase}.SbA9dHRh1JSG4xp1Aqie{padding-bottom:15px;font-weight:var(--font-weight-bold);font-size:var(--font-size-body-4)}.ZsQJQ__gMgYGYau95r8U{cursor:pointer}.PPF4FGgo1aDsBm13cNj8{padding-left:16px}.PPF4FGgo1aDsBm13cNj8 .SbA9dHRh1JSG4xp1Aqie{font-weight:var(--font-weight-semibold)}.PPF4FGgo1aDsBm13cNj8 .QEsWraNRLBQux4k4KNAE .PPF4FGgo1aDsBm13cNj8 .SbA9dHRh1JSG4xp1Aqie{font-weight:var(--font-weight-light)}.QEsWraNRLBQux4k4KNAE{display:block}.VQ09MnwMcIzpW1iabb4A{color:var(--color-orange)}.cmcMqdZJEUjlu34ag1Md{margin-bottom:32px;display:flex;justify-content:space-between;align-items:center}.i_U4mKg0Sxl4EvVzgv0L{font-size:var(--font-size-body-4);color:var(--color-blue);font-weight:var(--font-weight-semibold);margin-bottom:8px}.Tnut0v2OeSU0e7XwrCXI{font-size:var(--font-size-body-3);font-weight:var(--font-weight-light);color:var(--color-black)}.W2hZQFsItdqKPcBu4UrA{display:flex;flex-direction:row;gap:36px;margin-bottom:36px;border-bottom:1px solid rgba(var(--color-blue-rgb), 0.2);padding-bottom:4px}.tIVLagS5XxibJ4PBCNpp{flex-direction:column;border-bottom:1px solid rgba(var(--color-blue-rgb), 0.2);margin-bottom:24px}.tIVLagS5XxibJ4PBCNpp .RenA6EOwu2sFJGoqYbYz{width:100%;border-bottom:none}.tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9{width:100%;height:auto}.tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9 .ant-input{min-height:140px}.tIVLagS5XxibJ4PBCNpp .N0_FbFF8bLYtEcr8_2B9 .ant-form-item{margin-bottom:16px}.RenA6EOwu2sFJGoqYbYz{width:calc(100% - 149px);display:flex;align-items:center}.N0_FbFF8bLYtEcr8_2B9{width:130px;min-width:130px;align-self:flex-end;display:flex;justify-content:space-between;padding-right:15px}.GaBbmrXh2G03hz6ha5vB{display:none}.QYrBVtDmfSFNxJFztXVl{min-width:130px;align-self:flex-end;display:flex;justify-content:space-between;gap:34px}.V_qOYQwuQ9mXa8aniYgl{font-size:var(--font-size-body-3);font-weight:var(--font-weight-medium)}.pvSzNydRHp3dkh3WrOeA{font-weight:var(--font-weight-light);margin-bottom:4px}.Ehgx39o1k8blh7IDJ2mg{padding:6px;font-size:var(--font-size-body-4);font-weight:var(--font-weight-medium);color:var(--color-white);border-radius:5px;display:inline-flex;letter-spacing:3px}.ifR0bkZtK7yVHD6YZ_Zz{background-color:rgba(217,217,217,.5);border-radius:5px;padding:8px 15px;display:flex;flex-direction:row;gap:50px;align-items:center}.NL5HeemkTIg0oPHDXVtO{font-size:var(--font-size-body-3);font-weight:var(--font-weight-medium);color:var(--color-black)}.koYqEMOf6wzxWpwvrFkL{display:flex;justify-content:space-between;margin-bottom:12px;margin-left:16px;gap:40px;width:100%}
28
28
  .vhUOPe6KeB6afW8Pj3M1{font-size:32px}
29
29
  .nkyL3EtE9Zsnc5VOW43L{display:flex;flex-wrap:wrap;flex-direction:column}.nkyL3EtE9Zsnc5VOW43L .ant-table-thead>tr>th{background-color:rgba(0,0,0,0);border:0px;color:var(--color-blue)}.nkyL3EtE9Zsnc5VOW43L .ant-table-thead>tr>th:before{display:none}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper{margin-bottom:12px}.nkyL3EtE9Zsnc5VOW43L .ant-table-cell{word-break:break-word}.nkyL3EtE9Zsnc5VOW43L .ant-table-tbody>tr{cursor:pointer}.nkyL3EtE9Zsnc5VOW43L .ant-table-tbody>tr:last-child>td{border-bottom:1px solid var(--color-grey-light) !important}.nkyL3EtE9Zsnc5VOW43L .ant-table-tbody>tr:first-child>td{border-top:1px solid var(--color-blue) !important}.nkyL3EtE9Zsnc5VOW43L .ant-table-tbody>tr:hover td{border-radius:0 !important;border-bottom-color:var(--color-grey-light) !important}.nkyL3EtE9Zsnc5VOW43L .ant-space{align-self:flex-end}.nkyL3EtE9Zsnc5VOW43L .ant-select-selection-placeholder{color:var(--color-black)}.nkyL3EtE9Zsnc5VOW43L .ant-select-selector,.nkyL3EtE9Zsnc5VOW43L .ant-select-focused .ant-select-selection-search{border:none !important;box-shadow:none !important}.nkyL3EtE9Zsnc5VOW43L .ant-select-selector:focus,.nkyL3EtE9Zsnc5VOW43L .ant-select-selector:hover,.nkyL3EtE9Zsnc5VOW43L .ant-select-focused .ant-select-selection-search:focus,.nkyL3EtE9Zsnc5VOW43L .ant-select-focused .ant-select-selection-search:hover{border:none !important;box-shadow:none !important}.nkyL3EtE9Zsnc5VOW43L .ant-pagination{max-width:calc(100% - 200px);margin-left:auto !important}.nkyL3EtE9Zsnc5VOW43L button[type=button].ant-pagination-item-link{margin-top:0 !important}.nkyL3EtE9Zsnc5VOW43L button[type=button]{margin-top:-50px}@media screen and (max-width: 1024px){.nkyL3EtE9Zsnc5VOW43L .ant-table-thead>tr>th{font-size:12px}.nkyL3EtE9Zsnc5VOW43L .ant-table-tbody>tr>td{font-size:12px}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table-thead>tr>th{padding:8px}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table-tbody>tr>td{padding:8px}}@media screen and (max-width: 767px){.nkyL3EtE9Zsnc5VOW43L .ant-table-thead>tr>th{font-size:10px}.nkyL3EtE9Zsnc5VOW43L .ant-table-tbody>tr>td{font-size:10px}.nkyL3EtE9Zsnc5VOW43L .ant-table-content table{width:100%}.nkyL3EtE9Zsnc5VOW43L .ant-table-content{width:100%}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table .ant-table-title,.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table .ant-table-header{word-break:break-all}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table-thead>tr>th{padding:4px}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table-tbody>tr>td{padding:4px}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table-column-sorter{margin-inline-start:0px}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table-column-sorter-up{font-size:8px}.nkyL3EtE9Zsnc5VOW43L .ant-table-wrapper .ant-table-column-sorter-down{font-size:8px}.nkyL3EtE9Zsnc5VOW43L .ant-pagination{max-width:unset}}
30
+ .aZEBTQus3Y3MyodeDwkf{display:flex;flex-direction:column;align-items:center;justify-content:center}.cc1pbQlAgw2CmXVml3bs{height:300px;width:400px}.aTf_CXAsyp0tySsoZdD_{display:flex;justify-content:space-between;margin:10px 10px 0px 10px;font-size:20px}.kuu1hf_JTvYD55IW6Nxl{color:#ff4d4f}.N8ODEO3zDbY7gmecjTrp{color:#52c41a}.WIsL9Shu6c0mGJq9qSSz{margin-top:20px;border-radius:4px;overflow:hidden}.WIsL9Shu6c0mGJq9qSSz img{width:100%;height:auto}
@@ -0,0 +1,4 @@
1
+ import { Meta, Story } from "@storybook/react";
2
+ declare const _default: Meta<import("@storybook/react").Args>;
3
+ export default _default;
4
+ export declare const Primary: Story<any>;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ interface CameraCaptureProps {
3
+ isCameraOn: boolean;
4
+ customClass?: string;
5
+ setImgSrc: React.Dispatch<React.SetStateAction<string>>;
6
+ }
7
+ export declare const CameraCapture: React.FC<CameraCaptureProps>;
8
+ export {};
@@ -26,3 +26,4 @@ export * from './Notification';
26
26
  export * from './ExportTableData';
27
27
  export * from './DropdownButton';
28
28
  export * from './ResponsiveTable';
29
+ export * from './WebCam';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@omniumretail/component-library",
3
- "version": "1.1.30",
3
+ "version": "1.1.31",
4
4
  "private": false,
5
5
  "main": "dist/bundle.js",
6
6
  "typings": "./dist/types/index",
@@ -57,6 +57,7 @@
57
57
  "react-dom": "^18.2.0",
58
58
  "react-easy-crop": "^4.7.4",
59
59
  "react-i18next": "^12.1.4",
60
+ "react-webcam": "^7.1.1",
60
61
  "sass": "^1.56.1",
61
62
  "sass-loader": "^12.3.0",
62
63
  "style-loader": "^3.3.1",
@@ -0,0 +1,24 @@
1
+ import { Meta, Story } from "@storybook/react";
2
+ import { CameraCapture } from '.';
3
+ import { useState } from "react";
4
+ import { Button } from "antd";
5
+
6
+ export default {
7
+ title: 'CameraCapture',
8
+ component: CameraCapture,
9
+ } as Meta;
10
+
11
+ const Template: Story<any> = (args) => {
12
+ const [openCamera, setOpenCamera] = useState(false);
13
+ const [imgSrc, setImgSrc] = useState("");
14
+
15
+ return <>
16
+ <p>Source: {imgSrc}</p>
17
+ <Button onClick={() => setOpenCamera(!openCamera)}>Open</Button>
18
+ <CameraCapture {...args} setImgSrc={setImgSrc} isCameraOn={openCamera}></CameraCapture>
19
+ </>;
20
+ }
21
+
22
+ export const Primary = Template.bind({});
23
+ Primary.args = {
24
+ };
@@ -0,0 +1,72 @@
1
+ import React, { useRef, useState } from 'react';
2
+ import styles from './styles.module.scss';
3
+ import Webcam from 'react-webcam';
4
+ import { useTranslation } from 'react-i18next';
5
+ import { CheckOutlined, CloseOutlined } from '@ant-design/icons';
6
+ import classNames from 'classnames';
7
+ import { Button } from 'antd';
8
+
9
+ interface CameraCaptureProps {
10
+ isCameraOn: boolean;
11
+ customClass?: string;
12
+ setImgSrc: React.Dispatch<React.SetStateAction<string>>;
13
+ }
14
+
15
+ export const CameraCapture: React.FC<CameraCaptureProps> = ({ isCameraOn, customClass, setImgSrc }) => {
16
+ const { t } = useTranslation();
17
+
18
+ const webcamRef = useRef<Webcam>(null);
19
+ const [imageSrc, setImageSrc] = useState<string | null>(null);
20
+ const [captured, setCaptured] = useState(false);
21
+
22
+ const capture = () => {
23
+ const imageSrc = webcamRef.current?.getScreenshot();
24
+ if (imageSrc) {
25
+ setImageSrc(imageSrc);
26
+ setCaptured(true);
27
+ }
28
+ };
29
+
30
+ const retake = () => {
31
+ setImageSrc(null);
32
+ setCaptured(false);
33
+ };
34
+
35
+ const confirm = () => {
36
+ setImgSrc(imageSrc as string);
37
+ setCaptured(false);
38
+ };
39
+
40
+ const webCamStyle = classNames({
41
+ [`${customClass}`]: customClass,
42
+ }, [styles.webCam]);
43
+
44
+ return (
45
+ <div className={styles.cameraCapture}>
46
+ <div>
47
+ {isCameraOn && !captured && (
48
+ <Webcam
49
+ audio={false}
50
+ ref={webcamRef}
51
+ screenshotFormat="image/jpeg"
52
+ className={webCamStyle}
53
+ />
54
+ )}
55
+ </div>
56
+
57
+ {isCameraOn && !captured && (
58
+ <Button onClick={capture}>{t('components.webCam.takePhoto')}</Button>
59
+ )}
60
+
61
+ {captured && (
62
+ <div className={styles.capturedImage}>
63
+ <img src={imageSrc || ''} alt="Captured" />
64
+ <div className={styles.buttonGroup}>
65
+ <CloseOutlined onClick={retake} title={t('components.webCam.takeAgain')!} className={styles.closeButton} />
66
+ <CheckOutlined onClick={confirm} title={t('components.webCam.confirm')!} className={styles.checkButton} />
67
+ </div>
68
+ </div>
69
+ )}
70
+ </div>
71
+ );
72
+ };
@@ -0,0 +1,37 @@
1
+ .cameraCapture {
2
+ display: flex;
3
+ flex-direction: column;
4
+ align-items: center;
5
+ justify-content: center;
6
+ }
7
+
8
+ .webCam {
9
+ height: 300px;
10
+ width: 400px;
11
+ }
12
+
13
+ .buttonGroup {
14
+ display: flex;
15
+ justify-content: space-between;
16
+ margin: 10px 10px 0px 10px;
17
+ font-size: 20px;
18
+ }
19
+
20
+ .closeButton {
21
+ color: #ff4d4f;
22
+ }
23
+
24
+ .checkButton {
25
+ color: #52c41a;
26
+ }
27
+
28
+ .capturedImage {
29
+ margin-top: 20px;
30
+ border-radius: 4px;
31
+ overflow: hidden;
32
+ }
33
+
34
+ .capturedImage img {
35
+ width: 100%;
36
+ height: auto;
37
+ }
@@ -26,3 +26,4 @@ export * from './Notification';
26
26
  export * from './ExportTableData';
27
27
  export * from './DropdownButton';
28
28
  export * from './ResponsiveTable';
29
+ export * from './WebCam';
@@ -1,88 +1,94 @@
1
1
  {
2
2
  "tableHeadings": {
3
- "key": "Key",
4
- "name": "Name",
5
- "mecanographicNumber": "Employee Code",
6
- "store": "Store",
7
- "role": "Role",
8
- "type": "Type",
9
- "id": "Id",
10
- "action": "Action"
3
+ "key": "Clave",
4
+ "name": "Nombre",
5
+ "mecanographicNumber": "Código de Empleado",
6
+ "store": "Tienda",
7
+ "role": "Rol",
8
+ "type": "Tipo",
9
+ "id": "ID",
10
+ "action": "Acción"
11
11
  },
12
12
  "userInfoColumn": {
13
- "Date": "Date",
14
- "Store": "Store",
15
- "Team": "Team",
13
+ "Date": "Fecha",
14
+ "Store": "Tienda",
15
+ "Team": "Equipo",
16
16
  "Supervisor": "Supervisor",
17
- "TypeOfContract": "Type Of Contract",
18
- "Nationality": "Nationality",
19
- "CivilStatus": "Civil Status",
20
- "IdentificationDocument": "Identification Document",
21
- "NTaxpayer": "Taxpayer Number",
17
+ "TypeOfContract": "Tipo de Contrato",
18
+ "Nationality": "Nacionalidad",
19
+ "CivilStatus": "Estado Civil",
20
+ "IdentificationDocument": "Documento de Identificación",
21
+ "NTaxpayer": "Número de Contribuyente",
22
22
  "NIB": "NIB",
23
- "SocialSecurity": "Social Security",
24
- "NChildren": "Number of Children",
25
- "Workload": "Workload",
26
- "Description": "Description",
27
- "Comments": "Comments"
23
+ "SocialSecurity": "Seguro Social",
24
+ "NChildren": "Número de Hijos",
25
+ "Workload": "Carga de Trabajo",
26
+ "Description": "Descripción",
27
+ "Comments": "Comentarios"
28
28
  },
29
29
  "navigation": {
30
- "back": "Back",
31
- "logout": "Logout",
32
- "home": "Home"
30
+ "back": "Atrás",
31
+ "logout": "Cerrar Sesión",
32
+ "home": "Inicio"
33
33
  },
34
34
  "actions": {
35
- "one": "one",
36
- "two": "two"
35
+ "one": "Uno",
36
+ "two": "Dos"
37
37
  },
38
38
  "components": {
39
39
  "category": {
40
- "addQuestion": "Add Question",
41
- "placeholderInfo": "Placeholder Info",
42
- "errorInfo": "Error Info",
43
- "placeholderQuestion": "Question",
44
- "errorQuestion": "Error/Missing Question",
45
- "placeholderGrade": "Grade",
46
- "errorGrade": "Error/Missing Grade",
47
- "newCategory": "New Category"
40
+ "addQuestion": "Agregar Pregunta",
41
+ "placeholderInfo": "Información de Marcador",
42
+ "errorInfo": "Error de Información",
43
+ "placeholderQuestion": "Pregunta",
44
+ "errorQuestion": "Error/Pregunta Faltante",
45
+ "placeholderGrade": "Calificación",
46
+ "errorGrade": "Error/Calificación Faltante",
47
+ "newCategory": "Nueva Categoría"
48
48
  },
49
49
  "categorySidBar": {
50
- "addCategory": "Add Category",
51
- "removeCategory": "Remove Category"
50
+ "addCategory": "Agregar Categoría",
51
+ "removeCategory": "Eliminar Categoría"
52
52
  },
53
53
  "categoryContent": {
54
- "message": "Please select a category in the sidebar",
55
- "categoryName": "Category Name",
56
- "categoryNameError": "Category Name Error/Missing",
57
- "weighting": "Weighting",
58
- "openAnswer": "Open Answer",
59
- "answerOption": "Answer Option",
60
- "answers": "Answers"
54
+ "message": "Por favor, seleccione una categoría en la barra lateral",
55
+ "categoryName": "Nombre de la Categoría",
56
+ "categoryNameError": "Error/Nombre de Categoría Faltante",
57
+ "weighting": "Ponderación",
58
+ "openAnswer": "Respuesta Abierta",
59
+ "answerOption": "Opción de Respuesta",
60
+ "answers": "Respuestas"
61
61
  },
62
62
  "categoryResponse": {
63
- "notApplicable": "Not Applicable",
64
- "answer": "Answer"
63
+ "notApplicable": "No Aplicable",
64
+ "answer": "Respuesta"
65
65
  },
66
66
  "categoryReadOnly": {
67
- "categories": "Categories",
68
- "categoryAverage": "Category Average",
69
- "userResponse": "User Response:",
70
- "supervisorResponse": "Supervisor Response:"
67
+ "categories": "Categorías",
68
+ "categoryAverage": "Promedio de la Categoría",
69
+ "userResponse": "Respuesta del Usuario:",
70
+ "supervisorResponse": "Respuesta del Supervisor:"
71
71
  },
72
72
  "analyticsBar": {
73
- "desc": "Descending",
74
- "asc": "Ascending"
73
+ "desc": "Descendente",
74
+ "asc": "Ascendente"
75
75
  },
76
76
  "tag": {
77
- "search": "Search",
78
- "advancedFields": "Advanced Filters"
77
+ "search": "Buscar",
78
+ "advancedFields": "Filtros Avanzados",
79
+ "State": "Estado"
79
80
  },
80
81
  "table": {
81
- "selectAll": "Select All",
82
- "deselectAll": "Deselect All"
82
+ "selectAll": "Seleccionar Todo",
83
+ "deselectAll": "Deseleccionar Todo"
83
84
  },
84
85
  "datePickerTag": {
85
- "placeholder": "Select Date"
86
- }
86
+ "placeholder": "Seleccionar Fecha"
87
+ },
88
+ "webCam": {
89
+ "takePhoto": "Take Photo",
90
+ "confirm": "Confirm",
91
+ "takeAgain": "Take Again"
92
+ }
87
93
  }
88
94
  }
@@ -83,6 +83,11 @@
83
83
  },
84
84
  "datePickerTag": {
85
85
  "placeholder": "Selecionar Data"
86
- }
86
+ },
87
+ "webCam": {
88
+ "takePhoto": "Tomar Foto",
89
+ "confirm": "Confirmar",
90
+ "takeAgain": "Tomar de Nuevo"
91
+ }
87
92
  }
88
93
  }
@@ -32,8 +32,8 @@
32
32
  "home": "Início"
33
33
  },
34
34
  "actions": {
35
- "one": "one",
36
- "two": "two"
35
+ "one": "um",
36
+ "two": "dois"
37
37
  },
38
38
  "components": {
39
39
  "category": {
@@ -84,6 +84,11 @@
84
84
  },
85
85
  "datePickerTag": {
86
86
  "placeholder": "Selecionar Data"
87
+ },
88
+ "webCam": {
89
+ "takePhoto": "Tirar Foto",
90
+ "confirm": "Confirmar",
91
+ "takeAgain": "Tirar Novamente"
87
92
  }
88
93
  }
89
94
  }