@rebilly/instruments 3.1.0-beta.0 → 3.1.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 (165) hide show
  1. package/dist/index.js +88 -107
  2. package/dist/index.min.js +88 -0
  3. package/package.json +17 -6
  4. package/rollup.config.js +84 -0
  5. package/src/functions/mount/fetch-data.js +13 -1
  6. package/src/functions/mount/index.js +6 -42
  7. package/src/functions/mount/setup-framepay-theme.js +2 -2
  8. package/src/functions/mount/setup-options.js +3 -0
  9. package/src/functions/mount/setup-user-flow.js +49 -0
  10. package/src/functions/purchase.js +1 -1
  11. package/src/functions/setup.js +1 -1
  12. package/src/functions/show.spec.js +1 -1
  13. package/src/i18n/en.json +3 -0
  14. package/src/index.js +1 -61
  15. package/src/instance.js +65 -0
  16. package/src/{index.spec.js → instance.spec.js} +2 -1
  17. package/src/loader/index.js +21 -1
  18. package/src/storefront/models/ready-to-pay-model.js +13 -2
  19. package/src/storefront/plans.js +8 -4
  20. package/src/storefront/plans.spec.js +8 -2
  21. package/src/storefront/products.js +8 -4
  22. package/src/storefront/products.spec.js +8 -2
  23. package/src/storefront/ready-to-pay.js +5 -4
  24. package/src/style/components/button.js +1 -0
  25. package/src/style/components/loader.js +2 -1
  26. package/src/style/payment-instruments/payment-card.js +2 -1
  27. package/src/style/utils/remove-empty-null.js +9 -9
  28. package/src/style/vendor/postmate.js +13 -0
  29. package/src/style/views/confirmation.js +2 -1
  30. package/src/views/common/iframe/base-iframe.js +2 -0
  31. package/src/views/common/iframe/event-listeners.js +10 -0
  32. package/src/views/common/iframe/method-iframe.js +3 -1
  33. package/src/views/confirmation.js +1 -0
  34. package/src/views/method-selector/express-methods/{google-pay.js → index.js} +3 -2
  35. package/src/views/method-selector/mount-express-methods.js +6 -18
  36. package/src/views/result.js +1 -0
  37. package/tests/mocks/rebilly-instruments-mock.js +2 -2
  38. package/dist/events/base-event.js +0 -66
  39. package/dist/events/events.spec.js +0 -18
  40. package/dist/events/index.js +0 -22
  41. package/dist/functions/destroy.js +0 -34
  42. package/dist/functions/destroy.spec.js +0 -69
  43. package/dist/functions/mount/fetch-data.js +0 -187
  44. package/dist/functions/mount/fetch-data.spec.js +0 -189
  45. package/dist/functions/mount/index.js +0 -218
  46. package/dist/functions/mount/mount.spec.js +0 -64
  47. package/dist/functions/mount/setup-element.js +0 -40
  48. package/dist/functions/mount/setup-framepay-theme.js +0 -95
  49. package/dist/functions/mount/setup-framepay.js +0 -46
  50. package/dist/functions/mount/setup-i18n.js +0 -33
  51. package/dist/functions/mount/setup-options.js +0 -99
  52. package/dist/functions/mount/setup-options.spec.js +0 -66
  53. package/dist/functions/mount/setup-storefront.js +0 -34
  54. package/dist/functions/mount/setup-styles.js +0 -43
  55. package/dist/functions/on.js +0 -40
  56. package/dist/functions/on.spec.js +0 -55
  57. package/dist/functions/purchase.js +0 -158
  58. package/dist/functions/purchase.spec.js +0 -74
  59. package/dist/functions/setup.js +0 -85
  60. package/dist/functions/setup.spec.js +0 -87
  61. package/dist/functions/show.js +0 -55
  62. package/dist/functions/show.spec.js +0 -61
  63. package/dist/functions/update.js +0 -74
  64. package/dist/functions/update.spec.js +0 -86
  65. package/dist/i18n/en.json +0 -22
  66. package/dist/i18n/es.json +0 -22
  67. package/dist/i18n/i18n.spec.js +0 -22
  68. package/dist/i18n/index.js +0 -72
  69. package/dist/index.spec.js +0 -35
  70. package/dist/loader/index.js +0 -94
  71. package/dist/loader/loader.spec.js +0 -69
  72. package/dist/storefront/index.js +0 -73
  73. package/dist/storefront/invoices.js +0 -27
  74. package/dist/storefront/models/base-model.js +0 -18
  75. package/dist/storefront/models/invoice-model.js +0 -14
  76. package/dist/storefront/models/plan-model.js +0 -14
  77. package/dist/storefront/models/product-model.js +0 -14
  78. package/dist/storefront/models/ready-to-pay-model.js +0 -46
  79. package/dist/storefront/models/summary-model.js +0 -79
  80. package/dist/storefront/models/transaction-model.js +0 -31
  81. package/dist/storefront/payment-instruments.js +0 -47
  82. package/dist/storefront/payment-instruments.spec.js +0 -55
  83. package/dist/storefront/plans.js +0 -37
  84. package/dist/storefront/plans.spec.js +0 -64
  85. package/dist/storefront/products.js +0 -40
  86. package/dist/storefront/products.spec.js +0 -65
  87. package/dist/storefront/purchase.js +0 -43
  88. package/dist/storefront/purchase.spec.js +0 -48
  89. package/dist/storefront/ready-to-pay.js +0 -58
  90. package/dist/storefront/ready-to-pay.spec.js +0 -69
  91. package/dist/storefront/storefront.spec.js +0 -15
  92. package/dist/storefront/summary.js +0 -55
  93. package/dist/storefront/summary.spec.js +0 -124
  94. package/dist/storefront/transactions.js +0 -27
  95. package/dist/style/base/__snapshots__/theme.spec.js.snap +0 -227
  96. package/dist/style/base/default-theme.js +0 -804
  97. package/dist/style/base/index.js +0 -104
  98. package/dist/style/base/theme.js +0 -41
  99. package/dist/style/base/theme.spec.js +0 -19
  100. package/dist/style/browserslist.js +0 -8
  101. package/dist/style/components/address.js +0 -64
  102. package/dist/style/components/button.js +0 -87
  103. package/dist/style/components/divider.js +0 -48
  104. package/dist/style/components/forms/checkbox.js +0 -86
  105. package/dist/style/components/forms/field.js +0 -65
  106. package/dist/style/components/forms/form.js +0 -28
  107. package/dist/style/components/forms/input.js +0 -86
  108. package/dist/style/components/forms/label.js +0 -64
  109. package/dist/style/components/forms/select.js +0 -95
  110. package/dist/style/components/forms/validation.js +0 -81
  111. package/dist/style/components/icons.js +0 -22
  112. package/dist/style/components/index.js +0 -57
  113. package/dist/style/components/loader.js +0 -50
  114. package/dist/style/components/methods.js +0 -108
  115. package/dist/style/components/overlay.js +0 -33
  116. package/dist/style/helpers/index.js +0 -59
  117. package/dist/style/index.js +0 -50
  118. package/dist/style/payment-instruments/content.js +0 -17
  119. package/dist/style/payment-instruments/index.js +0 -20
  120. package/dist/style/payment-instruments/payment-card.js +0 -35
  121. package/dist/style/utils/border.js +0 -47
  122. package/dist/style/utils/color-values.js +0 -58
  123. package/dist/style/utils/remove-empty-null.js +0 -20
  124. package/dist/style/vendor/framepay.js +0 -37
  125. package/dist/style/vendor/postmate.js +0 -17
  126. package/dist/style/views/confirmation.js +0 -85
  127. package/dist/style/views/index.js +0 -29
  128. package/dist/style/views/method-selector.js +0 -20
  129. package/dist/style/views/modal.js +0 -93
  130. package/dist/style/views/result.js +0 -61
  131. package/dist/style/views/summary.js +0 -127
  132. package/dist/utils/add-dom-element.js +0 -26
  133. package/dist/utils/format-currency.js +0 -15
  134. package/dist/utils/has-valid-css-selector.js +0 -11
  135. package/dist/utils/index.js +0 -55
  136. package/dist/utils/is-dom-element.js +0 -10
  137. package/dist/utils/process-property-as-dom-element.js +0 -38
  138. package/dist/utils/sleep.js +0 -10
  139. package/dist/views/__snapshots__/summary.spec.js.snap +0 -246
  140. package/dist/views/common/iframe/base-iframe.js +0 -59
  141. package/dist/views/common/iframe/event-listeners.js +0 -50
  142. package/dist/views/common/iframe/index.js +0 -19
  143. package/dist/views/common/iframe/method-iframe.js +0 -33
  144. package/dist/views/common/iframe/modal-iframe.js +0 -84
  145. package/dist/views/common/iframe/view-iframe.js +0 -31
  146. package/dist/views/common/render-utilities.js +0 -11
  147. package/dist/views/confirmation.js +0 -92
  148. package/dist/views/method-selector/__snapshots__/method-selector.spec.js.snap +0 -3
  149. package/dist/views/method-selector/express-methods/apple-pay.js +0 -92
  150. package/dist/views/method-selector/express-methods/google-pay.js +0 -31
  151. package/dist/views/method-selector/express-methods/paypal.js +0 -19
  152. package/dist/views/method-selector/generate-digital-wallet.js +0 -68
  153. package/dist/views/method-selector/generate-digital-wallet.spec.js +0 -135
  154. package/dist/views/method-selector/get-method-data.js +0 -25
  155. package/dist/views/method-selector/get-payment-methods.js +0 -66
  156. package/dist/views/method-selector/get-payment-methods.spec.js +0 -46
  157. package/dist/views/method-selector/index.js +0 -122
  158. package/dist/views/method-selector/method-selector.spec.js +0 -124
  159. package/dist/views/method-selector/mount-express-methods.js +0 -69
  160. package/dist/views/method-selector/mount-methods.js +0 -74
  161. package/dist/views/modal.js +0 -88
  162. package/dist/views/result.js +0 -40
  163. package/dist/views/summary.js +0 -215
  164. package/dist/views/summary.spec.js +0 -134
  165. package/src/views/method-selector/express-methods/paypal.js +0 -7
@@ -1,804 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _colorValues = require("../utils/color-values");
9
-
10
- var _border = _interopRequireDefault(require("../utils/border"));
11
-
12
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
-
14
- const properties = {
15
- /** Base Colors */
16
- colorPrimary: {
17
- fallback: {
18
- type: 'static',
19
- value: '#0044D4'
20
- }
21
- },
22
- colorBackground: {
23
- fallback: {
24
- type: 'static',
25
- value: '#FFFFFF'
26
- }
27
- },
28
- colorText: {
29
- fallback: {
30
- type: 'static',
31
- value: '#0D2B3E'
32
- }
33
- },
34
- colorMutedText: {
35
- fallback: {
36
- type: 'func',
37
- value: theme => (0, _colorValues.mutedTextColor)(theme.colorText)
38
- }
39
- },
40
- colorMutedBorder: {
41
- fallback: {
42
- type: 'func',
43
- value: theme => (0, _colorValues.mutedBorderColor)(theme.colorText)
44
- }
45
- },
46
- colorDanger: {
47
- fallback: {
48
- type: 'static',
49
- value: '#CD5C5C'
50
- }
51
- },
52
-
53
- /** Base Fonts */
54
- fontFamily: {
55
- fallback: {
56
- type: 'static',
57
- value: 'Avenir, Helvetica, Arial, sans-serif'
58
- }
59
- },
60
- fontSizeBase: {
61
- fallback: {
62
- type: 'static',
63
- value: '16px'
64
- }
65
- },
66
- fontWeightBase: {
67
- fallback: {
68
- type: 'static',
69
- value: '400'
70
- }
71
- },
72
- fontLineHeightBase: {
73
- fallback: {
74
- type: 'static',
75
- value: 'initial'
76
- }
77
- },
78
- fontSmooth: {
79
- fallback: {
80
- type: 'static',
81
- value: 'auto'
82
- }
83
- },
84
-
85
- /** Misc */
86
- borderRadius: {
87
- fallback: {
88
- type: 'static',
89
- value: '4px'
90
- }
91
- },
92
-
93
- /** Headings */
94
- headingFontFamily: {
95
- fallback: {
96
- type: 'variable',
97
- value: 'fontFamily'
98
- }
99
- },
100
- headingFontWeight: {
101
- fallback: {
102
- type: 'static',
103
- value: '500'
104
- }
105
- },
106
- headingColorText: {
107
- fallback: {
108
- type: 'variable',
109
- value: 'colorText'
110
- }
111
- },
112
-
113
- /** Buttons */
114
- buttonColorBackground: {
115
- fallback: {
116
- type: 'variable',
117
- value: 'colorPrimary'
118
- }
119
- },
120
- buttonColorText: {
121
- fallback: {
122
- type: 'static',
123
- value: '#FFFFFF'
124
- }
125
- },
126
- buttonFontFamily: {
127
- fallback: {
128
- type: 'variable',
129
- value: 'fontFamily'
130
- }
131
- },
132
- buttonFontSize: {
133
- fallback: {
134
- type: 'variable',
135
- value: 'fontSizeBase'
136
- }
137
- },
138
- buttonFontLineHeight: {
139
- fallback: {
140
- type: 'static',
141
- value: '1.5'
142
- }
143
- },
144
- buttonFontWeight: {
145
- fallback: {
146
- type: 'variable',
147
- value: 'fontWeightBase'
148
- }
149
- },
150
- buttonBorder: {
151
- fallback: {
152
- type: 'static',
153
- value: '1px solid transparent'
154
- }
155
- },
156
- buttonBorderRadius: {
157
- fallback: {
158
- type: 'variable',
159
- value: 'borderRadius'
160
- }
161
- },
162
- buttonBoxShadow: {
163
- fallback: {
164
- type: 'static',
165
- value: 'none'
166
- }
167
- },
168
-
169
- /** Buttons: Hover */
170
- buttonHoverColorBackground: {
171
- fallback: {
172
- type: 'func',
173
- value: theme => {
174
- if (theme.buttonColorBackgroundProvided) {
175
- return (0, _colorValues.darken)(theme.buttonColorBackground, 20);
176
- }
177
-
178
- return (0, _colorValues.darken)(theme.colorPrimary, 20);
179
- }
180
- }
181
- },
182
- buttonHoverColorText: {
183
- fallback: {
184
- type: 'variable',
185
- value: 'buttonColorText'
186
- }
187
- },
188
- buttonHoverFontFamily: {
189
- fallback: {
190
- type: 'variable',
191
- value: 'buttonFontFamily'
192
- }
193
- },
194
- buttonHoverFontSize: {
195
- fallback: {
196
- type: 'variable',
197
- value: 'buttonFontSize'
198
- }
199
- },
200
- buttonHoverFontLineHeight: {
201
- fallback: {
202
- type: 'variable',
203
- value: 'buttonFontLineHeight'
204
- }
205
- },
206
- buttonHoverFontWeight: {
207
- fallback: {
208
- type: 'variable',
209
- value: 'buttonFontWeight'
210
- }
211
- },
212
- buttonHoverBorder: {
213
- fallback: {
214
- type: 'func',
215
- value: theme => {
216
- if (theme.buttonBorderProvided) {
217
- return theme.buttonBorder;
218
- }
219
-
220
- const buttonBorder = new _border.default(theme.buttonBorder);
221
- return buttonBorder.updateColor(theme.buttonHoverColorBackground).value;
222
- }
223
- }
224
- },
225
- buttonHoverBorderRadius: {
226
- fallback: {
227
- type: 'variable',
228
- value: 'buttonBorderRadius'
229
- }
230
- },
231
- buttonHoverBoxShadow: {
232
- fallback: {
233
- type: 'variable',
234
- value: 'buttonBoxShadow'
235
- }
236
- },
237
-
238
- /** Buttons: Active */
239
- buttonActiveColorBackground: {
240
- fallback: {
241
- type: 'variable',
242
- value: 'buttonHoverColorBackground'
243
- }
244
- },
245
- buttonActiveColorText: {
246
- fallback: {
247
- type: 'variable',
248
- value: 'buttonHoverColorText'
249
- }
250
- },
251
- buttonActiveFontFamily: {
252
- fallback: {
253
- type: 'variable',
254
- value: 'buttonHoverFontFamily'
255
- }
256
- },
257
- buttonActiveFontSize: {
258
- fallback: {
259
- type: 'variable',
260
- value: 'buttonHoverFontSize'
261
- }
262
- },
263
- buttonActiveFontLineHeight: {
264
- fallback: {
265
- type: 'variable',
266
- value: 'buttonHoverFontLineHeight'
267
- }
268
- },
269
- buttonActiveFontWeight: {
270
- fallback: {
271
- type: 'variable',
272
- value: 'buttonHoverFontWeight'
273
- }
274
- },
275
- buttonActiveBorder: {
276
- fallback: {
277
- type: 'variable',
278
- value: 'buttonHoverBorder'
279
- }
280
- },
281
- buttonActiveBorderRadius: {
282
- fallback: {
283
- type: 'variable',
284
- value: 'buttonHoverBorderRadius'
285
- }
286
- },
287
- buttonActiveBoxShadow: {
288
- fallback: {
289
- type: 'variable',
290
- value: 'buttonHoverBoxShadow'
291
- }
292
- },
293
-
294
- /** Inputs: Base */
295
- inputColorBackground: {
296
- fallback: {
297
- type: 'static',
298
- value: 'transparent'
299
- }
300
- },
301
- inputColorText: {
302
- fallback: {
303
- type: 'variable',
304
- value: 'colorText'
305
- }
306
- },
307
- inputFontFamily: {
308
- fallback: {
309
- type: 'variable',
310
- value: 'fontFamily'
311
- }
312
- },
313
- inputFontSize: {
314
- fallback: {
315
- type: 'variable',
316
- value: 'fontSizeBase'
317
- }
318
- },
319
- inputFontLineHeight: {
320
- fallback: {
321
- type: 'static',
322
- value: '1.5'
323
- }
324
- },
325
- inputFontWeight: {
326
- fallback: {
327
- type: 'variable',
328
- value: 'fontWeightBase'
329
- }
330
- },
331
- inputBorder: {
332
- fallback: {
333
- type: 'func',
334
- value: theme => `1px solid ${(0, _colorValues.mutedBorderColor)(theme.colorText)}`
335
- }
336
- },
337
- inputBorderRadius: {
338
- fallback: {
339
- type: 'variable',
340
- value: 'borderRadius'
341
- }
342
- },
343
- inputBoxShadow: {
344
- fallback: {
345
- type: 'static',
346
- value: 'none'
347
- }
348
- },
349
-
350
- /** Inputs: Hover */
351
- inputHoverColorBackground: {
352
- fallback: {
353
- type: 'variable',
354
- value: 'inputColorBackground'
355
- }
356
- },
357
- inputHoverColorText: {
358
- fallback: {
359
- type: 'variable',
360
- value: 'inputColorText'
361
- }
362
- },
363
- inputHoverFontFamily: {
364
- fallback: {
365
- type: 'variable',
366
- value: 'inputFontFamily'
367
- }
368
- },
369
- inputHoverFontSize: {
370
- fallback: {
371
- type: 'variable',
372
- value: 'inputFontSize'
373
- }
374
- },
375
- inputHoverFontLineHeight: {
376
- fallback: {
377
- type: 'variable',
378
- value: 'inputFontLineHeight'
379
- }
380
- },
381
- inputHoverFontWeight: {
382
- fallback: {
383
- type: 'variable',
384
- value: 'inputFontWeight'
385
- }
386
- },
387
- inputHoverBorder: {
388
- fallback: {
389
- type: 'variable',
390
- value: 'inputBorder'
391
- }
392
- },
393
- inputHoverBorderRadius: {
394
- fallback: {
395
- type: 'variable',
396
- value: 'inputBorderRadius'
397
- }
398
- },
399
- inputHoverBoxShadow: {
400
- fallback: {
401
- type: 'variable',
402
- value: 'inputBoxShadow'
403
- }
404
- },
405
-
406
- /** Inputs: Focus */
407
- inputFocusColorBackground: {
408
- fallback: {
409
- type: 'variable',
410
- value: 'inputHoverColorBackground'
411
- }
412
- },
413
- inputFocusColorText: {
414
- fallback: {
415
- type: 'variable',
416
- value: 'inputHoverColorText'
417
- }
418
- },
419
- inputFocusFontFamily: {
420
- fallback: {
421
- type: 'variable',
422
- value: 'inputHoverFontFamily'
423
- }
424
- },
425
- inputFocusFontSize: {
426
- fallback: {
427
- type: 'variable',
428
- value: 'inputHoverFontSize'
429
- }
430
- },
431
- inputFocusFontLineHeight: {
432
- fallback: {
433
- type: 'variable',
434
- value: 'inputHoverFontLineHeight'
435
- }
436
- },
437
- inputFocusFontWeight: {
438
- fallback: {
439
- type: 'variable',
440
- value: 'inputHoverFontWeight'
441
- }
442
- },
443
- inputFocusBorder: {
444
- fallback: {
445
- type: 'func',
446
- value: theme => {
447
- if (theme.inputHoverBorderProvided) {
448
- return theme.inputHoverBorder;
449
- }
450
-
451
- const inputBorder = new _border.default(theme.inputBorder);
452
- return inputBorder.updateColor(theme.colorPrimary).value;
453
- }
454
- }
455
- },
456
- inputFocusBorderRadius: {
457
- fallback: {
458
- type: 'variable',
459
- value: 'inputHoverBorderRadius'
460
- }
461
- },
462
- inputFocusBoxShadow: {
463
- fallback: {
464
- type: 'func',
465
- value: theme => `0 0 0 1px ${theme.colorPrimary}`
466
- }
467
- },
468
-
469
- /** Inputs: Placholder */
470
- inputPlaceholderColorText: {
471
- fallback: {
472
- type: 'func',
473
- value: theme => {
474
- if (theme.inputColorTextProvided) {
475
- return (0, _colorValues.mutedTextColor)(theme.inputColorText);
476
- }
477
-
478
- return (0, _colorValues.mutedTextColor)(theme.colorText);
479
- }
480
- }
481
- },
482
- inputPlaceholderFontFamily: {
483
- fallback: {
484
- type: 'variable',
485
- value: 'inputFontFamily'
486
- }
487
- },
488
- inputPlaceholderFontSize: {
489
- fallback: {
490
- type: 'variable',
491
- value: 'inputFontSize'
492
- }
493
- },
494
- inputPlaceholderFontLineHeight: {
495
- fallback: {
496
- type: 'variable',
497
- value: 'inputFontLineHeight'
498
- }
499
- },
500
- inputPlaceholderFontWeight: {
501
- fallback: {
502
- type: 'variable',
503
- value: 'inputFontWeight'
504
- }
505
- },
506
-
507
- /** Inputs: Selection */
508
- inputSelectionColorText: {
509
- fallback: {
510
- type: 'static',
511
- value: 'initial'
512
- }
513
- },
514
- inputSelectionColorBackground: {
515
- fallback: {
516
- type: 'static',
517
- value: 'highlight'
518
- }
519
- },
520
-
521
- /** Inputs Error */
522
- inputErrorColorBackground: {
523
- fallback: {
524
- type: 'variable',
525
- value: 'inputColorBackground'
526
- }
527
- },
528
- inputErrorColorText: {
529
- fallback: {
530
- type: 'variable',
531
- value: 'colorDanger'
532
- }
533
- },
534
- inputErrorFontFamily: {
535
- fallback: {
536
- type: 'variable',
537
- value: 'inputFontFamily'
538
- }
539
- },
540
- inputErrorFontSize: {
541
- fallback: {
542
- type: 'variable',
543
- value: 'inputFontSize'
544
- }
545
- },
546
- inputErrorFontLineHeight: {
547
- fallback: {
548
- type: 'variable',
549
- value: 'inputFontLineHeight'
550
- }
551
- },
552
- inputErrorFontWeight: {
553
- fallback: {
554
- type: 'variable',
555
- value: 'inputFontWeight'
556
- }
557
- },
558
- inputErrorBorder: {
559
- fallback: {
560
- type: 'func',
561
- value: theme => {
562
- if (theme.inputBorderProvided) {
563
- const inputBorder = new _border.default(theme.inputBorder);
564
- return inputBorder.updateColor(theme.colorDanger).value;
565
- }
566
-
567
- return `1px solid ${theme.colorDanger}`;
568
- }
569
- }
570
- },
571
- inputErrorBorderRadius: {
572
- fallback: {
573
- type: 'variable',
574
- value: 'inputBorderRadius'
575
- }
576
- },
577
- inputErrorBoxShadow: {
578
- fallback: {
579
- type: 'variable',
580
- value: 'inputBoxShadow'
581
- }
582
- },
583
-
584
- /** Inputs Error: Hover */
585
- inputErrorHoverColorBackground: {
586
- fallback: {
587
- type: 'variable',
588
- value: 'inputErrorColorBackground'
589
- }
590
- },
591
- inputErrorHoverColorText: {
592
- fallback: {
593
- type: 'variable',
594
- value: 'inputErrorColorText'
595
- }
596
- },
597
- inputErrorHoverFontFamily: {
598
- fallback: {
599
- type: 'variable',
600
- value: 'inputErrorFontFamily'
601
- }
602
- },
603
- inputErrorHoverFontSize: {
604
- fallback: {
605
- type: 'variable',
606
- value: 'inputErrorFontSize'
607
- }
608
- },
609
- inputErrorHoverFontLineHeight: {
610
- fallback: {
611
- type: 'variable',
612
- value: 'inputErrorFontLineHeight'
613
- }
614
- },
615
- inputErrorHoverFontWeight: {
616
- fallback: {
617
- type: 'variable',
618
- value: 'inputErrorFontWeight'
619
- }
620
- },
621
- inputErrorHoverBorder: {
622
- fallback: {
623
- type: 'variable',
624
- value: 'inputErrorBorder'
625
- }
626
- },
627
- inputErrorHoverBorderRadius: {
628
- fallback: {
629
- type: 'variable',
630
- value: 'inputErrorBorderRadius'
631
- }
632
- },
633
- inputErrorHoverBoxShadow: {
634
- fallback: {
635
- type: 'variable',
636
- value: 'inputErrorBoxShadow'
637
- }
638
- },
639
-
640
- /** Inputs Error: Focus */
641
- inputErrorFocusColorBackground: {
642
- fallback: {
643
- type: 'variable',
644
- value: 'inputErrorHoverColorBackground'
645
- }
646
- },
647
- inputErrorFocusColorText: {
648
- fallback: {
649
- type: 'variable',
650
- value: 'inputErrorHoverColorText'
651
- }
652
- },
653
- inputErrorFocusFontFamily: {
654
- fallback: {
655
- type: 'variable',
656
- value: 'inputErrorHoverFontFamily'
657
- }
658
- },
659
- inputErrorFocusFontSize: {
660
- fallback: {
661
- type: 'variable',
662
- value: 'inputErrorHoverFontSize'
663
- }
664
- },
665
- inputErrorFocusFontLineHeight: {
666
- fallback: {
667
- type: 'variable',
668
- value: 'inputErrorHoverFontLineHeight'
669
- }
670
- },
671
- inputErrorFocusFontWeight: {
672
- fallback: {
673
- type: 'variable',
674
- value: 'inputErrorHoverFontWeight'
675
- }
676
- },
677
- inputErrorFocusBorder: {
678
- fallback: {
679
- type: 'variable',
680
- value: 'inputErrorHoverBorder'
681
- }
682
- },
683
- inputErrorFocusBorderRadius: {
684
- fallback: {
685
- type: 'variable',
686
- value: 'inputErrorHoverBorderRadius'
687
- }
688
- },
689
- inputErrorFocusBoxShadow: {
690
- fallback: {
691
- type: 'variable',
692
- value: 'inputErrorHoverBoxShadow'
693
- }
694
- },
695
-
696
- /** Inputs Error: Placholder */
697
- inputErrorPlaceholderColorText: {
698
- fallback: {
699
- type: 'func',
700
- value: theme => {
701
- if (theme.inputErrorColorTextProvided) {
702
- return (0, _colorValues.mutedTextColor)(theme.inputErrorColorText);
703
- }
704
-
705
- return (0, _colorValues.mutedTextColor)(theme.colorDanger);
706
- }
707
- }
708
- },
709
- inputErrorPlaceholderFontFamily: {
710
- fallback: {
711
- type: 'variable',
712
- value: 'inputPlaceholderFontFamily'
713
- }
714
- },
715
- inputErrorPlaceholderFontSize: {
716
- fallback: {
717
- type: 'variable',
718
- value: 'inputPlaceholderFontSize'
719
- }
720
- },
721
- inputErrorPlaceholderFontLineHeight: {
722
- fallback: {
723
- type: 'variable',
724
- value: 'inputPlaceholderFontLineHeight'
725
- }
726
- },
727
- inputErrorPlaceholderFontWeight: {
728
- fallback: {
729
- type: 'variable',
730
- value: 'inputPlaceholderFontWeight'
731
- }
732
- },
733
-
734
- /** Inputs Error: Selection */
735
- inputErrorSelectionColorText: {
736
- fallback: {
737
- type: 'variable',
738
- value: 'inputSelectionColorText'
739
- }
740
- },
741
- inputErrorSelectionColorBackground: {
742
- fallback: {
743
- type: 'variable',
744
- value: 'inputSelectionColorBackground'
745
- }
746
- },
747
-
748
- /** Labels */
749
- labels: {
750
- fallback: {
751
- type: 'static',
752
- value: 'floating'
753
- }
754
- }
755
- };
756
-
757
- var _default = new Proxy(properties, {
758
- get(obj, prop, receiver) {
759
- if (prop in obj) {
760
- if (obj[prop].value) {
761
- return obj[prop].value;
762
- }
763
-
764
- const {
765
- type,
766
- value
767
- } = obj[prop].fallback;
768
-
769
- if (type === 'static') {
770
- return value;
771
- }
772
-
773
- if (type === 'variable') {
774
- return `var(--rebilly-${value})`;
775
- }
776
-
777
- if (type === 'func') {
778
- return value(receiver);
779
- }
780
- }
781
-
782
- if (prop.endsWith('Provided')) {
783
- const target = prop.replace('Provided', '');
784
-
785
- if (target in obj) {
786
- return obj[target].isProvided;
787
- }
788
- }
789
-
790
- return undefined;
791
- },
792
-
793
- set: (obj, prop, value) => {
794
- if (!(prop in obj) || !value) {
795
- throw new Error(`Invalid theme option provided: ${prop}`);
796
- }
797
-
798
- obj[prop].value = value;
799
- obj[prop].isProvided = true;
800
- return true;
801
- }
802
- });
803
-
804
- exports.default = _default;