@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,804 @@
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;