@document-verification/docver-widget 0.4.30-rc1

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 ADDED
@@ -0,0 +1,164 @@
1
+ # DocVer-widget
2
+
3
+ ### Install
4
+
5
+ ```
6
+ yarn install @document-verification/docver-widget
7
+ ```
8
+ or
9
+ ```
10
+ npm i @document-verification/docver-widget
11
+ ```
12
+
13
+ Actual version you can find in https://www.npmjs.com/package/@document-verification/docver-widget
14
+
15
+ How to use:
16
+
17
+ ```
18
+ import { DocsVerificationWidget } from @document-verification/docver-widget;
19
+ ....
20
+ DocsVerificationWidgetProps(props);
21
+ ```
22
+
23
+ Available props:
24
+
25
+ <table>
26
+ <tr>
27
+ <th>Prop name</th>
28
+ <th>Type</th>
29
+ <th>Description</th>
30
+ </tr>
31
+ <tr>
32
+ <td>id</td>
33
+ <td>string</td>
34
+ <td>
35
+ </td>
36
+ </tr>
37
+ <tr>
38
+ <td>apiUrl</td>
39
+ <td>string</td>
40
+ <td></td>
41
+ </tr>
42
+ <tr>
43
+ <td>elementId</td>
44
+ <td>string</td>
45
+ <td>Id of element when widget will be rendered</td>
46
+ </tr>
47
+ <tr>
48
+ <td>onFinish</td>
49
+ <td>() => Promise&lt;void&gt;</td>
50
+ <td>Callback raised when user finish verification</td>
51
+ </tr>
52
+ <tr>
53
+ <td>onInit</td>
54
+ <td>(verificationStatus: 'completed' | 'expired' | 'active' | 'error', error?: unknown) => Promise&lt;void&gt;</td>
55
+ <td>Callback raised before verification started</td>
56
+ </tr>
57
+ <tr>
58
+ <td>theme</td>
59
+ <td>Check theme section</td>
60
+ <td>Custom styles</td>
61
+ </tr>
62
+ </table>
63
+
64
+ ### Example:
65
+ ```
66
+ import { DocsVerificationWidget } from '@dataspike/docver-widget';
67
+
68
+ export const renderWidget = async () => {
69
+ if (container) {
70
+ DocsVerificationWidget({
71
+ id: 'VF57124F182867E0'
72
+ elementId: 'root',
73
+ apiUrl: 'https:/docs.com',
74
+ });
75
+ }
76
+ };
77
+
78
+ renderWidget()
79
+ ```
80
+
81
+ ### Theme:
82
+ In comment described default value:
83
+ ```typescript
84
+ export type Theme = {
85
+ palette?: Partial<{
86
+ textMain: string; // #000000
87
+ textLight: string; // #737390
88
+ primaryA1: string; // #6664E8
89
+ primaryA2: string; // #5A58DF
90
+ primaryA3: string; // #D0D0FC
91
+ primaryA4: string; // #E8E8FC
92
+ primaryA5: string; // #E0E0FA
93
+ primaryA6: string; // #E6EDFB
94
+ primaryA7: string; // #FFFFFF
95
+ secondaryA1: string; // #F6CDD9
96
+ secondaryA2: string; // #F6F0C0
97
+ secondaryA3: string; // #52C27F
98
+ secondaryA4: string; // #FF5050
99
+ secondaryA5: string; // #FFFCFD
100
+ secondaryA6: string; // #FABC46
101
+ secondaryA7: string; // #B25DF5
102
+ secondaryA8: string; // #EDECFC
103
+ secondaryA9: string; // #DEE1F2
104
+ secondaryA10: string; // #F6F8FE
105
+ secondaryA11: string; // #EDECFC
106
+ secondaryA12: string; // #FAFAFC
107
+ }>;
108
+ typography?: Partial<{
109
+ fontFamily: string; // 'Funnel Display', Roboto, sans-serif
110
+ body1: {
111
+ fontFamily: string; // 'Funnel Display', Roboto, sans-serif
112
+ };
113
+ body2: {
114
+ fontFamily: string; // 'Funnel Display', Roboto, sans-serif
115
+ };
116
+ caption: {
117
+ fontFamily: string; // 'Funnel Display', Roboto, sans-serif
118
+ };
119
+ h1: Partial<{
120
+ fontFamily: string; // 'Funnel Display', Roboto, sans-serif
121
+ fontSize: string; // 50px
122
+ fontWeight: string; // 500
123
+ lineHeight: string; // 70px
124
+ letterSpacing: string; // -0.01em
125
+ }>;
126
+ h2: Partial<{
127
+ fontFamily: string; // 'Funnel Display', Roboto, sans-serif
128
+ fontSize: string; // 28px
129
+ fontWeight: string; // 500
130
+ lineHeight: string; // 40px
131
+ letterSpacing: string; // -0.01em
132
+ }>;
133
+ h3: Partial<{
134
+ fontFamily: string; // 'Funnel Display', Roboto, sans-serif
135
+ fontSize: string; // 20px
136
+ fontWeight: string; // 500
137
+ lineHeight: string; // 30px
138
+ letterSpacing: string; // -0.01em
139
+ }>;
140
+ text: Partial<{
141
+ fontSize: string; // 14px
142
+ lineHeight: string; // 22px
143
+ letterSpacing: string; // 0.002em
144
+ }>;
145
+ textBold: Partial<{
146
+ fontSize: string; // 14px
147
+ fontWeight: string; // 500
148
+ lineHeight: string; // 22px
149
+ letterSpacing: string; // 0.002em
150
+ }>;
151
+ smallText: Partial<{
152
+ fontSize: string; // 12px
153
+ lineHeight: string; // 18px
154
+ letterSpacing: string; // 0.002em
155
+ }>;
156
+ smallTextBold: Partial<{
157
+ fontSize: string; // 12px
158
+ fontWeight: string; // 500
159
+ lineHeight: string; // 18px
160
+ letterSpacing: string; // 0.002em
161
+ }>;
162
+ }>;
163
+ };
164
+ ```
package/index-wl.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import type { Theme } from './theme';
2
+
3
+ export type Props = {
4
+ id: string;
5
+ apiUrl: string;
6
+ elementId: string;
7
+ onFinish?: () => void | Promise<void>;
8
+ onInit?: (
9
+ verificationStatus: 'completed' | 'expired' | 'active' | 'error',
10
+ error?: unknown,
11
+ ) => void | Promise<void>;
12
+ settings?: unknown;
13
+ redirectUrl?: string;
14
+ logsUrl?: string;
15
+ theme?: Theme;
16
+ };
17
+
18
+ declare module '@document-verification/docver-widget' {
19
+ export type DocsVerificationWidgetProps = Props;
20
+ export const DocsVerificationWidget: (props: DocsVerificationWidgetProps) => void;
21
+ }