@rebilly/instruments 3.13.2-beta.0 → 3.13.4-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 +66 -43
  3. package/dist/index.min.js +66 -43
  4. package/package.json +6 -3
  5. package/src/functions/destroy.js +2 -8
  6. package/src/functions/mount/fetch-data.js +2 -9
  7. package/src/functions/mount/index.js +10 -15
  8. package/src/functions/mount/mount.spec.js +11 -10
  9. package/src/functions/mount/setup-framepay-theme.js +72 -30
  10. package/src/functions/mount/setup-options.js +2 -2
  11. package/src/functions/mount/{setup-styles-vars.js → setup-styles.js} +7 -9
  12. package/src/functions/purchase.js +5 -2
  13. package/src/functions/setup.js +6 -3
  14. package/src/functions/show.js +2 -2
  15. package/src/functions/show.spec.js +4 -4
  16. package/src/functions/update.spec.js +3 -4
  17. package/src/instance.js +1 -4
  18. package/src/loader/index.js +33 -57
  19. package/src/storefront/index.js +5 -2
  20. package/src/storefront/payment-instruments.js +0 -7
  21. package/src/style/base/__snapshots__/theme.spec.js.snap +220 -136
  22. package/src/style/base/default-theme.js +14 -187
  23. package/src/style/base/index.js +79 -487
  24. package/src/style/base/theme.js +4 -3
  25. package/src/style/base/theme.spec.js +3 -2
  26. package/src/style/browserslist.js +1 -0
  27. package/src/style/components/accordion.js +140 -0
  28. package/src/style/components/address.js +55 -0
  29. package/src/style/components/button.js +117 -0
  30. package/src/style/components/divider.js +39 -0
  31. package/src/style/components/forms/checkbox.js +75 -0
  32. package/src/style/components/forms/field.js +56 -0
  33. package/src/style/components/forms/form.js +18 -0
  34. package/src/style/components/forms/input.js +77 -0
  35. package/src/style/components/forms/label.js +55 -0
  36. package/src/style/components/forms/radio.js +80 -0
  37. package/src/style/components/forms/select.js +86 -0
  38. package/src/style/components/forms/validation.js +72 -0
  39. package/src/style/components/icons.js +13 -0
  40. package/src/style/components/index.js +39 -0
  41. package/src/style/components/loader.js +41 -0
  42. package/src/style/components/methods.js +97 -0
  43. package/src/style/components/overlay.js +24 -0
  44. package/src/style/helpers/index.js +54 -0
  45. package/src/style/index.js +24 -4
  46. package/src/style/payment-instruments/content.js +8 -0
  47. package/src/style/payment-instruments/index.js +14 -0
  48. package/src/style/payment-instruments/payment-card.js +27 -0
  49. package/src/style/payment-instruments/payment-instrument-list.js +44 -0
  50. package/src/style/payment-instruments/payment-instrument.js +55 -0
  51. package/src/style/utils/color-values.js +1 -1
  52. package/src/style/utils/remove-empty-null.js +10 -0
  53. package/src/style/vendor/framepay.js +28 -0
  54. package/src/style/vendor/postmate.js +18 -0
  55. package/src/style/views/confirmation.js +26 -0
  56. package/src/style/views/index.js +16 -0
  57. package/src/style/views/method-selector.js +11 -0
  58. package/src/style/views/modal.js +91 -0
  59. package/src/style/views/result.js +52 -0
  60. package/src/style/views/summary.js +118 -0
  61. package/src/views/__snapshots__/summary.spec.js.snap +246 -0
  62. package/src/views/common/iframe/base-iframe.js +2 -3
  63. package/src/views/common/iframe/event-listeners.js +9 -12
  64. package/src/views/common/iframe/method-iframe.js +1 -3
  65. package/src/views/common/iframe/modal-iframe.js +2 -4
  66. package/src/views/common/iframe/view-iframe.js +1 -3
  67. package/src/views/confirmation.js +7 -12
  68. package/src/views/method-selector/express-methods/apple-pay.js +92 -0
  69. package/src/views/method-selector/express-methods/index.js +25 -0
  70. package/src/views/method-selector/get-payment-methods.js +1 -0
  71. package/src/views/method-selector/index.js +58 -45
  72. package/src/views/method-selector/method-selector.spec.js +1 -1
  73. package/src/views/method-selector/mount-express-methods.js +26 -66
  74. package/src/views/method-selector/mount-methods.js +178 -0
  75. package/src/views/modal.js +1 -1
  76. package/src/views/result.js +3 -3
  77. package/src/views/summary.js +190 -24
  78. package/src/views/summary.spec.js +145 -0
  79. package/tests/mocks/storefront-api-mock.js +27 -48
  80. package/src/style/utils/minifyCss.js +0 -14
  81. package/src/views/errors.js +0 -95
  82. package/src/views/method-selector/express-methods.js +0 -51
  83. package/src/views/method-selector/generate-framepay-config.js +0 -54
  84. package/src/views/method-selector/generate-framepay-config.spec.js +0 -195
@@ -1,503 +1,95 @@
1
- export const vars = (theme) => `
2
- /* Instruments 'global' variables
3
- ------------------------------------------------------------ */
4
- :root {
5
- ${theme.cssVars}
6
-
7
- --rebilly-fontWeight400: 400;
8
- --rebilly-fontWeight500: 500;
9
- --rebilly-fontWeight600: 600;
10
- --rebilly-fontScaleFactor: 1.5;
11
- --rebilly-fontScaleFactorS: 0.875;
12
- --rebilly-fontSizeS: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactorS));
13
- --rebilly-fontLineHeightS: calc(var(--rebilly-fontSizeS) * 1);
14
-
15
- --rebilly-fontSizeL: calc(var(--rebilly-fontSizeBase) * var(--rebilly-fontScaleFactor));
16
- --rebilly-fontLineHeightL: calc(var(--rebilly-fontLineHeightBase) * 2);
17
- --rebilly-fontMarginTopL: 0;
18
- --rebilly-fontMarginBottomL: var(--rebilly-fontLineHeightBase);
19
-
20
- --rebilly-spacing2xs: calc(var(--rebilly-fontLineHeightBase) / 6);
21
- --rebilly-spacingXs: calc(var(--rebilly-fontLineHeightBase) / 4);
22
- --rebilly-spacingS: calc(var(--rebilly-fontLineHeightBase) / 2);
23
- --rebilly-spacingM: var(--rebilly-fontLineHeightBase);
24
- --rebilly-spacingL: calc(var(--rebilly-fontLineHeightBase) * 2);
25
- --rebilly-spacingXl: calc(var(--rebilly-fontLineHeightBase) * 4);
26
-
27
- --rebilly-spacingFormElementMinHeight: calc(var(--rebilly-spacingM) * 1.83333);
28
-
29
- --rebilly-summaryLoaderMinHeight: var(--rebilly-fontLineHeightBase);
30
- --rebilly-methodLoaderMinHeight: calc((4 * var(--rebilly-spacingFormElementMinHeight)) + (2 * var(--rebilly-fontLineHeightBase)) + (2 * var(--rebilly-spacingM)) + var(--rebilly-spacing2xs) + var(--rebilly-fontSizeS) + calc(2 * (var(--rebilly-spacingXs) + var(--rebilly-spacingS))) + var(--rebilly-spacingL));
31
- }
32
-
33
- /* Views. Method Selector
34
- ------------------------------------------------------------ */
35
- .rebilly-instruments-method-selector.has-express-compact {
36
- padding-top: var(--rebilly-spacingS);
37
- }
38
-
39
- /* Express Methods
40
- ------------------------------------------------------------ */
41
- @-webkit-keyframes rebillyExpressShine {
42
- to {
43
- background-position-x: -200%;
44
- }
45
- }
46
- @keyframes rebillyExpressShine {
47
- to {
48
- background-position-x: -200%;
1
+ export const base = (theme) => `
2
+ /* Instruments 'global' variables
3
+ ------------------------------------------------------------ */
4
+ :root,
5
+ #rebilly-instruments-app,
6
+ .rebilly-instruments-content,
7
+ .rebilly-instruments-loader,
8
+ .rebilly-instruments-modal-overlay {
9
+ ${theme.cssVars}
10
+
11
+ --rebilly-spacings-base: calc(var(--rebilly-fontSizeBase) * 1.5);
12
+ --rebilly-spacings-2xs: calc(var(--rebilly-spacings-base) * 0.16667);
13
+ --rebilly-spacings-xs: calc(var(--rebilly-spacings-base) * 0.25);
14
+ --rebilly-spacings-s: calc(var(--rebilly-spacings-base) * 0.5);
15
+ --rebilly-spacings-m: var(--rebilly-spacings-base);
16
+ --rebilly-spacings-l: calc(var(--rebilly-spacings-base) * 2);
17
+ --rebilly-spacings-xl: calc(var(--rebilly-spacings-base) * 4);
18
+ --rebilly-spacings-2xl: calc(var(--rebilly-spacings-base) * 4.6667);
19
+
20
+ --rebilly-spacings-input-py: calc(var(--rebilly-spacings-2xs) * 2);
21
+ --rebilly-spacings-input-px: calc(var(--rebilly-spacings-s) + var(--rebilly-spacings-2xs));
22
+ --rebilly-spacings-label-offset-left: var(--rebilly-spacings-input-px);
23
+ --rebilly-spacings-form-element-min-height: calc(var(--rebilly-spacings-base) * 1.83333);
24
+ --rebilly-spacings-button-py: var(--rebilly-spacings-input-py);
25
+ --rebilly-spacings-button-px: var(--rebilly-spacings-input-px);
49
26
  }
50
- }
51
-
52
- .rebilly-instruments-express-methods { padding: 2px; }
53
-
54
- .rebilly-instruments-express-methods.is-compact {
55
- border: 1px solid var(--rebilly-colorMutedBorder);
56
- padding: var(--rebilly-spacingS);
57
- padding-top: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS));
58
- padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacing2xs));
59
- border-radius: var(--rebilly-borderRadius);
60
- position: relative;
61
- }
62
-
63
- .rebilly-instruments-express-methods .rebilly-instruments-iframe {
64
- display: block;
65
- margin-bottom: 0;
66
- height: var(--rebilly-spacingFormElementMinHeight);
67
- }
68
-
69
- .rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {
70
- border-radius: 6px;
71
- margin-bottom: var(--rebilly-spacingS);
72
- background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);
73
- background-size: 200% 100%;
74
- -webkit-animation: 1.5s rebillyExpressShine linear infinite;
75
- animation: 1.5s rebillyExpressShine linear infinite;
76
- height: 44px;
77
- }
78
-
79
- .rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {
80
- margin: 0;
81
- }
82
-
83
- .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {
84
- display: -webkit-box;
85
- display: -ms-flexbox;
86
- display: flex;
87
- -webkit-box-pack: center;
88
- -ms-flex-pack: center;
89
- justify-content: center;
90
- }
91
-
92
- .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {
93
- -webkit-box-flex: 1;
94
- -ms-flex: 1 1 0px;
95
- flex: 1 1 0px;
96
- max-width: 260px;
97
- margin: 0 var(--rebilly-spacingXs);
98
- }
99
27
 
100
- .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {
101
- margin-left: 0;
102
- }
103
28
 
104
- .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {
105
- margin-right: 0;
106
- }
107
-
108
- .rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {
109
- display: none;
110
- }
111
-
112
- .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {
113
- position: absolute;
114
- font-family: var(--rebilly-fontFamily);
115
- top: 0; left: 50%;
116
- -webkit-transform: translateX(-50%) translateY(-50%);
117
- transform: translateX(-50%) translateY(-50%);
118
- color: var(--rebilly-colorText);
119
- padding: var(--rebilly-spacing2xs) var(--rebilly-spacingM);
120
- line-height: 1;
121
- background: var(--rebilly-colorBackground);
122
- display: inline-block;
123
- font-weight: var(--rebilly-fontWeightBase);
124
- min-height: auto;
125
- margin: 0;
126
- white-space: nowrap;
127
- }
128
-
129
- @media (max-width: 600px) {
130
- .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {
131
- -webkit-box-orient: vertical;
132
- -webkit-box-direction: normal;
133
- -ms-flex-direction: column;
134
- flex-direction: column;
29
+ /* Base, Typography
30
+ ------------------------------------------------------------ */
31
+ /* Base setup for top level elements */
32
+ .rebilly-instruments-content,
33
+ .rebilly-instruments-method-content,
34
+ .rebilly-instruments-confirmation,
35
+ .rebilly-instruments-results {
36
+ color: var(--rebilly-colorText);
37
+ background: var(--rebilly-colorBackground);
38
+ font-size: var(--rebilly-fontSizeBase);
39
+ font-weight: var(--rebilly-fontWeightBase);
40
+ line-height: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
41
+ font-family: var(--rebilly-fontFamily);
42
+ -webkit-font-smoothing: antialiased;
43
+ -moz-osx-font-smoothing: grayscale;
44
+ text-align: left;
45
+ transition: all 200ms;
46
+ font-smooth: var(--rebilly-fontSmooth);
135
47
  }
136
48
 
137
- .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {
138
- max-width: 100%;
139
- margin: 0 0 var(--rebilly-spacingS);
140
- }
141
-
142
- .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {
143
- margin: 0;
49
+ .rebilly-instruments-link {
50
+ color: var(--rebilly-colorPrimary);
51
+ cursor: pointer;
144
52
  }
145
- }
146
-
147
- /* Components. Divider
148
- ------------------------------------------------------------ */
149
- .rebilly-instruments-divider {
150
- line-height: var(--rebilly-fontLineHeightBase);
151
- padding: var(--rebilly-spacingM) 0;
152
- margin: 0;
153
- position: relative;
154
- outline: 0;
155
- border: 0;
156
- text-align: center;
157
- font-family: var(--rebilly-fontFamily);
158
- }
159
-
160
- .rebilly-instruments-divider-s { padding: var(--rebilly-spacingS) 0; }
161
- .rebilly-instruments-divider-xs { padding: var(--rebilly-spacingXs) 0; }
162
-
163
- .rebilly-instruments-divider::before {
164
- background: var(--rebilly-colorMutedBorder);
165
- content: '';
166
- position: absolute;
167
- left: 0;
168
- top: 50%;
169
- width: 100%;
170
- height: 1px;
171
- }
172
-
173
- .rebilly-instruments-divider .rebilly-instruments-divider-label {
174
- color: var(--rebilly-colorMutedText);
175
- font-weight: var(--rebilly-fontWeightBase);
176
- padding: 0 var(--rebilly-spacingM);
177
- line-height: var(--rebilly-fontLineHeightS);
178
- background-color: var(--rebilly-colorBackground);
179
- font-size: var(--rebilly-fontSizeS);
180
- position: relative;
181
- display: inline-block;
182
- }
183
-
184
- /* Vendor, Postmate
185
- ------------------------------------------------------------ */
186
- .rebilly-instruments-iframe {
187
- border: none;
188
- width: 100%;
189
- height: 0;
190
- padding: 0;
191
- }
192
-
193
- .rebilly-instruments-iframe-overlay {
194
- top: -2px;
195
- left: -2px;
196
- width: calc(100vw + 2px);
197
- height: 100vh;
198
- min-height: calc(100vh + 4px);
199
- position: fixed;
200
- z-index: 99999999999999;
201
- }
202
-
203
- /* Views. Modal
204
- ------------------------------------------------------------ */
205
- .rebilly-instruments-modal-overlay {
206
- position: fixed;
207
- top: 0;
208
- left: 0;
209
- overflow-x: hidden;
210
- overflow-y: auto;
211
- z-index: 1055;
212
- padding: 30px;
213
- width: 100%;
214
- height: 100%;
215
- margin: 0;
216
- padding: 0;
217
- -webkit-transition: all 0.12s ease-in-out;
218
- transition: all 0.12s ease-in-out;
219
- background-color: rgba(0,0,0,0.7);
220
- opacity: 0
221
- }
222
-
223
- .rebilly-instruments-modal-overlay.is-visible {
224
- opacity: 1;
225
- }
226
-
227
- .rebilly-instruments-modal-container {
228
- -webkit-transition: all .24s ease-in-out;
229
- transition: all .24s ease-in-out;
230
- position: relative;
231
- max-width: 750px;
232
- background: var(--rebilly-colorBackground);
233
- margin: 50px auto 20px;
234
- -webkit-box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);
235
- box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);
236
- border-radius: 4px;
237
- -webkit-transform: translateY(-50px);
238
- transform: translateY(-50px);
239
- opacity: 0;
240
- }
241
-
242
- .rebilly-instruments-modal-container.is-visible {
243
- -webkit-transform: translateY(0);
244
- transform: translateY(0);
245
- opacity: 1;
246
- }
247
-
248
- .rebilly-instruments-modal-container.is-redirect {
249
- max-width: 60vw;
250
- width: auto;
251
- }
252
53
 
253
- .rebilly-instruments-modal-content {
254
- -webkit-transition: all .15s;
255
- transition: all .15s;
256
- padding: 20px;
257
- overflow: hidden;
258
- background-color: var(--rebilly-colorBackground);
259
- text-align: center;
260
- border-radius: 4px;
261
- }
262
-
263
- .rebilly-instruments-modal-content .rebilly-instruments-iframe {
264
- -webkit-transition: all .15s;
265
- transition: all .15s;
266
- height: auto;
267
- min-height: 360px;
268
- }
269
-
270
- .rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {
271
- padding: 0;
272
- }
273
-
274
- .rebilly-instruments-modal-close {
275
- position: absolute;
276
- width: 30px;
277
- height: 30px;
278
- top: -40px;
279
- right: 0;
280
- fill: #FFF;
281
- cursor: pointer;
282
- }
283
-
284
- .rebilly-instruments-modal-close:hover{
285
- color: #000;
286
- }
287
-
288
- @media screen and (max-width: 480px) {
289
- .rebilly-instruments-modal-container.is-redirect {
290
- max-width: 96vw;
291
- margin: 20px auto 20px;
54
+ .rebilly-instruments-link:hover {
55
+ text-decoration: none;
292
56
  }
293
- }
294
-
295
- /* Components. Loader
296
- ------------------------------------------------------------ */
297
- .rebilly-instruments-loader {
298
- text-align: left;
299
- position: absolute;
300
- top: 0;
301
- bottom: 0;
302
- left: 0;
303
- right: 0;
304
- display: none;
305
- background-color: var(--rebilly-colorBackground);
306
- z-index: 1000;
307
- -webkit-transition: all 200ms;
308
- transition: all 200ms;
309
- border-radius: var(--rebilly-borderRadius);
310
- }
311
-
312
- .rebilly-instruments-loader.is-active {
313
- display: block;
314
- }
315
-
316
- /* Type */
317
- .rebilly-instruments-loader p {
318
- color: var(--rebilly-colorText);
319
- display: inline-block;
320
- margin: 0;
321
- font-weight: var(--rebilly-fontWeightBase);
322
- font-size: var(--rebilly-fontSizeBase);
323
- line-height: var(--rebilly-fontLineHeightBase);
324
- }
325
-
326
- .rebilly-instruments-loader small {
327
- color: var(--rebilly-colorText);
328
- display: inline-block;
329
- margin: 0;
330
- font-size: var(--rebilly-fontSizeS);
331
- line-height: 1;
332
- }
333
-
334
- /* Summary */
335
- .rebilly-instruments-summary-loader-total p.total {
336
- font-family: var(--rebilly-fontFamily);
337
- font-size: var(--rebilly-fontSizeL);
338
- font-weight: var(--rebilly-headingFontWeight);
339
- }
340
-
341
- /* Methods */
342
- .rebilly-instruments-methods-loader-card-icon {
343
- width: 32px;
344
- height: 22px;
345
- margin-left: var(--rebilly-spacing2xs);
346
- margin-bottom: var(--rebilly-spacing2xs);
347
- }
348
-
349
- .rebilly-instruments-methods-loader-form-fields { margin: calc(var(--rebilly-spacingXs) + var(--rebilly-spacingS)) 0; }
350
-
351
- /* Spinner */
352
- .rebilly-instruments-loader-spinner {
353
- top: 50%;
354
- left: 50%;
355
- position: absolute;
356
- -webkit-transform: translate(-50%, -50%);
357
- transform: translate(-50%, -50%);
358
- border: 2px solid transparent;
359
- border-top: 2px solid var(--rebilly-colorPrimary);
360
- border-radius: 50%;
361
- width: var(--rebilly-fontLineHeightBase);
362
- height: var(--rebilly-fontLineHeightBase);
363
- margin-top: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);
364
- margin-left: calc(-1 * var(--rebilly-fontLineHeightBase) / 2);
365
- -webkit-animation: spin 0.5s ease infinite;
366
- animation: spin 0.5s ease infinite;
367
- }
368
-
369
- @-webkit-keyframes spin {
370
- 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
371
- 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
372
- }
373
-
374
- @keyframes spin {
375
- 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); }
376
- 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); }
377
- }
378
57
 
379
- /* Utils */
380
- .rebilly-instruments-loader-display-flex { display: -webkit-box; display: -ms-flexbox; display: flex; }
381
- .rebilly-instruments-loader-align-center { -webkit-box-align: center; -ms-flex-align: center; align-items: center; }
382
- .rebilly-instruments-loader-justify-space-between { -webkit-box-pack: justify; -ms-flex-pack: justify; justify-content: space-between; }
383
- .rebilly-instruments-loader-justify-end { -webkit-box-pack: end; -ms-flex-pack: end; justify-content: flex-end; }
384
-
385
- .is-el-loading {
386
- position: relative;
387
- color: transparent!important;
388
- }
389
-
390
- .is-el-loading::before {
391
- position: absolute;
392
- content: '';
393
- top: 0;
394
- bottom: 0;
395
- left: 0;
396
- right: 0;
397
- background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);
398
- background-size: 200% 100%;
399
- -webkit-animation: 1.5s rebillyExpressShine linear infinite;
400
- animation: 1.5s rebillyExpressShine linear infinite;
401
- border-radius: var(--rebilly-borderRadius);
402
- }
403
-
404
- .rebilly-instruments-loader-form-el {
405
- width: 100%;
406
- min-height: var(--rebilly-spacingFormElementMinHeight);
407
- }
408
-
409
- .rebilly-instruments-loader-form-label {
410
- display: -webkit-box;
411
- display: -ms-flexbox;
412
- display: flex;
413
- margin-bottom: var(--rebilly-spacing2xs);
414
- }
415
-
416
- .rebilly-instruments-loader-form-el.is-button {
417
- margin-top: var(--rebilly-spacingL);
418
- text-align: center;
419
- font-size: var(--rebilly-buttonFontSize);
420
- font-family: var(--rebilly-buttonFontFamily);
421
- line-height: var(--rebilly-buttonFontLineHeight);
422
- padding: var(--rebilly-spacingS);
423
- -webkit-box-sizing: border-box;
424
- box-sizing: border-box;
425
- background: var(--rebilly-buttonColorBackground);
426
- color: transparent;
427
- border-radius: var(--rebilly-buttonBorderRadius);
428
- font-weight: var(--rebilly-buttonFontWeight);
429
- border: var(--rebilly-buttonBorder);
430
- -webkit-box-shadow: var(--rebilly-buttonBoxShadow);
431
- box-shadow: var(--rebilly-buttonBoxShadow);
432
- outline: none;
433
- cursor: not-allowed;
434
- opacity: 0.6;
435
- }
436
-
437
- .rebilly-instruments-methods-loader-card-icon.is-el-loading::before {
438
- border-radius: calc(var(--rebilly-borderRadius) / 2);
439
- }
440
-
441
- /* Error
442
- ------------------------------------------------------------ */
443
- .rebilly-instruments-error-card {
444
- border: 1px solid var(--rebilly-colorDanger);
445
- border-radius: var(--rebilly-borderRadius);
446
- text-align: left;
447
- padding: var(--rebilly-spacingS);
448
- margin-bottom: var(--rebilly-spacingL);
449
- }
58
+ .rebilly-instruments-link .rebilly-instruments-icon {
59
+ fill: var(--rebilly-colorPrimary);
60
+ }
450
61
 
451
- .rebilly-instruments-error-card-header {
452
- display: -webkit-box;
453
- display: -ms-flexbox;
454
- display: flex;
455
- -webkit-box-align: center;
456
- -ms-flex-align: center;
457
- align-items: center;
458
- -webkit-box-pack: justify;
459
- -ms-flex-pack: justify;
460
- justify-content: space-between;
461
- width: 100%;
462
- -webkit-box-align: start;
463
- -ms-flex-align: start;
464
- align-items: flex-start;
465
- }
62
+ .rebilly-instruments-link.has-icon-left,
63
+ .rebilly-instruments-link.has-icon-right {
64
+ display: inline-flex;
65
+ }
466
66
 
467
- .rebilly-instruments-error-card-title {
468
- font-weight: var(--rebilly-fontWeightBase);
469
- font-size: var(--rebilly-fontSizeBase);
470
- line-height: var(--rebilly-fontLineHeightBase);
471
- font-family: var(--rebilly-headingFontFamily);
472
- margin: 0 0 var(--rebilly-spacingS);
473
- color: var(--rebilly-colorDanger);
474
- }
67
+ .rebilly-instruments-link.has-icon-left .rebilly-instruments-icon {
68
+ margin-right: var(--rebilly-spacings-xs);
69
+ }
475
70
 
476
- .rebilly-instruments-error-card-close-button {
477
- cursor: pointer;
478
- background: transparent;
479
- border: none;
480
- padding: 0;
481
- }
71
+ .rebilly-instruments-link.has-icon-right .rebilly-instruments-icon {
72
+ margin-left: var(--rebilly-spacings-xs);
73
+ }
482
74
 
483
- .rebilly-instruments-error-card-close-button svg {
484
- width: var(--rebilly-fontLineHeightBase);
485
- height: var(--rebilly-fontLineHeightBase);
486
- fill: var(--rebilly-colorText);
487
- }
75
+ /* Typography */
76
+ .rebilly-instruments-h1,
77
+ .rebilly-instruments-h2 {
78
+ font-weight: var(--rebilly-headingFontWeight);
79
+ font-family: var(--rebilly-headingFontFamily);
80
+ color: var(--rebilly-headingColorText);
81
+ }
488
82
 
489
- .rebilly-instruments-error-card-details {
490
- padding: 0;
491
- margin: 0;
492
- list-style: none;
493
- }
83
+ .rebilly-instruments-h1 {
84
+ font-size: calc(var(--rebilly-fontSizeBase) * 1.5);
85
+ line-height: 1.5;
86
+ line-height: calc(${theme.fontLineHeightBase} * 1.5);
87
+ margin: 0 0 calc(var(--rebilly-spacings-base) * 1.5) 0;
88
+ }
494
89
 
495
- .rebilly-instruments-error-card-details li,
496
- .rebilly-instruments-error-card-message {
497
- color: var(--rebilly-colorText);
498
- margin: 0;
499
- font-weight: var(--rebilly-fontWeightBase);
500
- font-size: var(--rebilly-fontSizeBase);
501
- line-height: var(--rebilly-fontLineHeightBase);
502
- }
90
+ .rebilly-instruments-h2 {
91
+ font-size: calc(var(--rebilly-fontSizeBase) * 1.125);
92
+ line-height: var(--rebilly-fontLineHeightBase, 1.33);
93
+ margin: 0 0 var(--rebilly-spacings-base) 0;
94
+ }
503
95
  `;
@@ -16,14 +16,15 @@ export class Theme {
16
16
 
17
17
  get cssVars() {
18
18
  return Object.keys(this.theme)
19
- .filter(v => !Theme.nonCssProperties.includes(v))
20
- .map((p, i) => `${!i ? '' : ' '}--rebilly-${p}: ${this.theme[p]};`)
21
- .join('\n');
19
+ .filter(v => !Theme.nonCssProperties.includes(v))
20
+ .map(p => `--rebilly-${p}: ${this.theme[p]};`)
21
+ .join('\n');
22
22
  }
23
23
 
24
24
  build() {
25
25
  this.overrideTheme();
26
26
  return {
27
+ ...this.theme,
27
28
  cssVars: this.cssVars
28
29
  }
29
30
  }
@@ -13,7 +13,8 @@ describe('RebillyInstruments theme', () => {
13
13
  buttonBorderRadius: '30px'
14
14
  };
15
15
  const theme = new Theme(overrides).build();
16
- expect(theme.cssVars).toMatch('--rebilly-colorPrimary: red;');
17
- expect(theme.cssVars).toMatch('--rebilly-buttonBorderRadius: 30px;');
16
+
17
+ expect(theme.colorPrimary).toEqual('red');
18
+ expect(theme.buttonBorderRadius).toEqual('30px');
18
19
  });
19
20
  });
@@ -0,0 +1 @@
1
+ export const browserslist = ['> 1%', 'last 2 versions'];