cortex-react-ui 0.1.172 → 0.1.174

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.
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export declare const Dialog: (props: DialogProps) => JSX.Element;
3
+ export declare type DialogTitleProps = {
4
+ title?: string;
5
+ };
6
+ export declare type DialogProps = DialogTitleProps & {
7
+ open: boolean;
8
+ className?: string;
9
+ message?: string;
10
+ confirmation?: boolean;
11
+ children?: React.ReactNode;
12
+ onClose?: () => void;
13
+ };
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const DialogBody: (props: DialogBodyProps) => JSX.Element;
3
+ export declare type DialogBodyProps = HTMLAttributes<HTMLDivElement>;
@@ -0,0 +1,3 @@
1
+ import { HTMLAttributes } from 'react';
2
+ export declare const DialogMask: (props: DialogMaskProps) => JSX.Element;
3
+ export declare type DialogMaskProps = HTMLAttributes<HTMLDivElement>;
@@ -0,0 +1,18 @@
1
+ export declare const ScanConfirmationDialog: (props: TScanConfirmDialogProps) => JSX.Element;
2
+ export declare type TScanConfirmDialogLabels = {
3
+ title?: string;
4
+ message?: string;
5
+ btnOk?: {
6
+ label: string;
7
+ style?: React.CSSProperties;
8
+ };
9
+ btnCancel?: {
10
+ label: string;
11
+ style?: React.CSSProperties;
12
+ };
13
+ };
14
+ export declare type TScanConfirmDialogProps = {
15
+ open: boolean;
16
+ onConfirm: () => void;
17
+ onClose: () => void;
18
+ } & TScanConfirmDialogLabels;
@@ -1,7 +1,11 @@
1
- import { IDetectedBarcode } from '@yudiel/react-qr-scanner';
2
- export interface ScannerProps {
1
+ import { IDetectedBarcode, IScannerProps } from '@yudiel/react-qr-scanner';
2
+ import { TScanConfirmDialogLabels } from './ScanConfirmationDialog';
3
+ declare const Scanner: ({ scanConfirmation, scanTrackerType, ...props }: ScannerProps) => JSX.Element;
4
+ export declare type TScanTrackerType = 'outline' | 'boundingBox' | 'centerText';
5
+ declare type ScannerProps = {
3
6
  scanConfirmation?: boolean;
7
+ scanConfirmDialog?: TScanConfirmDialogLabels;
8
+ scanTrackerType?: TScanTrackerType;
4
9
  onScan?: (detectedCodes: IDetectedBarcode[]) => void;
5
- }
6
- declare const Scanner: React.FC<ScannerProps>;
10
+ } & IScannerProps;
7
11
  export default Scanner;
@@ -2,10 +2,9 @@ export { default as Popper } from './Popper';
2
2
  export { default as DomContainer } from './DomContainer';
3
3
  export { default as Spinner } from './Spinner';
4
4
  export { default as BarLoader } from './BarLoader';
5
- export { default as Scanner } from './Scanner';
6
- export { default as Camera } from './Camera';
7
5
  export { default as Selected } from './Selected';
8
6
  export { default as Button } from './Button';
7
+ export { default as Scanner } from './Scanner';
9
8
  export { default as ToggleButton } from './ToggleButton';
10
9
  export { default as Tooltip } from './Tooltip';
11
10
  export { default as TagInput } from './TagInput';
package/lib/index.d.ts CHANGED
@@ -1,6 +1,5 @@
1
1
  import React$1, { CSSProperties } from 'react';
2
- import { IDetectedBarcode } from '@yudiel/react-qr-scanner';
3
- import { WebcamProps } from 'react-webcam';
2
+ import { IDetectedBarcode, IScannerProps } from '@yudiel/react-qr-scanner';
4
3
 
5
4
  declare const PopperPlacement: {
6
5
  readonly Center: "center";
@@ -60,26 +59,6 @@ interface BarLoaderProps {
60
59
  }
61
60
  declare const BarLoader: React$1.FC<BarLoaderProps>;
62
61
 
63
- interface ScannerProps {
64
- scanConfirmation?: boolean;
65
- onScan?: (detectedCodes: IDetectedBarcode[]) => void;
66
- }
67
- declare const Scanner: React.FC<ScannerProps>;
68
-
69
- declare const Camera: ({ onCapture, isOffline, mode, ...props }: CameraProps) => JSX.Element;
70
- declare type CameraProps = {
71
- onCapture: ({ fileStoreName, fileRowId, file }: TfileCapturedProps) => void;
72
- mode?: 'photo' | 'video';
73
- isOffline?: boolean;
74
- } & Partial<WebcamProps>;
75
- declare type TfileCapturedProps = {
76
- fileStoreName?: string | null;
77
- fileRowId?: number | null;
78
- file?: File | null;
79
- imageSrc?: string | null;
80
- videoSrc?: string | null;
81
- };
82
-
83
62
  interface SelectedProps {
84
63
  title?: string;
85
64
  data: any[];
@@ -97,6 +76,28 @@ interface ButtonProps {
97
76
  }
98
77
  declare const Button: React$1.FC<ButtonProps>;
99
78
 
79
+ declare type TScanConfirmDialogLabels = {
80
+ title?: string;
81
+ message?: string;
82
+ btnOk?: {
83
+ label: string;
84
+ style?: React.CSSProperties;
85
+ };
86
+ btnCancel?: {
87
+ label: string;
88
+ style?: React.CSSProperties;
89
+ };
90
+ };
91
+
92
+ declare const Scanner: ({ scanConfirmation, scanTrackerType, ...props }: ScannerProps) => JSX.Element;
93
+ declare type TScanTrackerType = 'outline' | 'boundingBox' | 'centerText';
94
+ declare type ScannerProps = {
95
+ scanConfirmation?: boolean;
96
+ scanConfirmDialog?: TScanConfirmDialogLabels;
97
+ scanTrackerType?: TScanTrackerType;
98
+ onScan?: (detectedCodes: IDetectedBarcode[]) => void;
99
+ } & IScannerProps;
100
+
100
101
  interface ToggleButtonProps {
101
102
  selected?: boolean;
102
103
  value?: string;
@@ -306,4 +307,4 @@ interface Props {
306
307
  }
307
308
  declare const CrossIcon: React$1.FC<Props>;
308
309
 
309
- export { AuthDownloadLink, BarLoader, Button, Camera, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ConfirmDialog, ContextMenu, CrossIcon, Dialog, DialogActions, DialogContent$1 as DialogContent, DialogFooter, DialogHeader, DialogContent as DialogTitle, Divider, DomContainer, ErrorDialog, Menu, MenuGroup, MenuItem, Popper, PopupMenu, Scanner, Selected, Spinner, TagInput, ToggleButton, Tooltip, WarningDialog };
310
+ export { AuthDownloadLink, BarLoader, Button, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ConfirmDialog, ContextMenu, CrossIcon, Dialog, DialogActions, DialogContent$1 as DialogContent, DialogFooter, DialogHeader, DialogContent as DialogTitle, Divider, DomContainer, ErrorDialog, Menu, MenuGroup, MenuItem, Popper, PopupMenu, Scanner, Selected, Spinner, TagInput, ToggleButton, Tooltip, WarningDialog };
@@ -8,11 +8,11 @@
8
8
  @import "TextField";
9
9
  @import "Menu";
10
10
  @import "Dialog";
11
+ @import "Scanner";
11
12
  @import "Button";
12
13
  @import "ToggleButton";
13
14
  @import "Selected";
14
15
  @import "BarLoader";
15
- @import "Camera";
16
16
 
17
17
 
18
18
  @include icons();
@@ -22,12 +22,12 @@
22
22
  @include taginput();
23
23
  @include input();
24
24
  @include menu();
25
+ @include scanner();
25
26
  @include dialog();
26
27
  @include button();
27
28
  @include toggleButton();
28
29
  @include selected();
29
30
  @include barLoader();
30
- @include camera();
31
31
 
32
32
  // @include popper();
33
33
  // @include popper(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cortex-react-ui",
3
- "version": "0.1.172",
3
+ "version": "0.1.174",
4
4
  "description": "React UI",
5
5
  "author": "Anthony",
6
6
  "license": "MIT",
@@ -94,10 +94,7 @@
94
94
  "sass-loader": "10.1.1",
95
95
  "storybook-dark-mode": "^1.0.9",
96
96
  "style-loader": "2.0.0",
97
- "typescript": "^4.1.2",
98
- "lodash": "^4.17.21",
99
- "react-icons": "^5.3.0",
100
- "react-webcam": "^7.2.0"
97
+ "typescript": "^4.1.2"
101
98
  },
102
99
  "dependencies": {
103
100
  "@rollup/plugin-replace": "^5.0.2"
@@ -1,15 +0,0 @@
1
- import { WebcamProps } from 'react-webcam';
2
- declare const Camera: ({ onCapture, isOffline, mode, ...props }: CameraProps) => JSX.Element;
3
- export declare type CameraProps = {
4
- onCapture: ({ fileStoreName, fileRowId, file }: TfileCapturedProps) => void;
5
- mode?: 'photo' | 'video';
6
- isOffline?: boolean;
7
- } & Partial<WebcamProps>;
8
- export declare type TfileCapturedProps = {
9
- fileStoreName?: string | null;
10
- fileRowId?: number | null;
11
- file?: File | null;
12
- imageSrc?: string | null;
13
- videoSrc?: string | null;
14
- };
15
- export default Camera;
@@ -1,9 +0,0 @@
1
- declare class FileStorageDB {
2
- private dbName;
3
- private storeName;
4
- private db;
5
- openDatabase(): Promise<IDBDatabase>;
6
- storeFile(file: File): Promise<number>;
7
- retrieveFile(id: number): Promise<File | null>;
8
- }
9
- export default FileStorageDB;
@@ -1 +0,0 @@
1
- export { default } from './Camera';
@@ -1,6 +0,0 @@
1
- export declare const useTimer: () => {
2
- formatTime: (totalSeconds: number) => string;
3
- startTimer: () => void;
4
- stopTimer: () => void;
5
- formatedTime: string;
6
- };
@@ -1,192 +0,0 @@
1
- .camera-container {
2
- width: 100%;
3
- height: 100%;
4
- background-color: #000;
5
- }
6
-
7
- .camera-switch-btn {
8
- all: initial;
9
- display: flex;
10
- cursor: pointer;
11
- }
12
-
13
- .camera-recording-dot {
14
- width: 8px;
15
- height: 8px;
16
- border-radius: 50%;
17
- background-color: #f44336;
18
- animation: clignote 1s infinite;
19
- }
20
-
21
- .camera-recording-timer {
22
- z-index: 99;
23
- position: absolute;
24
- top: 1rem;
25
- left: 20px;
26
- display: flex;
27
- align-items: center;
28
- justify-content: center;
29
- background: rgba(0, 0, 0, 0.2);
30
- border-radius: 4px;
31
- padding: 3px 7px;
32
- font-size: 12px;
33
- color: #fff;
34
- font-family: sans-serif;
35
- gap: 6px;
36
- }
37
-
38
- .camera-offline-mode {
39
- position: absolute;
40
- top: 1rem;
41
- right: 20px;
42
- display: flex;
43
- align-items: center;
44
- justify-content: center;
45
- background: rgba(0, 0, 0, 0.2);
46
- border-radius: 4px;
47
- padding: 3px 7px;
48
- font-size: 12px;
49
- color: red;
50
- font-family: sans-serif;
51
- }
52
-
53
- .camera-mode {
54
- z-index: 9999;
55
- position: absolute;
56
- bottom: 2rem;
57
- right: 20px;
58
- padding: 0.5rem;
59
- border-radius: 6px;
60
- color: #ffffff;
61
- border: none;
62
- cursor: pointer;
63
- display: flex;
64
- justify-content: center;
65
- align-items: center;
66
- gap: 7px;
67
- background-color: #2196f3;
68
- transition: background-color 0.3s ease;
69
- }
70
-
71
- .camera-preview {
72
- position: relative;
73
- width: 100%;
74
- height: 100%;
75
- overflow: hidden;
76
- }
77
-
78
- .camera-controls {
79
- z-index: 999;
80
- position: absolute;
81
- bottom: 2rem;
82
- left: 0;
83
- right: 0;
84
- display: flex;
85
- justify-content: center;
86
- gap: 1rem;
87
- }
88
-
89
- .video-play-btn {
90
- all: initial;
91
- position: absolute;
92
- bottom: 10%;
93
- left: 50%;
94
- z-index: 9;
95
- width: 1em;
96
- height: 1em;
97
- min-width: 15px;
98
- min-height: 15px;
99
- transform: translate(-50%, -50%);
100
- display: flex;
101
- justify-content: center;
102
- align-items: center;
103
- border-radius: 50%;
104
- border: 1px solid;
105
- padding: 20px 20px;
106
- background-color: #ffffff;
107
- cursor: pointer;
108
- }
109
-
110
- .camera-button {
111
- padding: 0.5rem;
112
- border-radius: 6px;
113
- color: #ffffff;
114
- border: none;
115
- cursor: pointer;
116
- display: flex;
117
- justify-content: center;
118
- align-items: center;
119
- gap: 7px;
120
- transition: background-color 0.3s ease;
121
- }
122
- .camera-button--capture {
123
- border-radius: 50%;
124
- color: initial;
125
- width: 50px;
126
- height: 50px;
127
- border: 1px solid black;
128
- background-color: #ffffff;
129
- }
130
- .camera-button--record {
131
- border-radius: 50%;
132
- color: red;
133
- width: 50px;
134
- height: 50px;
135
- border: 1px solid black;
136
- background-color: #ffffff;
137
- }
138
- .camera-button--download {
139
- background-color: #4caf50;
140
- }
141
- .camera-button--download:hover {
142
- background-color: #388e3c;
143
- }
144
- .camera-button--reset {
145
- background-color: #9e9e9e;
146
- }
147
- .camera-button--reset:hover {
148
- background-color: #757575;
149
- }
150
-
151
- .camera-offline-mode {
152
- font-size: 0.875rem;
153
- font-family: sans-serif;
154
- color: #d32f2f;
155
- }
156
-
157
- .camera-screen-animation {
158
- animation: fadeIn 0.3s;
159
- }
160
-
161
- @keyframes fadeIn {
162
- 0% {
163
- opacity: 0;
164
- }
165
- 100% {
166
- opacity: 1;
167
- }
168
- }
169
- @keyframes pulse {
170
- 0% {
171
- transform: scale(1);
172
- }
173
- 50% {
174
- transform: scale(1.05);
175
- }
176
- 100% {
177
- transform: scale(1);
178
- }
179
- }
180
- @keyframes clignote {
181
- 0% {
182
- opacity: 1;
183
- }
184
- 50% {
185
- opacity: 0;
186
- }
187
- 100% {
188
- opacity: 1;
189
- }
190
- }
191
-
192
- /*# sourceMappingURL=index.css.map */
File without changes