@regulaforensics/ui-components 8.4.691-nightly → 8.4.694-nightly

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/README.md CHANGED
@@ -1,6 +1,7 @@
1
1
  # Regula React UI components
2
2
 
3
- This package contains React UI components for Regula products.
3
+ This package contains React UI components for Regula products
4
+ and [TypeScript definitions](#document-reader-typings) for Regula Document Reader SDK.
4
5
 
5
6
  ## Document-reader processing result tabs
6
7
 
@@ -11,7 +12,7 @@ import { FC } from 'react'
11
12
  import { createRoot } from 'react-dom/client'
12
13
  import {
13
14
  DocReaderContainer,
14
- Status,
15
+ Details,
15
16
  Info,
16
17
  Graphics,
17
18
  Rfid,
@@ -31,7 +32,7 @@ interface ProcessingResultsProps {
31
32
 
32
33
  const ResultsTab = () => (
33
34
  <>
34
- <Status />
35
+ <Details />
35
36
  <Info />
36
37
  <Graphics />
37
38
  <Rfid />
@@ -68,12 +69,30 @@ const root = createRoot(document.getElementById('root'));
68
69
  root.render(<Results />);
69
70
  ```
70
71
 
71
- ## Document-reader processing result tabs
72
+ ## Importing a package
73
+
74
+ By default, styles are automatically imported into the package build and there is no need to make additional style imports:
75
+
76
+ ```typescript
77
+ import { Collapse } from '@regulaforensics/ui-components'
78
+ ```
72
79
 
73
- By default, styles are automatically imported into the package build and there is no need to make additional style imports. But there are times when you need to control the style import process yourself:
80
+ But there are times when you need to control the style import process yourself:
74
81
 
75
82
  ```typescript
76
83
  import '@regulaforensics/ui-components/styles' // connect styles where you need to
77
84
 
78
85
  import { Collapse } from '@regulaforensics/ui-components/core' // use the components
79
86
  ```
87
+
88
+ ## Document reader typings
89
+
90
+ The package also contains TypeScript definitions for Regula Document Reader SDK.
91
+ These definitions are constructed using class transformers and class validators. With their help, you can
92
+ transform the raw response from the Regula Document Reader SDK into a typed one:
93
+
94
+ ```typescript
95
+ import { ProcessResponse } from '@regulaforensics/ui-components/typings'
96
+
97
+ const typedResponse = ProcessResponse.fromPlain(rawResponse)
98
+ ```