@payrails/web-sdk 5.46.1 → 5.48.0-RC-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.
- package/README.md +9 -0
- package/index.js +4 -4
- package/index.mjs +4 -4
- package/package.json +2 -8
- package/payrails-styles.css +302 -122
- package/payrails.d.ts +1283 -1131
- package/payrails.js +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@payrails/web-sdk",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.48.0-RC-1",
|
|
4
4
|
"description": "SDK providing tokenization options on the client for merchants",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "payrails.d.ts",
|
|
@@ -8,13 +8,7 @@
|
|
|
8
8
|
"author": "Payrails GitHub Bot <github@payrails.com>",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"
|
|
12
|
-
"@payrails/web-cse": "1.2.4",
|
|
13
|
-
"@rollup/plugin-html": "2.0.0",
|
|
14
|
-
"@types/applepayjs": "14.0.9",
|
|
15
|
-
"@types/googlepay": "0.7.5",
|
|
16
|
-
"rollup-plugin-import-css": "3.5.8",
|
|
17
|
-
"vitest-fetch-mock": "0.4.5"
|
|
11
|
+
"dompurify": "3.4.10"
|
|
18
12
|
},
|
|
19
13
|
"module": "index.mjs",
|
|
20
14
|
"exports": {
|
package/payrails-styles.css
CHANGED
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
|
-
.payrails-container-wrapper
|
|
9
|
+
.payrails-container-wrapper,
|
|
10
|
+
.payrails-collect-frames-container {
|
|
10
11
|
width: 100%;
|
|
11
12
|
min-height: 90px;
|
|
12
13
|
}
|
|
13
14
|
|
|
14
|
-
.with-card-holder .payrails-container-wrapper
|
|
15
|
+
.with-card-holder .payrails-container-wrapper,
|
|
16
|
+
.with-card-holder .payrails-collect-frames-container {
|
|
15
17
|
width: 100%;
|
|
16
18
|
height: min-content;
|
|
17
19
|
min-height: 120px;
|
|
@@ -95,6 +97,213 @@
|
|
|
95
97
|
}
|
|
96
98
|
}
|
|
97
99
|
|
|
100
|
+
.payrails-billing-address-form {
|
|
101
|
+
display: block;
|
|
102
|
+
margin-bottom: 16px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.payrails-billing-address-form-title {
|
|
106
|
+
font-size: 14px;
|
|
107
|
+
font-weight: 600;
|
|
108
|
+
color: #1f2733;
|
|
109
|
+
margin-bottom: 12px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.payrails-billing-address-form .payrails-dynamic-element-form {
|
|
113
|
+
display: flex;
|
|
114
|
+
flex-direction: row;
|
|
115
|
+
flex-wrap: wrap;
|
|
116
|
+
gap: 12px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.payrails-billing-address-form .payrails-dynamic-element-form-field {
|
|
120
|
+
flex: 1 1 100%;
|
|
121
|
+
gap: 0;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.payrails-billing-address-form [id='payrails-dynamic-element-field:city'],
|
|
125
|
+
.payrails-billing-address-form [id='payrails-dynamic-element-field:state'] {
|
|
126
|
+
flex: 1 1 calc(50% - 6px);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
/* Placeholder-driven design: labels stay for accessibility but are hidden. */
|
|
130
|
+
.payrails-billing-address-form .payrails-dynamic-element-form-field-label {
|
|
131
|
+
position: absolute;
|
|
132
|
+
width: 1px;
|
|
133
|
+
height: 1px;
|
|
134
|
+
padding: 0;
|
|
135
|
+
margin: -1px;
|
|
136
|
+
overflow: hidden;
|
|
137
|
+
clip: rect(0, 0, 0, 0);
|
|
138
|
+
white-space: nowrap;
|
|
139
|
+
border: 0;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
.payrails-billing-address-form .payrails-dynamic-element-input,
|
|
143
|
+
.payrails-billing-address-form .payrails-dynamic-element-select {
|
|
144
|
+
background-color: #ffffff;
|
|
145
|
+
border: 1px solid #e6e8eb;
|
|
146
|
+
border-radius: 8px;
|
|
147
|
+
padding: 12px 14px;
|
|
148
|
+
font-size: 14px;
|
|
149
|
+
color: #1f2733;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.payrails-billing-address-form .payrails-dynamic-element-input::placeholder {
|
|
153
|
+
color: #9aa0a6;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.payrails-billing-address-form
|
|
157
|
+
.payrails-dynamic-element-input:not(
|
|
158
|
+
.payrails-dynamic-element-input--readonly
|
|
159
|
+
):focus,
|
|
160
|
+
.payrails-billing-address-form
|
|
161
|
+
.payrails-dynamic-element-select:not(
|
|
162
|
+
.payrails-dynamic-element-select--readonly
|
|
163
|
+
):focus {
|
|
164
|
+
outline: none;
|
|
165
|
+
border-color: #cdd2da;
|
|
166
|
+
background-color: #ffffff;
|
|
167
|
+
box-shadow: none;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.payrails-billing-address-form
|
|
171
|
+
.payrails-dynamic-element-form-field.error
|
|
172
|
+
.payrails-dynamic-element-input,
|
|
173
|
+
.payrails-billing-address-form
|
|
174
|
+
.payrails-dynamic-element-form-field.error
|
|
175
|
+
.payrails-dynamic-element-select {
|
|
176
|
+
border-color: #f25226;
|
|
177
|
+
background-color: #fdecec;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.payrails-billing-address-form .payrails-dynamic-element-input--readonly,
|
|
181
|
+
.payrails-billing-address-form .payrails-dynamic-element-select--readonly {
|
|
182
|
+
background-color: #f5f6f8;
|
|
183
|
+
color: #6b7280;
|
|
184
|
+
cursor: not-allowed;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.payrails-dynamic-element-form {
|
|
188
|
+
display: flex;
|
|
189
|
+
flex-direction: column;
|
|
190
|
+
gap: 16px;
|
|
191
|
+
width: 100%;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.payrails-dynamic-element-form-field {
|
|
195
|
+
display: flex;
|
|
196
|
+
flex-direction: column;
|
|
197
|
+
gap: 4px;
|
|
198
|
+
width: 100%;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.payrails-dynamic-element-form-field-label {
|
|
202
|
+
font-size: 14px;
|
|
203
|
+
font-weight: 500;
|
|
204
|
+
color: #000000;
|
|
205
|
+
margin-bottom: 4px;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.payrails-dynamic-element-form-field-component {
|
|
209
|
+
width: 100%;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
.payrails-dynamic-element-form-field-error {
|
|
213
|
+
font-size: 12px;
|
|
214
|
+
color: #ff0000;
|
|
215
|
+
margin-top: 4px;
|
|
216
|
+
display: none;
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
.payrails-dynamic-element-form-field.error
|
|
220
|
+
.payrails-dynamic-element-form-field-error {
|
|
221
|
+
display: block;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.payrails-dynamic-element-input {
|
|
225
|
+
width: 100%;
|
|
226
|
+
padding: 10px 16px;
|
|
227
|
+
border: 1px solid #eae8ee;
|
|
228
|
+
font-size: 14px;
|
|
229
|
+
color: #1d1d1d;
|
|
230
|
+
background-color: #fff;
|
|
231
|
+
box-sizing: border-box;
|
|
232
|
+
transition: border-color 0.2s ease;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.payrails-dynamic-element-input:focus {
|
|
236
|
+
outline: none;
|
|
237
|
+
border-color: #007bff;
|
|
238
|
+
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
.payrails-dynamic-element-input:invalid {
|
|
242
|
+
border-color: #f25226;
|
|
243
|
+
background-color: #f9e1e1;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
.payrails-dynamic-element-form-field.error .payrails-dynamic-element-input {
|
|
247
|
+
border-color: #f25226;
|
|
248
|
+
background-color: #f9e1e1;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.payrails-dynamic-element-input::placeholder {
|
|
252
|
+
color: grey;
|
|
253
|
+
opacity: 1;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
.payrails-dynamic-element-select {
|
|
257
|
+
appearance: none;
|
|
258
|
+
-webkit-appearance: none;
|
|
259
|
+
-moz-appearance: none;
|
|
260
|
+
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
|
|
261
|
+
background-repeat: no-repeat;
|
|
262
|
+
background-position: right 8px center;
|
|
263
|
+
width: 100%;
|
|
264
|
+
font-size: 14px;
|
|
265
|
+
color: #1d1d1d;
|
|
266
|
+
background-color: #fff;
|
|
267
|
+
box-sizing: border-box;
|
|
268
|
+
transition: border-color 0.2s ease;
|
|
269
|
+
padding: 10px 16px;
|
|
270
|
+
margin: 0;
|
|
271
|
+
border: 1px solid #eae8ee;
|
|
272
|
+
box-shadow: none;
|
|
273
|
+
cursor: pointer;
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
.payrails-dynamic-element-tabs {
|
|
277
|
+
display: flex;
|
|
278
|
+
flex-direction: row;
|
|
279
|
+
border: 1px solid #eae8ee;
|
|
280
|
+
padding: 4px;
|
|
281
|
+
background: transparent;
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
.payrails-dynamic-element-tabs button.payrails-dynamic-element-tab {
|
|
285
|
+
border-radius: 0;
|
|
286
|
+
flex: 1;
|
|
287
|
+
background: white;
|
|
288
|
+
border: none;
|
|
289
|
+
outline: none;
|
|
290
|
+
font-size: 16px;
|
|
291
|
+
font-weight: 500;
|
|
292
|
+
color: #000000;
|
|
293
|
+
padding: 4px;
|
|
294
|
+
text-transform: unset;
|
|
295
|
+
cursor: pointer;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.payrails-dynamic-element-tabs button.payrails-dynamic-element-tab.active {
|
|
299
|
+
background-color: #e0e5ed;
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
.payrails-dynamic-element-tabs button.payrails-dynamic-element-tab:hover {
|
|
303
|
+
background-color: unset;
|
|
304
|
+
color: unset;
|
|
305
|
+
}
|
|
306
|
+
|
|
98
307
|
.payrails-store-instrument-checkbox {
|
|
99
308
|
margin-right: 4px;
|
|
100
309
|
}
|
|
@@ -106,6 +315,26 @@
|
|
|
106
315
|
margin-bottom: 4px;
|
|
107
316
|
}
|
|
108
317
|
|
|
318
|
+
/*
|
|
319
|
+
* When present, visually moves the save-instrument checkbox above the payment
|
|
320
|
+
* button using CSS flex order — without touching the DOM structure.
|
|
321
|
+
* Default (no class): checkbox sits below the button (natural DOM order).
|
|
322
|
+
*/
|
|
323
|
+
.payrails-checkbox-above-button {
|
|
324
|
+
display: flex;
|
|
325
|
+
flex-direction: column;
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
/* Google Pay / Apple Pay: .payrails-store-instrument is a direct child */
|
|
329
|
+
.payrails-checkbox-above-button > .payrails-store-instrument {
|
|
330
|
+
order: -1;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
/* PayPal: checkbox is wrapped inside its own container div */
|
|
334
|
+
.payrails-checkbox-above-button > #payrails-paypal-checkbox-wrapper {
|
|
335
|
+
order: -1;
|
|
336
|
+
}
|
|
337
|
+
|
|
109
338
|
.payrails-address-selector-wrapper {
|
|
110
339
|
display: flex;
|
|
111
340
|
flex-wrap: wrap;
|
|
@@ -631,6 +860,77 @@
|
|
|
631
860
|
}
|
|
632
861
|
}
|
|
633
862
|
|
|
863
|
+
.payrails-order-summary-wrapper {
|
|
864
|
+
display: flex;
|
|
865
|
+
flex-direction: column;
|
|
866
|
+
width: 100%;
|
|
867
|
+
box-sizing: border-box;
|
|
868
|
+
padding: 16px 0;
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
.payrails-order-summary-header {
|
|
872
|
+
font-size: 13px;
|
|
873
|
+
font-weight: 600;
|
|
874
|
+
letter-spacing: 0.06em;
|
|
875
|
+
text-transform: uppercase;
|
|
876
|
+
color: #6b7280;
|
|
877
|
+
margin: 0 0 12px 0;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
.payrails-order-summary-row {
|
|
881
|
+
display: flex;
|
|
882
|
+
justify-content: space-between;
|
|
883
|
+
align-items: center;
|
|
884
|
+
padding: 4px 0;
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.payrails-order-summary-label {
|
|
888
|
+
font-size: 14px;
|
|
889
|
+
color: #374151;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
.payrails-order-summary-amount {
|
|
893
|
+
font-size: 14px;
|
|
894
|
+
color: #111827;
|
|
895
|
+
font-variant-numeric: tabular-nums;
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
.payrails-order-summary-total-row {
|
|
899
|
+
display: flex;
|
|
900
|
+
justify-content: space-between;
|
|
901
|
+
align-items: center;
|
|
902
|
+
margin-top: 12px;
|
|
903
|
+
padding: 4px 0;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
.payrails-order-summary-total-label {
|
|
907
|
+
font-size: 15px;
|
|
908
|
+
font-weight: 700;
|
|
909
|
+
color: #111827;
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
.payrails-order-summary-total-amount {
|
|
913
|
+
font-size: 15px;
|
|
914
|
+
font-weight: 700;
|
|
915
|
+
color: #111827;
|
|
916
|
+
font-variant-numeric: tabular-nums;
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
.payrails-terms-and-conditions {
|
|
920
|
+
width: 100%;
|
|
921
|
+
text-align: center;
|
|
922
|
+
line-height: 1.5;
|
|
923
|
+
font-size: 14px;
|
|
924
|
+
color: #4b5563;
|
|
925
|
+
margin: 0 8px;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
.payrails-terms-and-conditions .payrails-terms-link,
|
|
929
|
+
.payrails-terms-and-conditions a {
|
|
930
|
+
color: #2563eb;
|
|
931
|
+
text-decoration: none;
|
|
932
|
+
}
|
|
933
|
+
|
|
634
934
|
button.payrails-generic-button {
|
|
635
935
|
border: none;
|
|
636
936
|
outline: none;
|
|
@@ -849,123 +1149,3 @@ button.payrails-lean-button {
|
|
|
849
1149
|
#payrails-paypal-button-wrapper {
|
|
850
1150
|
min-height: 44px;
|
|
851
1151
|
}
|
|
852
|
-
|
|
853
|
-
.payrails-dynamic-element-form {
|
|
854
|
-
display: flex;
|
|
855
|
-
flex-direction: column;
|
|
856
|
-
gap: 16px;
|
|
857
|
-
width: 100%;
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
.payrails-dynamic-element-form-field {
|
|
861
|
-
display: flex;
|
|
862
|
-
flex-direction: column;
|
|
863
|
-
gap: 4px;
|
|
864
|
-
width: 100%;
|
|
865
|
-
}
|
|
866
|
-
|
|
867
|
-
.payrails-dynamic-element-form-field-label {
|
|
868
|
-
font-size: 14px;
|
|
869
|
-
font-weight: 500;
|
|
870
|
-
color: #000000;
|
|
871
|
-
margin-bottom: 4px;
|
|
872
|
-
}
|
|
873
|
-
|
|
874
|
-
.payrails-dynamic-element-form-field-component {
|
|
875
|
-
width: 100%;
|
|
876
|
-
}
|
|
877
|
-
|
|
878
|
-
.payrails-dynamic-element-form-field-error {
|
|
879
|
-
font-size: 12px;
|
|
880
|
-
color: #ff0000;
|
|
881
|
-
margin-top: 4px;
|
|
882
|
-
display: none;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
.payrails-dynamic-element-form-field.error
|
|
886
|
-
.payrails-dynamic-element-form-field-error {
|
|
887
|
-
display: block;
|
|
888
|
-
}
|
|
889
|
-
|
|
890
|
-
.payrails-dynamic-element-input {
|
|
891
|
-
width: 100%;
|
|
892
|
-
padding: 10px 16px;
|
|
893
|
-
border: 1px solid #eae8ee;
|
|
894
|
-
font-size: 14px;
|
|
895
|
-
color: #1d1d1d;
|
|
896
|
-
background-color: #fff;
|
|
897
|
-
box-sizing: border-box;
|
|
898
|
-
transition: border-color 0.2s ease;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
.payrails-dynamic-element-input:focus {
|
|
902
|
-
outline: none;
|
|
903
|
-
border-color: #007bff;
|
|
904
|
-
box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
|
|
905
|
-
}
|
|
906
|
-
|
|
907
|
-
.payrails-dynamic-element-input:invalid {
|
|
908
|
-
border-color: #f25226;
|
|
909
|
-
background-color: #f9e1e1;
|
|
910
|
-
}
|
|
911
|
-
|
|
912
|
-
.payrails-dynamic-element-form-field.error .payrails-dynamic-element-input {
|
|
913
|
-
border-color: #f25226;
|
|
914
|
-
background-color: #f9e1e1;
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
.payrails-dynamic-element-input::placeholder {
|
|
918
|
-
color: grey;
|
|
919
|
-
opacity: 1;
|
|
920
|
-
}
|
|
921
|
-
|
|
922
|
-
.payrails-dynamic-element-select {
|
|
923
|
-
appearance: none;
|
|
924
|
-
-webkit-appearance: none;
|
|
925
|
-
-moz-appearance: none;
|
|
926
|
-
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
|
|
927
|
-
background-repeat: no-repeat;
|
|
928
|
-
background-position: right 8px center;
|
|
929
|
-
width: 100%;
|
|
930
|
-
font-size: 14px;
|
|
931
|
-
color: #1d1d1d;
|
|
932
|
-
background-color: #fff;
|
|
933
|
-
box-sizing: border-box;
|
|
934
|
-
transition: border-color 0.2s ease;
|
|
935
|
-
padding: 10px 16px;
|
|
936
|
-
margin: 0;
|
|
937
|
-
border: 1px solid #eae8ee;
|
|
938
|
-
box-shadow: none;
|
|
939
|
-
cursor: pointer;
|
|
940
|
-
}
|
|
941
|
-
|
|
942
|
-
.payrails-dynamic-element-tabs {
|
|
943
|
-
display: flex;
|
|
944
|
-
flex-direction: row;
|
|
945
|
-
border: 1px solid #eae8ee;
|
|
946
|
-
padding: 4px;
|
|
947
|
-
background: transparent;
|
|
948
|
-
}
|
|
949
|
-
|
|
950
|
-
.payrails-dynamic-element-tabs button.payrails-dynamic-element-tab {
|
|
951
|
-
border-radius: 0;
|
|
952
|
-
flex: 1;
|
|
953
|
-
background: white;
|
|
954
|
-
border: none;
|
|
955
|
-
outline: none;
|
|
956
|
-
font-size: 16px;
|
|
957
|
-
font-weight: 500;
|
|
958
|
-
color: #000000;
|
|
959
|
-
padding: 4px;
|
|
960
|
-
text-transform: unset;
|
|
961
|
-
cursor: pointer;
|
|
962
|
-
}
|
|
963
|
-
|
|
964
|
-
.payrails-dynamic-element-tabs button.payrails-dynamic-element-tab.active {
|
|
965
|
-
background-color: #e0e5ed;
|
|
966
|
-
}
|
|
967
|
-
|
|
968
|
-
.payrails-dynamic-element-tabs button.payrails-dynamic-element-tab:hover {
|
|
969
|
-
background-color: unset;
|
|
970
|
-
color: unset;
|
|
971
|
-
}
|