@getopenpay/openpay-js-react 0.0.2-beta.1 → 0.0.2
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/package.json +2 -2
- package/dist/index.d.ts +0 -233
- package/dist/index.js +0 -3106
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getopenpay/openpay-js-react",
|
|
3
|
-
"version": "0.0.2
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Accept payments through OpenPay, right on your site",
|
|
5
5
|
"author": "OpenPay <info@getopenpay.com> (https://getopenpay.com)",
|
|
6
6
|
"type": "module",
|
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
],
|
|
18
18
|
"scripts": {
|
|
19
19
|
"build": "tsc -p tsconfig.build.json && vite build",
|
|
20
|
+
"build:alpha": "npm run build -- --mode staging",
|
|
20
21
|
"build:dev": "tsc -p tsconfig.build.json && NODE_ENV=development vite build --mode development --watch",
|
|
21
22
|
"lint": "eslint . --ignore-path=.eslintignore --report-unused-disable-directives --max-warnings 0",
|
|
22
23
|
"lint:fix": "eslint . --fix --ignore-path=.eslintignore --report-unused-disable-directives --max-warnings 0",
|
|
23
24
|
"test": "NODE_ENV=development npm run build -- --mode development && playwright test",
|
|
24
|
-
"build:alpha": "NODE_ENV=development npm run build -- --mode development",
|
|
25
25
|
"prepare": "husky"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
package/dist/index.d.ts
DELETED
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
import { z } from 'zod';
|
|
3
|
-
|
|
4
|
-
export declare const Appearance: z.ZodObject<{
|
|
5
|
-
theme: z.ZodEnum<[AppearanceTheme.UNSTYLED, AppearanceTheme.LIGHT, AppearanceTheme.DARK]>;
|
|
6
|
-
variables: z.ZodOptional<z.ZodObject<{
|
|
7
|
-
colorPrimary: z.ZodOptional<z.ZodString>;
|
|
8
|
-
colorBackground: z.ZodOptional<z.ZodString>;
|
|
9
|
-
colorForeground: z.ZodOptional<z.ZodString>;
|
|
10
|
-
colorText: z.ZodOptional<z.ZodString>;
|
|
11
|
-
colorDanger: z.ZodOptional<z.ZodString>;
|
|
12
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
13
|
-
fontSize: z.ZodOptional<z.ZodString>;
|
|
14
|
-
spacing: z.ZodOptional<z.ZodString>;
|
|
15
|
-
borderRadius: z.ZodOptional<z.ZodString>;
|
|
16
|
-
borderColor: z.ZodOptional<z.ZodString>;
|
|
17
|
-
borderWidth: z.ZodOptional<z.ZodString>;
|
|
18
|
-
focusRingColor: z.ZodOptional<z.ZodString>;
|
|
19
|
-
padding: z.ZodOptional<z.ZodString>;
|
|
20
|
-
}, "strip", z.ZodTypeAny, {
|
|
21
|
-
colorPrimary?: string | undefined;
|
|
22
|
-
colorBackground?: string | undefined;
|
|
23
|
-
colorForeground?: string | undefined;
|
|
24
|
-
colorText?: string | undefined;
|
|
25
|
-
colorDanger?: string | undefined;
|
|
26
|
-
fontFamily?: string | undefined;
|
|
27
|
-
fontSize?: string | undefined;
|
|
28
|
-
spacing?: string | undefined;
|
|
29
|
-
borderRadius?: string | undefined;
|
|
30
|
-
borderColor?: string | undefined;
|
|
31
|
-
borderWidth?: string | undefined;
|
|
32
|
-
focusRingColor?: string | undefined;
|
|
33
|
-
padding?: string | undefined;
|
|
34
|
-
}, {
|
|
35
|
-
colorPrimary?: string | undefined;
|
|
36
|
-
colorBackground?: string | undefined;
|
|
37
|
-
colorForeground?: string | undefined;
|
|
38
|
-
colorText?: string | undefined;
|
|
39
|
-
colorDanger?: string | undefined;
|
|
40
|
-
fontFamily?: string | undefined;
|
|
41
|
-
fontSize?: string | undefined;
|
|
42
|
-
spacing?: string | undefined;
|
|
43
|
-
borderRadius?: string | undefined;
|
|
44
|
-
borderColor?: string | undefined;
|
|
45
|
-
borderWidth?: string | undefined;
|
|
46
|
-
focusRingColor?: string | undefined;
|
|
47
|
-
padding?: string | undefined;
|
|
48
|
-
}>>;
|
|
49
|
-
}, "strip", z.ZodTypeAny, {
|
|
50
|
-
theme: AppearanceTheme;
|
|
51
|
-
variables?: {
|
|
52
|
-
colorPrimary?: string | undefined;
|
|
53
|
-
colorBackground?: string | undefined;
|
|
54
|
-
colorForeground?: string | undefined;
|
|
55
|
-
colorText?: string | undefined;
|
|
56
|
-
colorDanger?: string | undefined;
|
|
57
|
-
fontFamily?: string | undefined;
|
|
58
|
-
fontSize?: string | undefined;
|
|
59
|
-
spacing?: string | undefined;
|
|
60
|
-
borderRadius?: string | undefined;
|
|
61
|
-
borderColor?: string | undefined;
|
|
62
|
-
borderWidth?: string | undefined;
|
|
63
|
-
focusRingColor?: string | undefined;
|
|
64
|
-
padding?: string | undefined;
|
|
65
|
-
} | undefined;
|
|
66
|
-
}, {
|
|
67
|
-
theme: AppearanceTheme;
|
|
68
|
-
variables?: {
|
|
69
|
-
colorPrimary?: string | undefined;
|
|
70
|
-
colorBackground?: string | undefined;
|
|
71
|
-
colorForeground?: string | undefined;
|
|
72
|
-
colorText?: string | undefined;
|
|
73
|
-
colorDanger?: string | undefined;
|
|
74
|
-
fontFamily?: string | undefined;
|
|
75
|
-
fontSize?: string | undefined;
|
|
76
|
-
spacing?: string | undefined;
|
|
77
|
-
borderRadius?: string | undefined;
|
|
78
|
-
borderColor?: string | undefined;
|
|
79
|
-
borderWidth?: string | undefined;
|
|
80
|
-
focusRingColor?: string | undefined;
|
|
81
|
-
padding?: string | undefined;
|
|
82
|
-
} | undefined;
|
|
83
|
-
}>;
|
|
84
|
-
|
|
85
|
-
export declare type Appearance = z.infer<typeof Appearance>;
|
|
86
|
-
|
|
87
|
-
/**
|
|
88
|
-
* Models shared between CDE and OpenPay.js
|
|
89
|
-
* Don't forget to update shared-models.ts in the other repo's utils folder too!
|
|
90
|
-
*/
|
|
91
|
-
/**
|
|
92
|
-
* Styles and appearance
|
|
93
|
-
*/
|
|
94
|
-
export declare enum AppearanceTheme {
|
|
95
|
-
UNSTYLED = "unstyled",
|
|
96
|
-
LIGHT = "light",
|
|
97
|
-
DARK = "dark"
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export declare const AppearanceVariables: z.ZodObject<{
|
|
101
|
-
colorPrimary: z.ZodOptional<z.ZodString>;
|
|
102
|
-
colorBackground: z.ZodOptional<z.ZodString>;
|
|
103
|
-
colorForeground: z.ZodOptional<z.ZodString>;
|
|
104
|
-
colorText: z.ZodOptional<z.ZodString>;
|
|
105
|
-
colorDanger: z.ZodOptional<z.ZodString>;
|
|
106
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
107
|
-
fontSize: z.ZodOptional<z.ZodString>;
|
|
108
|
-
spacing: z.ZodOptional<z.ZodString>;
|
|
109
|
-
borderRadius: z.ZodOptional<z.ZodString>;
|
|
110
|
-
borderColor: z.ZodOptional<z.ZodString>;
|
|
111
|
-
borderWidth: z.ZodOptional<z.ZodString>;
|
|
112
|
-
focusRingColor: z.ZodOptional<z.ZodString>;
|
|
113
|
-
padding: z.ZodOptional<z.ZodString>;
|
|
114
|
-
}, "strip", z.ZodTypeAny, {
|
|
115
|
-
colorPrimary?: string | undefined;
|
|
116
|
-
colorBackground?: string | undefined;
|
|
117
|
-
colorForeground?: string | undefined;
|
|
118
|
-
colorText?: string | undefined;
|
|
119
|
-
colorDanger?: string | undefined;
|
|
120
|
-
fontFamily?: string | undefined;
|
|
121
|
-
fontSize?: string | undefined;
|
|
122
|
-
spacing?: string | undefined;
|
|
123
|
-
borderRadius?: string | undefined;
|
|
124
|
-
borderColor?: string | undefined;
|
|
125
|
-
borderWidth?: string | undefined;
|
|
126
|
-
focusRingColor?: string | undefined;
|
|
127
|
-
padding?: string | undefined;
|
|
128
|
-
}, {
|
|
129
|
-
colorPrimary?: string | undefined;
|
|
130
|
-
colorBackground?: string | undefined;
|
|
131
|
-
colorForeground?: string | undefined;
|
|
132
|
-
colorText?: string | undefined;
|
|
133
|
-
colorDanger?: string | undefined;
|
|
134
|
-
fontFamily?: string | undefined;
|
|
135
|
-
fontSize?: string | undefined;
|
|
136
|
-
spacing?: string | undefined;
|
|
137
|
-
borderRadius?: string | undefined;
|
|
138
|
-
borderColor?: string | undefined;
|
|
139
|
-
borderWidth?: string | undefined;
|
|
140
|
-
focusRingColor?: string | undefined;
|
|
141
|
-
padding?: string | undefined;
|
|
142
|
-
}>;
|
|
143
|
-
|
|
144
|
-
export declare type AppearanceVariables = z.infer<typeof AppearanceVariables>;
|
|
145
|
-
|
|
146
|
-
export declare const CardCvcElement: FC<ElementProps>;
|
|
147
|
-
|
|
148
|
-
export declare const CardElement: FC<ElementProps>;
|
|
149
|
-
|
|
150
|
-
export declare const CardExpiryElement: FC<ElementProps>;
|
|
151
|
-
|
|
152
|
-
export declare const CardNumberElement: FC<ElementProps>;
|
|
153
|
-
|
|
154
|
-
declare type ElementProps = {
|
|
155
|
-
styles?: ElementsStyle;
|
|
156
|
-
};
|
|
157
|
-
|
|
158
|
-
declare type ElementsContextValue = {
|
|
159
|
-
contextId: string;
|
|
160
|
-
formHeight: string;
|
|
161
|
-
referer?: string;
|
|
162
|
-
checkoutSecureToken?: string;
|
|
163
|
-
appearance?: Appearance;
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export declare const ElementsForm: FC<ElementsFormProps>;
|
|
167
|
-
|
|
168
|
-
declare type ElementsFormChildrenProps = {
|
|
169
|
-
submit: () => void;
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
declare type ElementsFormProps = {
|
|
173
|
-
className?: string;
|
|
174
|
-
appearance?: Appearance;
|
|
175
|
-
checkoutSecureToken?: string;
|
|
176
|
-
children: (props: ElementsFormChildrenProps) => JSX.Element;
|
|
177
|
-
onFocus?: (elementId: string) => void;
|
|
178
|
-
onBlur?: (elementId: string) => void;
|
|
179
|
-
onChange?: (elementId: string) => void;
|
|
180
|
-
onLoad?: (totalAmountAtoms: number) => void;
|
|
181
|
-
onLoadError?: (message: string) => void;
|
|
182
|
-
onValidationError?: (message: string, elementId?: string) => void;
|
|
183
|
-
onCheckoutStarted?: () => void;
|
|
184
|
-
onCheckoutSuccess?: (invoiceUrls: string[]) => void;
|
|
185
|
-
onCheckoutError?: (message: string) => void;
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
declare const ElementsStyle: z.ZodObject<{
|
|
189
|
-
backgroundColor: z.ZodOptional<z.ZodString>;
|
|
190
|
-
color: z.ZodOptional<z.ZodString>;
|
|
191
|
-
fontFamily: z.ZodOptional<z.ZodString>;
|
|
192
|
-
fontSize: z.ZodOptional<z.ZodString>;
|
|
193
|
-
fontWeight: z.ZodOptional<z.ZodString>;
|
|
194
|
-
margin: z.ZodOptional<z.ZodString>;
|
|
195
|
-
padding: z.ZodOptional<z.ZodString>;
|
|
196
|
-
}, "strip", z.ZodTypeAny, {
|
|
197
|
-
fontFamily?: string | undefined;
|
|
198
|
-
fontSize?: string | undefined;
|
|
199
|
-
padding?: string | undefined;
|
|
200
|
-
backgroundColor?: string | undefined;
|
|
201
|
-
color?: string | undefined;
|
|
202
|
-
fontWeight?: string | undefined;
|
|
203
|
-
margin?: string | undefined;
|
|
204
|
-
}, {
|
|
205
|
-
fontFamily?: string | undefined;
|
|
206
|
-
fontSize?: string | undefined;
|
|
207
|
-
padding?: string | undefined;
|
|
208
|
-
backgroundColor?: string | undefined;
|
|
209
|
-
color?: string | undefined;
|
|
210
|
-
fontWeight?: string | undefined;
|
|
211
|
-
margin?: string | undefined;
|
|
212
|
-
}>;
|
|
213
|
-
|
|
214
|
-
declare type ElementsStyle = z.infer<typeof ElementsStyle>;
|
|
215
|
-
|
|
216
|
-
/**
|
|
217
|
-
* Form field names
|
|
218
|
-
*/
|
|
219
|
-
export declare enum FieldName {
|
|
220
|
-
FIRST_NAME = "firstName",
|
|
221
|
-
LAST_NAME = "lastName",
|
|
222
|
-
EMAIL = "email",
|
|
223
|
-
ZIP_CODE = "zipCode",
|
|
224
|
-
CITY = "city",
|
|
225
|
-
STATE = "state",
|
|
226
|
-
COUNTRY = "country",
|
|
227
|
-
ADDRESS = "address",
|
|
228
|
-
PHONE = "phone"
|
|
229
|
-
}
|
|
230
|
-
|
|
231
|
-
export declare const useOpenPayElements: () => ElementsContextValue;
|
|
232
|
-
|
|
233
|
-
export { }
|