@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.
- package/README.md +1 -1
- package/dist/index.js +66 -43
- package/dist/index.min.js +66 -43
- package/package.json +6 -3
- package/src/functions/destroy.js +2 -8
- package/src/functions/mount/fetch-data.js +2 -9
- package/src/functions/mount/index.js +10 -15
- package/src/functions/mount/mount.spec.js +11 -10
- package/src/functions/mount/setup-framepay-theme.js +72 -30
- package/src/functions/mount/setup-options.js +2 -2
- package/src/functions/mount/{setup-styles-vars.js → setup-styles.js} +7 -9
- package/src/functions/purchase.js +5 -2
- package/src/functions/setup.js +6 -3
- package/src/functions/show.js +2 -2
- package/src/functions/show.spec.js +4 -4
- package/src/functions/update.spec.js +3 -4
- package/src/instance.js +1 -4
- package/src/loader/index.js +33 -57
- package/src/storefront/index.js +5 -2
- package/src/storefront/payment-instruments.js +0 -7
- package/src/style/base/__snapshots__/theme.spec.js.snap +220 -136
- package/src/style/base/default-theme.js +14 -187
- package/src/style/base/index.js +79 -487
- package/src/style/base/theme.js +4 -3
- package/src/style/base/theme.spec.js +3 -2
- package/src/style/browserslist.js +1 -0
- package/src/style/components/accordion.js +140 -0
- package/src/style/components/address.js +55 -0
- package/src/style/components/button.js +117 -0
- package/src/style/components/divider.js +39 -0
- package/src/style/components/forms/checkbox.js +75 -0
- package/src/style/components/forms/field.js +56 -0
- package/src/style/components/forms/form.js +18 -0
- package/src/style/components/forms/input.js +77 -0
- package/src/style/components/forms/label.js +55 -0
- package/src/style/components/forms/radio.js +80 -0
- package/src/style/components/forms/select.js +86 -0
- package/src/style/components/forms/validation.js +72 -0
- package/src/style/components/icons.js +13 -0
- package/src/style/components/index.js +39 -0
- package/src/style/components/loader.js +41 -0
- package/src/style/components/methods.js +97 -0
- package/src/style/components/overlay.js +24 -0
- package/src/style/helpers/index.js +54 -0
- package/src/style/index.js +24 -4
- package/src/style/payment-instruments/content.js +8 -0
- package/src/style/payment-instruments/index.js +14 -0
- package/src/style/payment-instruments/payment-card.js +27 -0
- package/src/style/payment-instruments/payment-instrument-list.js +44 -0
- package/src/style/payment-instruments/payment-instrument.js +55 -0
- package/src/style/utils/color-values.js +1 -1
- package/src/style/utils/remove-empty-null.js +10 -0
- package/src/style/vendor/framepay.js +28 -0
- package/src/style/vendor/postmate.js +18 -0
- package/src/style/views/confirmation.js +26 -0
- package/src/style/views/index.js +16 -0
- package/src/style/views/method-selector.js +11 -0
- package/src/style/views/modal.js +91 -0
- package/src/style/views/result.js +52 -0
- package/src/style/views/summary.js +118 -0
- package/src/views/__snapshots__/summary.spec.js.snap +246 -0
- package/src/views/common/iframe/base-iframe.js +2 -3
- package/src/views/common/iframe/event-listeners.js +9 -12
- package/src/views/common/iframe/method-iframe.js +1 -3
- package/src/views/common/iframe/modal-iframe.js +2 -4
- package/src/views/common/iframe/view-iframe.js +1 -3
- package/src/views/confirmation.js +7 -12
- package/src/views/method-selector/express-methods/apple-pay.js +92 -0
- package/src/views/method-selector/express-methods/index.js +25 -0
- package/src/views/method-selector/get-payment-methods.js +1 -0
- package/src/views/method-selector/index.js +58 -45
- package/src/views/method-selector/method-selector.spec.js +1 -1
- package/src/views/method-selector/mount-express-methods.js +26 -66
- package/src/views/method-selector/mount-methods.js +178 -0
- package/src/views/modal.js +1 -1
- package/src/views/result.js +3 -3
- package/src/views/summary.js +190 -24
- package/src/views/summary.spec.js +145 -0
- package/tests/mocks/storefront-api-mock.js +27 -48
- package/src/style/utils/minifyCss.js +0 -14
- package/src/views/errors.js +0 -95
- package/src/views/method-selector/express-methods.js +0 -51
- package/src/views/method-selector/generate-framepay-config.js +0 -54
- package/src/views/method-selector/generate-framepay-config.spec.js +0 -195
package/src/style/base/index.js
CHANGED
|
@@ -1,503 +1,95 @@
|
|
|
1
|
-
export const
|
|
2
|
-
/* Instruments 'global' variables
|
|
3
|
-
------------------------------------------------------------ */
|
|
4
|
-
:root
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
.rebilly-instruments-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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-
|
|
138
|
-
|
|
139
|
-
|
|
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-
|
|
254
|
-
|
|
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
|
-
|
|
380
|
-
|
|
381
|
-
|
|
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-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
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-
|
|
468
|
-
|
|
469
|
-
|
|
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-
|
|
477
|
-
|
|
478
|
-
|
|
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
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
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-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
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-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
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
|
`;
|
package/src/style/base/theme.js
CHANGED
|
@@ -16,14 +16,15 @@ export class Theme {
|
|
|
16
16
|
|
|
17
17
|
get cssVars() {
|
|
18
18
|
return Object.keys(this.theme)
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
17
|
-
expect(theme.
|
|
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'];
|