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