@parafin/react 2.0.0 → 3.0.1

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.
Files changed (3) hide show
  1. package/index.tsx +107 -38
  2. package/out/index.d.ts +76 -9
  3. package/package.json +3 -3
package/index.tsx CHANGED
@@ -1,44 +1,6 @@
1
1
  import { useEffect, useRef, useState } from 'react'
2
2
  import { openParafinDashboard } from '@parafin/core'
3
3
 
4
- type Address = {
5
- addressLine1: string
6
- addressLine2?: string
7
- city: string
8
- state: string
9
- postalCode: string
10
- country: 'US' | 'CA'
11
- }
12
-
13
- type OptInFields = {
14
- businessExternalId: string
15
- accountManagers?: {
16
- name: string
17
- email: string
18
- }[]
19
- owner: {
20
- firstName: string
21
- lastName: string
22
- email: string
23
- phoneNumber?: string
24
- /** yyyy-mm-dd */
25
- dateOfBirth?: string
26
- address?: Address
27
- }
28
- business: {
29
- legalName: string
30
- dbaName?: string
31
- address?: Address
32
- /** yyyy-mm-dd */
33
- dateEstablished?: string
34
- }
35
- bank?: {
36
- routingNumber?: string
37
- accountNumberLastFour?: string
38
- currencyCode?: 'USD' | 'CAD'
39
- }
40
- }
41
-
42
4
  const ParafinWidget = (
43
5
  props: {
44
6
  token: string
@@ -123,3 +85,110 @@ const ParafinWidget = (
123
85
  }
124
86
 
125
87
  export { OptInFields, ParafinWidget }
88
+
89
+ // American states and Canadian provinces
90
+ type State = {
91
+ AL: 'AL'
92
+ AK: 'AK'
93
+ AZ: 'AZ'
94
+ AR: 'AR'
95
+ CA: 'CA'
96
+ CO: 'CO'
97
+ CT: 'CT'
98
+ DE: 'DE'
99
+ DC: 'DC'
100
+ FL: 'FL'
101
+ GA: 'GA'
102
+ HI: 'HI'
103
+ ID: 'ID'
104
+ IL: 'IL'
105
+ IN: 'IN'
106
+ IA: 'IA'
107
+ KS: 'KS'
108
+ KY: 'KY'
109
+ LA: 'LA'
110
+ ME: 'ME'
111
+ MD: 'MD'
112
+ MA: 'MA'
113
+ MI: 'MI'
114
+ MN: 'MN'
115
+ MS: 'MS'
116
+ MO: 'MO'
117
+ MT: 'MT'
118
+ NE: 'NE'
119
+ NV: 'NV'
120
+ NH: 'NH'
121
+ NJ: 'NJ'
122
+ NM: 'NM'
123
+ NY: 'NY'
124
+ NC: 'NC'
125
+ ND: 'ND'
126
+ OH: 'OH'
127
+ OK: 'OK'
128
+ OR: 'OR'
129
+ PA: 'PA'
130
+ PR: 'PR'
131
+ RI: 'RI'
132
+ SC: 'SC'
133
+ SD: 'SD'
134
+ TN: 'TN'
135
+ TX: 'TX'
136
+ UT: 'UT'
137
+ VT: 'VT'
138
+ VA: 'VA'
139
+ WA: 'WA'
140
+ WV: 'WV'
141
+ WI: 'WI'
142
+ WY: 'WY'
143
+ AB: 'AB'
144
+ BC: 'BC'
145
+ MB: 'MB'
146
+ NB: 'NB'
147
+ NL: 'NL'
148
+ NT: 'NT'
149
+ NS: 'NS'
150
+ NU: 'NU'
151
+ QC: 'QC'
152
+ ON: 'ON'
153
+ PE: 'PE'
154
+ SK: 'SK'
155
+ YT: 'YT'
156
+ }
157
+
158
+ type Address = {
159
+ addressLine1: string
160
+ addressLine2?: string
161
+ city: string
162
+ state: State
163
+ postalCode: string
164
+ country: 'US' | 'CA'
165
+ }
166
+
167
+ type OptInFields = {
168
+ businessExternalId: string
169
+ accountManagers?: {
170
+ name: string
171
+ email: string
172
+ }[]
173
+ owner: {
174
+ firstName: string
175
+ lastName: string
176
+ email: string
177
+ phoneNumber?: string
178
+ /** yyyy-mm-dd */
179
+ dateOfBirth?: string
180
+ address?: Address
181
+ }
182
+ business: {
183
+ legalName: string
184
+ dbaName?: string
185
+ address?: Address
186
+ /** yyyy-mm-dd */
187
+ dateEstablished?: string
188
+ }
189
+ bank?: {
190
+ routingNumber?: string
191
+ accountNumberLastFour?: string
192
+ currencyCode?: 'USD' | 'CAD'
193
+ }
194
+ }
package/out/index.d.ts CHANGED
@@ -1,8 +1,83 @@
1
+ declare const ParafinWidget: (props: {
2
+ token: string;
3
+ product: 'capital' | 'wallet';
4
+ externalBusinessId?: string;
5
+ onExit?: () => void;
6
+ onOptIn?: () => Promise<OptInFields>;
7
+ } & Record<string, any>) => JSX.Element;
8
+ export { OptInFields, ParafinWidget };
9
+ type State = {
10
+ AL: 'AL';
11
+ AK: 'AK';
12
+ AZ: 'AZ';
13
+ AR: 'AR';
14
+ CA: 'CA';
15
+ CO: 'CO';
16
+ CT: 'CT';
17
+ DE: 'DE';
18
+ DC: 'DC';
19
+ FL: 'FL';
20
+ GA: 'GA';
21
+ HI: 'HI';
22
+ ID: 'ID';
23
+ IL: 'IL';
24
+ IN: 'IN';
25
+ IA: 'IA';
26
+ KS: 'KS';
27
+ KY: 'KY';
28
+ LA: 'LA';
29
+ ME: 'ME';
30
+ MD: 'MD';
31
+ MA: 'MA';
32
+ MI: 'MI';
33
+ MN: 'MN';
34
+ MS: 'MS';
35
+ MO: 'MO';
36
+ MT: 'MT';
37
+ NE: 'NE';
38
+ NV: 'NV';
39
+ NH: 'NH';
40
+ NJ: 'NJ';
41
+ NM: 'NM';
42
+ NY: 'NY';
43
+ NC: 'NC';
44
+ ND: 'ND';
45
+ OH: 'OH';
46
+ OK: 'OK';
47
+ OR: 'OR';
48
+ PA: 'PA';
49
+ PR: 'PR';
50
+ RI: 'RI';
51
+ SC: 'SC';
52
+ SD: 'SD';
53
+ TN: 'TN';
54
+ TX: 'TX';
55
+ UT: 'UT';
56
+ VT: 'VT';
57
+ VA: 'VA';
58
+ WA: 'WA';
59
+ WV: 'WV';
60
+ WI: 'WI';
61
+ WY: 'WY';
62
+ AB: 'AB';
63
+ BC: 'BC';
64
+ MB: 'MB';
65
+ NB: 'NB';
66
+ NL: 'NL';
67
+ NT: 'NT';
68
+ NS: 'NS';
69
+ NU: 'NU';
70
+ QC: 'QC';
71
+ ON: 'ON';
72
+ PE: 'PE';
73
+ SK: 'SK';
74
+ YT: 'YT';
75
+ };
1
76
  type Address = {
2
77
  addressLine1: string;
3
78
  addressLine2?: string;
4
79
  city: string;
5
- state: string;
80
+ state: State;
6
81
  postalCode: string;
7
82
  country: 'US' | 'CA';
8
83
  };
@@ -34,11 +109,3 @@ type OptInFields = {
34
109
  currencyCode?: 'USD' | 'CAD';
35
110
  };
36
111
  };
37
- declare const ParafinWidget: (props: {
38
- token: string;
39
- product: 'capital' | 'wallet';
40
- externalBusinessId?: string;
41
- onExit?: () => void;
42
- onOptIn?: () => Promise<OptInFields>;
43
- } & Record<string, any>) => JSX.Element;
44
- export { OptInFields, ParafinWidget };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parafin/react",
3
- "version": "2.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "Parafin React widget",
5
5
  "author": "Parafin (https://www.parafin.com)",
6
6
  "module": "out/index.js",
@@ -10,11 +10,11 @@
10
10
  "build": "tsc"
11
11
  },
12
12
  "devDependencies": {
13
- "@types/react": "^16.8.0",
13
+ "@types/react": ">=16.8.0",
14
14
  "typescript": "^4.9.5"
15
15
  },
16
16
  "dependencies": {
17
17
  "@parafin/core": "^1.0.10",
18
- "react": "^16.8.0"
18
+ "react": ">=16.8.0"
19
19
  }
20
20
  }