@rebilly/instruments 3.13.4-beta.0 → 3.14.1-beta.0

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 (84) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +43 -66
  3. package/dist/index.min.js +43 -66
  4. package/package.json +3 -6
  5. package/src/functions/destroy.js +8 -2
  6. package/src/functions/mount/fetch-data.js +9 -2
  7. package/src/functions/mount/index.js +15 -10
  8. package/src/functions/mount/mount.spec.js +10 -11
  9. package/src/functions/mount/setup-framepay-theme.js +30 -72
  10. package/src/functions/mount/setup-options.js +2 -2
  11. package/src/functions/mount/{setup-styles.js → setup-styles-vars.js} +9 -7
  12. package/src/functions/purchase.js +2 -5
  13. package/src/functions/setup.js +3 -6
  14. package/src/functions/show.js +2 -2
  15. package/src/functions/show.spec.js +4 -4
  16. package/src/functions/update.spec.js +4 -3
  17. package/src/instance.js +4 -1
  18. package/src/loader/index.js +57 -33
  19. package/src/storefront/index.js +2 -5
  20. package/src/storefront/payment-instruments.js +7 -0
  21. package/src/style/base/__snapshots__/theme.spec.js.snap +136 -220
  22. package/src/style/base/default-theme.js +187 -14
  23. package/src/style/base/index.js +487 -79
  24. package/src/style/base/theme.js +3 -4
  25. package/src/style/base/theme.spec.js +2 -3
  26. package/src/style/index.js +4 -24
  27. package/src/style/utils/color-values.js +1 -1
  28. package/src/style/utils/minifyCss.js +14 -0
  29. package/src/views/common/iframe/base-iframe.js +3 -2
  30. package/src/views/common/iframe/event-listeners.js +12 -9
  31. package/src/views/common/iframe/method-iframe.js +3 -1
  32. package/src/views/common/iframe/modal-iframe.js +4 -2
  33. package/src/views/common/iframe/view-iframe.js +3 -1
  34. package/src/views/confirmation.js +12 -7
  35. package/src/views/errors.js +95 -0
  36. package/src/views/method-selector/express-methods.js +51 -0
  37. package/src/views/method-selector/generate-framepay-config.js +54 -0
  38. package/src/views/method-selector/generate-framepay-config.spec.js +195 -0
  39. package/src/views/method-selector/get-payment-methods.js +0 -1
  40. package/src/views/method-selector/index.js +45 -58
  41. package/src/views/method-selector/method-selector.spec.js +1 -1
  42. package/src/views/method-selector/mount-express-methods.js +66 -26
  43. package/src/views/modal.js +1 -1
  44. package/src/views/result.js +3 -3
  45. package/src/views/summary.js +24 -190
  46. package/tests/mocks/storefront-api-mock.js +48 -27
  47. package/src/style/browserslist.js +0 -1
  48. package/src/style/components/accordion.js +0 -140
  49. package/src/style/components/address.js +0 -55
  50. package/src/style/components/button.js +0 -117
  51. package/src/style/components/divider.js +0 -39
  52. package/src/style/components/forms/checkbox.js +0 -75
  53. package/src/style/components/forms/field.js +0 -56
  54. package/src/style/components/forms/form.js +0 -18
  55. package/src/style/components/forms/input.js +0 -77
  56. package/src/style/components/forms/label.js +0 -55
  57. package/src/style/components/forms/radio.js +0 -80
  58. package/src/style/components/forms/select.js +0 -86
  59. package/src/style/components/forms/validation.js +0 -72
  60. package/src/style/components/icons.js +0 -13
  61. package/src/style/components/index.js +0 -39
  62. package/src/style/components/loader.js +0 -41
  63. package/src/style/components/methods.js +0 -97
  64. package/src/style/components/overlay.js +0 -24
  65. package/src/style/helpers/index.js +0 -54
  66. package/src/style/payment-instruments/content.js +0 -8
  67. package/src/style/payment-instruments/index.js +0 -14
  68. package/src/style/payment-instruments/payment-card.js +0 -27
  69. package/src/style/payment-instruments/payment-instrument-list.js +0 -44
  70. package/src/style/payment-instruments/payment-instrument.js +0 -55
  71. package/src/style/utils/remove-empty-null.js +0 -10
  72. package/src/style/vendor/framepay.js +0 -28
  73. package/src/style/vendor/postmate.js +0 -18
  74. package/src/style/views/confirmation.js +0 -26
  75. package/src/style/views/index.js +0 -16
  76. package/src/style/views/method-selector.js +0 -11
  77. package/src/style/views/modal.js +0 -91
  78. package/src/style/views/result.js +0 -52
  79. package/src/style/views/summary.js +0 -118
  80. package/src/views/__snapshots__/summary.spec.js.snap +0 -246
  81. package/src/views/method-selector/express-methods/apple-pay.js +0 -92
  82. package/src/views/method-selector/express-methods/index.js +0 -25
  83. package/src/views/method-selector/mount-methods.js +0 -178
  84. package/src/views/summary.spec.js +0 -145
@@ -1,4 +1,4 @@
1
- import { mutedTextColor, mutedBorderColor, darken } from '../utils/color-values';
1
+ import { mutedTextColor, darken, mutedBorderColor } from '../utils/color-values';
2
2
  import Border from '../utils/border';
3
3
 
4
4
  const properties = {
@@ -24,13 +24,18 @@ const properties = {
24
24
  colorMutedText: {
25
25
  fallback: {
26
26
  type: 'func',
27
- value: theme => mutedTextColor(theme.colorText)
27
+ value: theme => mutedTextColor(theme.colorText, 60)
28
28
  }
29
29
  },
30
30
  colorMutedBorder: {
31
31
  fallback: {
32
32
  type: 'func',
33
- value: theme => mutedBorderColor(theme.colorText)
33
+ value: theme => {
34
+ if(theme.colorTextProvided) {
35
+ return mutedBorderColor(theme.colorText);
36
+ }
37
+ return '#DCE3EA';
38
+ }
34
39
  }
35
40
  },
36
41
  colorDanger: {
@@ -56,13 +61,13 @@ const properties = {
56
61
  fontWeightBase: {
57
62
  fallback: {
58
63
  type: 'static',
59
- value: '400',
64
+ value: '500',
60
65
  }
61
66
  },
62
67
  fontLineHeightBase: {
63
68
  fallback: {
64
- type: 'static',
65
- value: 'initial',
69
+ type: 'func',
70
+ value: theme => `calc(${theme.fontSizeBase} * 1.5)`,
66
71
  }
67
72
  },
68
73
  fontSmooth: {
@@ -76,7 +81,7 @@ const properties = {
76
81
  borderRadius: {
77
82
  fallback: {
78
83
  type: 'static',
79
- value: '4px',
84
+ value: '6px',
80
85
  }
81
86
  },
82
87
 
@@ -90,7 +95,7 @@ const properties = {
90
95
  headingFontWeight: {
91
96
  fallback: {
92
97
  type: 'static',
93
- value: '500',
98
+ value: '600',
94
99
  }
95
100
  },
96
101
  headingColorText: {
@@ -127,8 +132,8 @@ const properties = {
127
132
  },
128
133
  buttonFontLineHeight: {
129
134
  fallback: {
130
- type: 'static',
131
- value: '1.5',
135
+ type: 'variable',
136
+ value: 'fontLineHeightBase',
132
137
  }
133
138
  },
134
139
  buttonFontWeight: {
@@ -156,6 +161,62 @@ const properties = {
156
161
  }
157
162
  },
158
163
 
164
+ /** Buttons Secondary */
165
+ buttonSecondaryColorBackground: {
166
+ fallback: {
167
+ type: 'variable',
168
+ value: 'colorBackground',
169
+ }
170
+ },
171
+ buttonSecondaryColorText: {
172
+ fallback: {
173
+ type: 'variable',
174
+ value: 'colorPrimary',
175
+ }
176
+ },
177
+ buttonSecondaryFontFamily: {
178
+ fallback: {
179
+ type: 'variable',
180
+ value: 'fontFamily',
181
+ }
182
+ },
183
+ buttonSecondaryFontSize: {
184
+ fallback: {
185
+ type: 'variable',
186
+ value: 'fontSizeBase',
187
+ }
188
+ },
189
+ buttonSecondaryFontLineHeight: {
190
+ fallback: {
191
+ type: 'variable',
192
+ value: 'fontLineHeightBase',
193
+ }
194
+ },
195
+ buttonSecondaryFontWeight: {
196
+ fallback: {
197
+ type: 'variable',
198
+ value: 'fontWeightBase',
199
+ }
200
+ },
201
+ buttonSecondaryBorder: {
202
+ fallback: {
203
+ type: 'func',
204
+ value: theme => `1px solid ${theme.colorPrimary}`,
205
+ }
206
+ },
207
+ buttonSecondaryBorderRadius: {
208
+ fallback: {
209
+ type: 'variable',
210
+ value: 'borderRadius',
211
+ }
212
+ },
213
+ buttonSecondaryBoxShadow: {
214
+ fallback: {
215
+ type: 'static',
216
+ value: 'none',
217
+ }
218
+ },
219
+
159
220
  /** Buttons: Hover */
160
221
  buttonHoverColorBackground: {
161
222
  fallback: {
@@ -222,6 +283,62 @@ const properties = {
222
283
  value: 'buttonBoxShadow',
223
284
  }
224
285
  },
286
+
287
+ /** Buttons Secondary: Hover */
288
+ buttonSecondaryHoverColorBackground: {
289
+ fallback: {
290
+ type: 'variable',
291
+ value: 'colorBackground'
292
+ }
293
+ },
294
+ buttonSecondaryHoverColorText: {
295
+ fallback: {
296
+ type: 'variable',
297
+ value: 'buttonSecondaryColorText',
298
+ }
299
+ },
300
+ buttonSecondaryHoverFontFamily: {
301
+ fallback: {
302
+ type: 'variable',
303
+ value: 'buttonSecondaryFontFamily',
304
+ }
305
+ },
306
+ buttonSecondaryHoverFontSize: {
307
+ fallback: {
308
+ type: 'variable',
309
+ value: 'buttonSecondaryFontSize',
310
+ }
311
+ },
312
+ buttonSecondaryHoverFontLineHeight: {
313
+ fallback: {
314
+ type: 'variable',
315
+ value: 'buttonSecondaryFontLineHeight',
316
+ }
317
+ },
318
+ buttonSecondaryHoverFontWeight: {
319
+ fallback: {
320
+ type: 'variable',
321
+ value: 'buttonSecondaryFontWeight',
322
+ }
323
+ },
324
+ buttonSecondaryHoverBorder: {
325
+ fallback: {
326
+ type: 'variable',
327
+ value: 'buttonSecondaryBorder',
328
+ }
329
+ },
330
+ buttonSecondaryHoverBorderRadius: {
331
+ fallback: {
332
+ type: 'variable',
333
+ value: 'buttonSecondaryBorderRadius',
334
+ }
335
+ },
336
+ buttonSecondaryHoverBoxShadow: {
337
+ fallback: {
338
+ type: 'variable',
339
+ value: 'buttonSecondaryBoxShadow',
340
+ }
341
+ },
225
342
 
226
343
  /** Buttons: Active */
227
344
  buttonActiveColorBackground: {
@@ -279,6 +396,62 @@ const properties = {
279
396
  }
280
397
  },
281
398
 
399
+ /** Buttons Secondary: Active */
400
+ buttonSecondaryActiveColorBackground: {
401
+ fallback: {
402
+ type: 'variable',
403
+ value: 'buttonSecondaryHoverColorBackground',
404
+ }
405
+ },
406
+ buttonSecondaryActiveColorText: {
407
+ fallback: {
408
+ type: 'variable',
409
+ value: 'buttonSecondaryHoverColorText',
410
+ }
411
+ },
412
+ buttonSecondaryActiveFontFamily: {
413
+ fallback: {
414
+ type: 'variable',
415
+ value: 'buttonSecondaryHoverFontFamily',
416
+ }
417
+ },
418
+ buttonSecondaryActiveFontSize: {
419
+ fallback: {
420
+ type: 'variable',
421
+ value: 'buttonSecondaryHoverFontSize',
422
+ }
423
+ },
424
+ buttonSecondaryActiveFontLineHeight: {
425
+ fallback: {
426
+ type: 'variable',
427
+ value: 'buttonSecondaryHoverFontLineHeight',
428
+ }
429
+ },
430
+ buttonSecondaryActiveFontWeight: {
431
+ fallback: {
432
+ type: 'variable',
433
+ value: 'buttonSecondaryHoverFontWeight',
434
+ }
435
+ },
436
+ buttonSecondaryActiveBorder: {
437
+ fallback: {
438
+ type: 'variable',
439
+ value: 'buttonSecondaryHoverBorder'
440
+ }
441
+ },
442
+ buttonSecondaryActiveBorderRadius: {
443
+ fallback: {
444
+ type: 'variable',
445
+ value: 'buttonSecondaryHoverBorderRadius',
446
+ }
447
+ },
448
+ buttonSecondaryActiveBoxShadow: {
449
+ fallback: {
450
+ type: 'variable',
451
+ value: 'buttonSecondaryHoverBoxShadow',
452
+ }
453
+ },
454
+
282
455
  /** Inputs: Base */
283
456
  inputColorBackground: {
284
457
  fallback: {
@@ -306,8 +479,8 @@ const properties = {
306
479
  },
307
480
  inputFontLineHeight: {
308
481
  fallback: {
309
- type: 'static',
310
- value: '1.5',
482
+ type: 'variable',
483
+ value: 'fontLineHeightBase',
311
484
  }
312
485
  },
313
486
  inputFontWeight: {
@@ -319,7 +492,7 @@ const properties = {
319
492
  inputBorder: {
320
493
  fallback: {
321
494
  type: 'func',
322
- value: theme => `1px solid ${mutedBorderColor(theme.colorText)}`
495
+ value: theme => `1px solid ${darken(theme.colorMutedBorder, 4)}`
323
496
  }
324
497
  },
325
498
  inputBorderRadius: {
@@ -461,7 +634,7 @@ const properties = {
461
634
  if(theme.inputColorTextProvided) {
462
635
  return mutedTextColor(theme.inputColorText);
463
636
  }
464
- return mutedTextColor(theme.colorText);
637
+ return theme.colorMutedText;
465
638
  }
466
639
  }
467
640
  },