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