@rebilly/instruments 4.5.0 → 4.6.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 (134) hide show
  1. package/.babelrc +24 -26
  2. package/CHANGELOG.md +7 -0
  3. package/dist/index.js +8 -8
  4. package/dist/index.min.js +8 -8
  5. package/package.json +14 -3
  6. package/project.json +9 -0
  7. package/rollup.config.mjs +21 -26
  8. package/src/data/options-schema/index.js +94 -78
  9. package/src/data/options-schema/schemas/options-schema.js +419 -411
  10. package/src/events/base-event.js +34 -34
  11. package/src/events/events.spec.js +6 -6
  12. package/src/events/index.js +5 -5
  13. package/src/functions/destroy.js +19 -19
  14. package/src/functions/destroy.spec.js +41 -41
  15. package/src/functions/mount/fetch-data.js +200 -193
  16. package/src/functions/mount/fetch-data.spec.js +287 -285
  17. package/src/functions/mount/get-lead-source-data.js +31 -31
  18. package/src/functions/mount/get-lead-source-data.spec.js +19 -19
  19. package/src/functions/mount/index.js +73 -65
  20. package/src/functions/mount/mount.spec.js +77 -66
  21. package/src/functions/mount/setup-element.js +23 -23
  22. package/src/functions/mount/setup-framepay-theme.js +86 -68
  23. package/src/functions/mount/setup-framepay.js +9 -5
  24. package/src/functions/mount/setup-i18n.js +15 -15
  25. package/src/functions/mount/setup-options.js +74 -74
  26. package/src/functions/mount/setup-options.spec.js +323 -287
  27. package/src/functions/mount/setup-storefront.js +15 -20
  28. package/src/functions/mount/setup-styles-vars.js +19 -22
  29. package/src/functions/mount/setup-user-flow.js +51 -47
  30. package/src/functions/on.js +5 -5
  31. package/src/functions/on.spec.js +60 -51
  32. package/src/functions/purchase.js +151 -146
  33. package/src/functions/purchase.spec.js +59 -56
  34. package/src/functions/setup.js +53 -53
  35. package/src/functions/setup.spec.js +88 -75
  36. package/src/functions/show.js +13 -14
  37. package/src/functions/show.spec.js +53 -53
  38. package/src/functions/update.js +30 -28
  39. package/src/functions/update.spec.js +94 -93
  40. package/src/i18n/en.json +32 -32
  41. package/src/i18n/es.json +29 -29
  42. package/src/i18n/i18n.spec.js +18 -18
  43. package/src/i18n/index.js +48 -48
  44. package/src/instance.js +36 -36
  45. package/src/instance.spec.js +29 -27
  46. package/src/loader/index.js +95 -70
  47. package/src/loader/loader.spec.js +63 -63
  48. package/src/state/iframes.js +21 -21
  49. package/src/state/index.js +56 -54
  50. package/src/storefront/account-and-website.js +10 -8
  51. package/src/storefront/account-and-website.spec.js +55 -55
  52. package/src/storefront/deposit-requests.js +6 -6
  53. package/src/storefront/fetch-plans-from-addons-bumpOffer.js +21 -19
  54. package/src/storefront/fetch-products-from-plans.js +52 -51
  55. package/src/storefront/fetch-products-from-plans.spec.js +90 -87
  56. package/src/storefront/index.js +56 -49
  57. package/src/storefront/invoices.js +15 -15
  58. package/src/storefront/invoices.spec.js +69 -65
  59. package/src/storefront/models/account-model.js +29 -32
  60. package/src/storefront/models/base-model.js +6 -9
  61. package/src/storefront/models/deposit-request-model.js +22 -13
  62. package/src/storefront/models/invoice-model.js +16 -16
  63. package/src/storefront/models/payment-metadata.js +4 -4
  64. package/src/storefront/models/plan-model.js +73 -64
  65. package/src/storefront/models/ready-to-pay-model.js +59 -59
  66. package/src/storefront/models/summary-model.js +43 -46
  67. package/src/storefront/models/transaction-model.js +11 -14
  68. package/src/storefront/payment-instruments.js +38 -35
  69. package/src/storefront/payment-instruments.spec.js +81 -62
  70. package/src/storefront/purchase.js +50 -44
  71. package/src/storefront/purchase.spec.js +40 -40
  72. package/src/storefront/ready-to-pay.js +75 -77
  73. package/src/storefront/ready-to-pay.spec.js +59 -54
  74. package/src/storefront/storefront.spec.js +9 -9
  75. package/src/storefront/summary.js +93 -67
  76. package/src/storefront/summary.spec.js +108 -106
  77. package/src/storefront/transactions.js +6 -6
  78. package/src/style/base/default-theme.js +928 -923
  79. package/src/style/base/theme.js +21 -21
  80. package/src/style/base/theme.spec.js +13 -13
  81. package/src/style/index.js +3 -3
  82. package/src/style/utils/border.js +40 -27
  83. package/src/style/utils/color-values.js +18 -18
  84. package/src/style/utils/minifyCss.js +6 -6
  85. package/src/utils/add-dom-element.js +14 -14
  86. package/src/utils/format-currency.js +6 -5
  87. package/src/utils/has-valid-css-selector.js +2 -2
  88. package/src/utils/index.js +6 -6
  89. package/src/utils/is-dom-element.js +1 -1
  90. package/src/utils/process-property-as-dom-element.js +22 -22
  91. package/src/utils/quantity.js +26 -28
  92. package/src/utils/sleep.js +3 -1
  93. package/src/views/amount-selector.js +37 -36
  94. package/src/views/common/iframe/base-iframe.js +53 -52
  95. package/src/views/common/iframe/events/change-iframe-src-handler.js +5 -5
  96. package/src/views/common/iframe/events/dispatch-event-handler.js +4 -4
  97. package/src/views/common/iframe/events/resize-component-handler.js +8 -8
  98. package/src/views/common/iframe/events/show-error-handler.js +2 -2
  99. package/src/views/common/iframe/events/stop-loader-handler.js +8 -8
  100. package/src/views/common/iframe/events/update-addons-handler.js +20 -13
  101. package/src/views/common/iframe/events/update-coupons-handler.js +9 -9
  102. package/src/views/common/iframe/events/update-items-handler.js +26 -22
  103. package/src/views/common/iframe/modal-iframe.js +67 -56
  104. package/src/views/common/iframe/view-iframe.js +11 -11
  105. package/src/views/common/render-utilities.js +2 -2
  106. package/src/views/confirmation.js +33 -30
  107. package/src/views/errors.js +89 -79
  108. package/src/views/form.js +41 -37
  109. package/src/views/method-selector/express-methods.js +46 -46
  110. package/src/views/method-selector/generate-digital-wallet.js +46 -45
  111. package/src/views/method-selector/generate-digital-wallet.spec.js +104 -102
  112. package/src/views/method-selector/generate-framepay-config.js +53 -51
  113. package/src/views/method-selector/generate-framepay-config.spec.js +197 -173
  114. package/src/views/method-selector/get-method-data.js +5 -6
  115. package/src/views/method-selector/get-payment-methods.js +18 -16
  116. package/src/views/method-selector/get-payment-methods.spec.js +29 -27
  117. package/src/views/method-selector/index.js +154 -139
  118. package/src/views/method-selector/method-selector.spec.js +13 -13
  119. package/src/views/method-selector/mount-bump-offer.js +65 -49
  120. package/src/views/method-selector/mount-express-methods.js +89 -85
  121. package/src/views/modal.js +74 -67
  122. package/src/views/result.js +14 -14
  123. package/src/views/summary.js +25 -26
  124. package/tests/async-utilities.js +13 -13
  125. package/tests/mocks/framepay-mock.js +9 -8
  126. package/tests/mocks/rebilly-api-mock.js +5 -3
  127. package/tests/mocks/rebilly-instruments-mock.js +121 -117
  128. package/tests/mocks/storefront-api-mock.js +55 -48
  129. package/tests/mocks/storefront-mock.js +10 -14
  130. package/tests/msw/server.js +6 -6
  131. package/tests/setup-test.js +14 -16
  132. package/vitest.config.js +14 -14
  133. package/.eslintrc.js +0 -34
  134. package/.prettierrc.js +0 -11
@@ -1,950 +1,955 @@
1
- import { mutedTextColor, darken, mutedBorderColor } from '../utils/color-values';
1
+ import {
2
+ mutedTextColor,
3
+ darken,
4
+ mutedBorderColor,
5
+ } from '../utils/color-values';
2
6
  import Border from '../utils/border';
3
7
 
4
8
  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, 60)
28
- }
29
- },
30
- colorMutedBorder: {
31
- fallback: {
32
- type: 'func',
33
- value: theme => {
34
- if(theme.colorTextProvided) {
35
- return mutedBorderColor(theme.colorText);
36
- }
37
- return '#DCE3EA';
38
- }
39
- }
40
- },
41
- colorDanger: {
42
- fallback: {
43
- type: 'static',
44
- value: '#CD5C5C',
45
- }
46
- },
9
+ /** Base Colors */
10
+ colorPrimary: {
11
+ fallback: {
12
+ type: 'static',
13
+ value: '#0044D4',
14
+ },
15
+ },
16
+ colorBackground: {
17
+ fallback: {
18
+ type: 'static',
19
+ value: '#FFFFFF',
20
+ },
21
+ },
22
+ colorText: {
23
+ fallback: {
24
+ type: 'static',
25
+ value: '#0D2B3E',
26
+ },
27
+ },
28
+ colorMutedText: {
29
+ fallback: {
30
+ type: 'func',
31
+ value: (theme) => mutedTextColor(theme.colorText, 60),
32
+ },
33
+ },
34
+ colorMutedBorder: {
35
+ fallback: {
36
+ type: 'func',
37
+ value: (theme) => {
38
+ if (theme.colorTextProvided) {
39
+ return mutedBorderColor(theme.colorText);
40
+ }
41
+ return '#DCE3EA';
42
+ },
43
+ },
44
+ },
45
+ colorDanger: {
46
+ fallback: {
47
+ type: 'static',
48
+ value: '#CD5C5C',
49
+ },
50
+ },
47
51
 
48
- /** Base Fonts */
49
- fontFamily: {
50
- fallback: {
51
- type: 'static',
52
- value: "-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial sans-serif",
53
- }
54
- },
55
- fontSizeBase: {
56
- fallback: {
57
- type: 'static',
58
- value: '16px',
59
- }
60
- },
61
- fontWeightBase: {
62
- fallback: {
63
- type: 'static',
64
- value: '500',
65
- }
66
- },
67
- fontLineHeightBase: {
68
- fallback: {
69
- type: 'func',
70
- value: theme => `calc(${theme.fontSizeBase} * 1.5)`,
71
- }
72
- },
73
- fontSmooth: {
74
- fallback: {
75
- type: 'static',
76
- value: 'auto',
77
- }
78
- },
52
+ /** Base Fonts */
53
+ fontFamily: {
54
+ fallback: {
55
+ type: 'static',
56
+ value: "-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial sans-serif",
57
+ },
58
+ },
59
+ fontSizeBase: {
60
+ fallback: {
61
+ type: 'static',
62
+ value: '16px',
63
+ },
64
+ },
65
+ fontWeightBase: {
66
+ fallback: {
67
+ type: 'static',
68
+ value: '500',
69
+ },
70
+ },
71
+ fontLineHeightBase: {
72
+ fallback: {
73
+ type: 'func',
74
+ value: (theme) => `calc(${theme.fontSizeBase} * 1.5)`,
75
+ },
76
+ },
77
+ fontSmooth: {
78
+ fallback: {
79
+ type: 'static',
80
+ value: 'auto',
81
+ },
82
+ },
79
83
 
80
- /** Misc */
81
- borderRadius: {
82
- fallback: {
83
- type: 'static',
84
- value: '6px',
85
- }
86
- },
84
+ /** Misc */
85
+ borderRadius: {
86
+ fallback: {
87
+ type: 'static',
88
+ value: '6px',
89
+ },
90
+ },
87
91
 
88
- /** Headings */
89
- headingFontFamily: {
90
- fallback: {
91
- type: 'variable',
92
- value: 'fontFamily',
93
- }
94
- },
95
- headingFontWeight: {
96
- fallback: {
97
- type: 'static',
98
- value: '600',
99
- }
100
- },
101
- headingColorText: {
102
- fallback: {
103
- type: 'variable',
104
- value: 'colorText',
105
- }
106
- },
92
+ /** Headings */
93
+ headingFontFamily: {
94
+ fallback: {
95
+ type: 'variable',
96
+ value: 'fontFamily',
97
+ },
98
+ },
99
+ headingFontWeight: {
100
+ fallback: {
101
+ type: 'static',
102
+ value: '600',
103
+ },
104
+ },
105
+ headingColorText: {
106
+ fallback: {
107
+ type: 'variable',
108
+ value: 'colorText',
109
+ },
110
+ },
107
111
 
108
- /** Buttons */
109
- buttonColorBackground: {
110
- fallback: {
111
- type: 'variable',
112
- value: 'colorPrimary',
113
- }
114
- },
115
- buttonColorText: {
116
- fallback: {
117
- type: 'static',
118
- value: '#FFFFFF',
119
- }
120
- },
121
- buttonFontFamily: {
122
- fallback: {
123
- type: 'variable',
124
- value: 'fontFamily',
125
- }
126
- },
127
- buttonFontSize: {
128
- fallback: {
129
- type: 'variable',
130
- value: 'fontSizeBase',
131
- }
132
- },
133
- buttonFontLineHeight: {
134
- fallback: {
135
- type: 'variable',
136
- value: 'fontLineHeightBase',
137
- }
138
- },
139
- buttonFontWeight: {
140
- fallback: {
141
- type: 'variable',
142
- value: 'fontWeightBase',
143
- }
144
- },
145
- buttonBorder: {
146
- fallback: {
147
- type: 'static',
148
- value: '1px solid transparent',
149
- }
150
- },
151
- buttonBorderRadius: {
152
- fallback: {
153
- type: 'variable',
154
- value: 'borderRadius',
155
- }
156
- },
157
- buttonBoxShadow: {
158
- fallback: {
159
- type: 'static',
160
- value: 'none',
161
- }
162
- },
112
+ /** Buttons */
113
+ buttonColorBackground: {
114
+ fallback: {
115
+ type: 'variable',
116
+ value: 'colorPrimary',
117
+ },
118
+ },
119
+ buttonColorText: {
120
+ fallback: {
121
+ type: 'static',
122
+ value: '#FFFFFF',
123
+ },
124
+ },
125
+ buttonFontFamily: {
126
+ fallback: {
127
+ type: 'variable',
128
+ value: 'fontFamily',
129
+ },
130
+ },
131
+ buttonFontSize: {
132
+ fallback: {
133
+ type: 'variable',
134
+ value: 'fontSizeBase',
135
+ },
136
+ },
137
+ buttonFontLineHeight: {
138
+ fallback: {
139
+ type: 'variable',
140
+ value: 'fontLineHeightBase',
141
+ },
142
+ },
143
+ buttonFontWeight: {
144
+ fallback: {
145
+ type: 'variable',
146
+ value: 'fontWeightBase',
147
+ },
148
+ },
149
+ buttonBorder: {
150
+ fallback: {
151
+ type: 'static',
152
+ value: '1px solid transparent',
153
+ },
154
+ },
155
+ buttonBorderRadius: {
156
+ fallback: {
157
+ type: 'variable',
158
+ value: 'borderRadius',
159
+ },
160
+ },
161
+ buttonBoxShadow: {
162
+ fallback: {
163
+ type: 'static',
164
+ value: 'none',
165
+ },
166
+ },
163
167
 
164
- /** Buttons Secondary */
165
- buttonSecondaryColorBackground: {
166
- fallback: {
167
- type: 'variable',
168
- value: 'colorBackground',
169
- }
170
- },
171
- buttonSecondaryColorText: {
172
- fallback: {
173
- type: 'variable',
174
- value: 'colorPrimary',
175
- }
176
- },
177
- buttonSecondaryFontFamily: {
178
- fallback: {
179
- type: 'variable',
180
- value: 'fontFamily',
181
- }
182
- },
183
- buttonSecondaryFontSize: {
184
- fallback: {
185
- type: 'variable',
186
- value: 'fontSizeBase',
187
- }
188
- },
189
- buttonSecondaryFontLineHeight: {
190
- fallback: {
191
- type: 'variable',
192
- value: 'fontLineHeightBase',
193
- }
194
- },
195
- buttonSecondaryFontWeight: {
196
- fallback: {
197
- type: 'variable',
198
- value: 'fontWeightBase',
199
- }
200
- },
201
- buttonSecondaryBorder: {
202
- fallback: {
203
- type: 'func',
204
- value: theme => `1px solid ${theme.colorPrimary}`,
205
- }
206
- },
207
- buttonSecondaryBorderRadius: {
208
- fallback: {
209
- type: 'variable',
210
- value: 'borderRadius',
211
- }
212
- },
213
- buttonSecondaryBoxShadow: {
214
- fallback: {
215
- type: 'static',
216
- value: 'none',
217
- }
218
- },
168
+ /** Buttons Secondary */
169
+ buttonSecondaryColorBackground: {
170
+ fallback: {
171
+ type: 'variable',
172
+ value: 'colorBackground',
173
+ },
174
+ },
175
+ buttonSecondaryColorText: {
176
+ fallback: {
177
+ type: 'variable',
178
+ value: 'colorPrimary',
179
+ },
180
+ },
181
+ buttonSecondaryFontFamily: {
182
+ fallback: {
183
+ type: 'variable',
184
+ value: 'fontFamily',
185
+ },
186
+ },
187
+ buttonSecondaryFontSize: {
188
+ fallback: {
189
+ type: 'variable',
190
+ value: 'fontSizeBase',
191
+ },
192
+ },
193
+ buttonSecondaryFontLineHeight: {
194
+ fallback: {
195
+ type: 'variable',
196
+ value: 'fontLineHeightBase',
197
+ },
198
+ },
199
+ buttonSecondaryFontWeight: {
200
+ fallback: {
201
+ type: 'variable',
202
+ value: 'fontWeightBase',
203
+ },
204
+ },
205
+ buttonSecondaryBorder: {
206
+ fallback: {
207
+ type: 'func',
208
+ value: (theme) => `1px solid ${theme.colorPrimary}`,
209
+ },
210
+ },
211
+ buttonSecondaryBorderRadius: {
212
+ fallback: {
213
+ type: 'variable',
214
+ value: 'borderRadius',
215
+ },
216
+ },
217
+ buttonSecondaryBoxShadow: {
218
+ fallback: {
219
+ type: 'static',
220
+ value: 'none',
221
+ },
222
+ },
219
223
 
220
- /** Buttons: Hover */
221
- buttonHoverColorBackground: {
222
- fallback: {
223
- type: 'func',
224
- value: theme => {
225
- if(theme.buttonColorBackgroundProvided) {
226
- return darken(theme.buttonColorBackground, 20);
227
- }
228
- return darken(theme.colorPrimary, 20);
229
- }
230
- }
231
- },
232
- buttonHoverColorText: {
233
- fallback: {
234
- type: 'variable',
235
- value: 'buttonColorText',
236
- }
237
- },
238
- buttonHoverFontFamily: {
239
- fallback: {
240
- type: 'variable',
241
- value: 'buttonFontFamily',
242
- }
243
- },
244
- buttonHoverFontSize: {
245
- fallback: {
246
- type: 'variable',
247
- value: 'buttonFontSize',
248
- }
249
- },
250
- buttonHoverFontLineHeight: {
251
- fallback: {
252
- type: 'variable',
253
- value: 'buttonFontLineHeight',
254
- }
255
- },
256
- buttonHoverFontWeight: {
257
- fallback: {
258
- type: 'variable',
259
- value: 'buttonFontWeight',
260
- }
261
- },
262
- buttonHoverBorder: {
263
- fallback: {
264
- type: 'func',
265
- value: theme => {
266
- if(theme.buttonBorderProvided) {
267
- return theme.buttonBorder;
268
- }
269
- const buttonBorder = new Border(theme.buttonBorder);
270
- return buttonBorder.updateColor(theme.buttonHoverColorBackground).value;
271
- }
272
- }
273
- },
274
- buttonHoverBorderRadius: {
275
- fallback: {
276
- type: 'variable',
277
- value: 'buttonBorderRadius',
278
- }
279
- },
280
- buttonHoverBoxShadow: {
281
- fallback: {
282
- type: 'variable',
283
- value: 'buttonBoxShadow',
284
- }
285
- },
224
+ /** Buttons: Hover */
225
+ buttonHoverColorBackground: {
226
+ fallback: {
227
+ type: 'func',
228
+ value: (theme) => {
229
+ if (theme.buttonColorBackgroundProvided) {
230
+ return darken(theme.buttonColorBackground, 20);
231
+ }
232
+ return darken(theme.colorPrimary, 20);
233
+ },
234
+ },
235
+ },
236
+ buttonHoverColorText: {
237
+ fallback: {
238
+ type: 'variable',
239
+ value: 'buttonColorText',
240
+ },
241
+ },
242
+ buttonHoverFontFamily: {
243
+ fallback: {
244
+ type: 'variable',
245
+ value: 'buttonFontFamily',
246
+ },
247
+ },
248
+ buttonHoverFontSize: {
249
+ fallback: {
250
+ type: 'variable',
251
+ value: 'buttonFontSize',
252
+ },
253
+ },
254
+ buttonHoverFontLineHeight: {
255
+ fallback: {
256
+ type: 'variable',
257
+ value: 'buttonFontLineHeight',
258
+ },
259
+ },
260
+ buttonHoverFontWeight: {
261
+ fallback: {
262
+ type: 'variable',
263
+ value: 'buttonFontWeight',
264
+ },
265
+ },
266
+ buttonHoverBorder: {
267
+ fallback: {
268
+ type: 'func',
269
+ value: (theme) => {
270
+ if (theme.buttonBorderProvided) {
271
+ return theme.buttonBorder;
272
+ }
273
+ const buttonBorder = new Border(theme.buttonBorder);
274
+ return buttonBorder.updateColor(
275
+ theme.buttonHoverColorBackground,
276
+ ).value;
277
+ },
278
+ },
279
+ },
280
+ buttonHoverBorderRadius: {
281
+ fallback: {
282
+ type: 'variable',
283
+ value: 'buttonBorderRadius',
284
+ },
285
+ },
286
+ buttonHoverBoxShadow: {
287
+ fallback: {
288
+ type: 'variable',
289
+ value: 'buttonBoxShadow',
290
+ },
291
+ },
286
292
 
287
- /** Buttons Secondary: Hover */
288
- buttonSecondaryHoverColorBackground: {
289
- fallback: {
290
- type: 'variable',
291
- value: 'colorBackground'
292
- }
293
- },
294
- buttonSecondaryHoverColorText: {
295
- fallback: {
296
- type: 'variable',
297
- value: 'buttonSecondaryColorText',
298
- }
299
- },
300
- buttonSecondaryHoverFontFamily: {
301
- fallback: {
302
- type: 'variable',
303
- value: 'buttonSecondaryFontFamily',
304
- }
305
- },
306
- buttonSecondaryHoverFontSize: {
307
- fallback: {
308
- type: 'variable',
309
- value: 'buttonSecondaryFontSize',
310
- }
311
- },
312
- buttonSecondaryHoverFontLineHeight: {
313
- fallback: {
314
- type: 'variable',
315
- value: 'buttonSecondaryFontLineHeight',
316
- }
317
- },
318
- buttonSecondaryHoverFontWeight: {
319
- fallback: {
320
- type: 'variable',
321
- value: 'buttonSecondaryFontWeight',
322
- }
323
- },
324
- buttonSecondaryHoverBorder: {
325
- fallback: {
326
- type: 'variable',
327
- value: 'buttonSecondaryBorder',
328
- }
329
- },
330
- buttonSecondaryHoverBorderRadius: {
331
- fallback: {
332
- type: 'variable',
333
- value: 'buttonSecondaryBorderRadius',
334
- }
335
- },
336
- buttonSecondaryHoverBoxShadow: {
337
- fallback: {
338
- type: 'variable',
339
- value: 'buttonSecondaryBoxShadow',
340
- }
341
- },
342
-
343
- /** Buttons: Active */
344
- buttonActiveColorBackground: {
345
- fallback: {
346
- type: 'variable',
347
- value: 'buttonHoverColorBackground',
348
- }
349
- },
350
- buttonActiveColorText: {
351
- fallback: {
352
- type: 'variable',
353
- value: 'buttonHoverColorText',
354
- }
355
- },
356
- buttonActiveFontFamily: {
357
- fallback: {
358
- type: 'variable',
359
- value: 'buttonHoverFontFamily',
360
- }
361
- },
362
- buttonActiveFontSize: {
363
- fallback: {
364
- type: 'variable',
365
- value: 'buttonHoverFontSize',
366
- }
367
- },
368
- buttonActiveFontLineHeight: {
369
- fallback: {
370
- type: 'variable',
371
- value: 'buttonHoverFontLineHeight',
372
- }
373
- },
374
- buttonActiveFontWeight: {
375
- fallback: {
376
- type: 'variable',
377
- value: 'buttonHoverFontWeight',
378
- }
379
- },
380
- buttonActiveBorder: {
381
- fallback: {
382
- type: 'variable',
383
- value: 'buttonHoverBorder'
384
- }
385
- },
386
- buttonActiveBorderRadius: {
387
- fallback: {
388
- type: 'variable',
389
- value: 'buttonHoverBorderRadius',
390
- }
391
- },
392
- buttonActiveBoxShadow: {
393
- fallback: {
394
- type: 'variable',
395
- value: 'buttonHoverBoxShadow',
396
- }
397
- },
293
+ /** Buttons Secondary: Hover */
294
+ buttonSecondaryHoverColorBackground: {
295
+ fallback: {
296
+ type: 'variable',
297
+ value: 'colorBackground',
298
+ },
299
+ },
300
+ buttonSecondaryHoverColorText: {
301
+ fallback: {
302
+ type: 'variable',
303
+ value: 'buttonSecondaryColorText',
304
+ },
305
+ },
306
+ buttonSecondaryHoverFontFamily: {
307
+ fallback: {
308
+ type: 'variable',
309
+ value: 'buttonSecondaryFontFamily',
310
+ },
311
+ },
312
+ buttonSecondaryHoverFontSize: {
313
+ fallback: {
314
+ type: 'variable',
315
+ value: 'buttonSecondaryFontSize',
316
+ },
317
+ },
318
+ buttonSecondaryHoverFontLineHeight: {
319
+ fallback: {
320
+ type: 'variable',
321
+ value: 'buttonSecondaryFontLineHeight',
322
+ },
323
+ },
324
+ buttonSecondaryHoverFontWeight: {
325
+ fallback: {
326
+ type: 'variable',
327
+ value: 'buttonSecondaryFontWeight',
328
+ },
329
+ },
330
+ buttonSecondaryHoverBorder: {
331
+ fallback: {
332
+ type: 'variable',
333
+ value: 'buttonSecondaryBorder',
334
+ },
335
+ },
336
+ buttonSecondaryHoverBorderRadius: {
337
+ fallback: {
338
+ type: 'variable',
339
+ value: 'buttonSecondaryBorderRadius',
340
+ },
341
+ },
342
+ buttonSecondaryHoverBoxShadow: {
343
+ fallback: {
344
+ type: 'variable',
345
+ value: 'buttonSecondaryBoxShadow',
346
+ },
347
+ },
398
348
 
399
- /** Buttons Secondary: Active */
400
- buttonSecondaryActiveColorBackground: {
401
- fallback: {
402
- type: 'variable',
403
- value: 'buttonSecondaryHoverColorBackground',
404
- }
405
- },
406
- buttonSecondaryActiveColorText: {
407
- fallback: {
408
- type: 'variable',
409
- value: 'buttonSecondaryHoverColorText',
410
- }
411
- },
412
- buttonSecondaryActiveFontFamily: {
413
- fallback: {
414
- type: 'variable',
415
- value: 'buttonSecondaryHoverFontFamily',
416
- }
417
- },
418
- buttonSecondaryActiveFontSize: {
419
- fallback: {
420
- type: 'variable',
421
- value: 'buttonSecondaryHoverFontSize',
422
- }
423
- },
424
- buttonSecondaryActiveFontLineHeight: {
425
- fallback: {
426
- type: 'variable',
427
- value: 'buttonSecondaryHoverFontLineHeight',
428
- }
429
- },
430
- buttonSecondaryActiveFontWeight: {
431
- fallback: {
432
- type: 'variable',
433
- value: 'buttonSecondaryHoverFontWeight',
434
- }
435
- },
436
- buttonSecondaryActiveBorder: {
437
- fallback: {
438
- type: 'variable',
439
- value: 'buttonSecondaryHoverBorder'
440
- }
441
- },
442
- buttonSecondaryActiveBorderRadius: {
443
- fallback: {
444
- type: 'variable',
445
- value: 'buttonSecondaryHoverBorderRadius',
446
- }
447
- },
448
- buttonSecondaryActiveBoxShadow: {
449
- fallback: {
450
- type: 'variable',
451
- value: 'buttonSecondaryHoverBoxShadow',
452
- }
453
- },
349
+ /** Buttons: Active */
350
+ buttonActiveColorBackground: {
351
+ fallback: {
352
+ type: 'variable',
353
+ value: 'buttonHoverColorBackground',
354
+ },
355
+ },
356
+ buttonActiveColorText: {
357
+ fallback: {
358
+ type: 'variable',
359
+ value: 'buttonHoverColorText',
360
+ },
361
+ },
362
+ buttonActiveFontFamily: {
363
+ fallback: {
364
+ type: 'variable',
365
+ value: 'buttonHoverFontFamily',
366
+ },
367
+ },
368
+ buttonActiveFontSize: {
369
+ fallback: {
370
+ type: 'variable',
371
+ value: 'buttonHoverFontSize',
372
+ },
373
+ },
374
+ buttonActiveFontLineHeight: {
375
+ fallback: {
376
+ type: 'variable',
377
+ value: 'buttonHoverFontLineHeight',
378
+ },
379
+ },
380
+ buttonActiveFontWeight: {
381
+ fallback: {
382
+ type: 'variable',
383
+ value: 'buttonHoverFontWeight',
384
+ },
385
+ },
386
+ buttonActiveBorder: {
387
+ fallback: {
388
+ type: 'variable',
389
+ value: 'buttonHoverBorder',
390
+ },
391
+ },
392
+ buttonActiveBorderRadius: {
393
+ fallback: {
394
+ type: 'variable',
395
+ value: 'buttonHoverBorderRadius',
396
+ },
397
+ },
398
+ buttonActiveBoxShadow: {
399
+ fallback: {
400
+ type: 'variable',
401
+ value: 'buttonHoverBoxShadow',
402
+ },
403
+ },
454
404
 
455
- /** Inputs: Base */
456
- inputColorBackground: {
457
- fallback: {
458
- type: 'static',
459
- value: 'transparent',
460
- }
461
- },
462
- inputColorText: {
463
- fallback: {
464
- type: 'variable',
465
- value: 'colorText'
466
- }
467
- },
468
- inputFontFamily: {
469
- fallback: {
470
- type: 'variable',
471
- value: 'fontFamily',
472
- }
473
- },
474
- inputFontSize: {
475
- fallback: {
476
- type: 'variable',
477
- value: 'fontSizeBase',
478
- }
479
- },
480
- inputFontLineHeight: {
481
- fallback: {
482
- type: 'variable',
483
- value: 'fontLineHeightBase',
484
- }
485
- },
486
- inputFontWeight: {
487
- fallback: {
488
- type: 'variable',
489
- value: 'fontWeightBase',
490
- }
491
- },
492
- inputBorder: {
493
- fallback: {
494
- type: 'func',
495
- value: theme => `1px solid ${darken(theme.colorMutedBorder, 4)}`
496
- }
497
- },
498
- inputBorderRadius: {
499
- fallback: {
500
- type: 'variable',
501
- value: 'borderRadius',
502
- }
503
- },
504
- inputBoxShadow: {
505
- fallback: {
506
- type: 'static',
507
- value: 'none',
508
- }
509
- },
405
+ /** Buttons Secondary: Active */
406
+ buttonSecondaryActiveColorBackground: {
407
+ fallback: {
408
+ type: 'variable',
409
+ value: 'buttonSecondaryHoverColorBackground',
410
+ },
411
+ },
412
+ buttonSecondaryActiveColorText: {
413
+ fallback: {
414
+ type: 'variable',
415
+ value: 'buttonSecondaryHoverColorText',
416
+ },
417
+ },
418
+ buttonSecondaryActiveFontFamily: {
419
+ fallback: {
420
+ type: 'variable',
421
+ value: 'buttonSecondaryHoverFontFamily',
422
+ },
423
+ },
424
+ buttonSecondaryActiveFontSize: {
425
+ fallback: {
426
+ type: 'variable',
427
+ value: 'buttonSecondaryHoverFontSize',
428
+ },
429
+ },
430
+ buttonSecondaryActiveFontLineHeight: {
431
+ fallback: {
432
+ type: 'variable',
433
+ value: 'buttonSecondaryHoverFontLineHeight',
434
+ },
435
+ },
436
+ buttonSecondaryActiveFontWeight: {
437
+ fallback: {
438
+ type: 'variable',
439
+ value: 'buttonSecondaryHoverFontWeight',
440
+ },
441
+ },
442
+ buttonSecondaryActiveBorder: {
443
+ fallback: {
444
+ type: 'variable',
445
+ value: 'buttonSecondaryHoverBorder',
446
+ },
447
+ },
448
+ buttonSecondaryActiveBorderRadius: {
449
+ fallback: {
450
+ type: 'variable',
451
+ value: 'buttonSecondaryHoverBorderRadius',
452
+ },
453
+ },
454
+ buttonSecondaryActiveBoxShadow: {
455
+ fallback: {
456
+ type: 'variable',
457
+ value: 'buttonSecondaryHoverBoxShadow',
458
+ },
459
+ },
510
460
 
511
- /** Inputs: Hover */
512
- inputHoverColorBackground: {
513
- fallback: {
514
- type: 'variable',
515
- value: 'inputColorBackground',
516
- }
517
- },
518
- inputHoverColorText: {
519
- fallback: {
520
- type: 'variable',
521
- value: 'inputColorText'
522
- }
523
- },
524
- inputHoverFontFamily: {
525
- fallback: {
526
- type: 'variable',
527
- value: 'inputFontFamily',
528
- }
529
- },
530
- inputHoverFontSize: {
531
- fallback: {
532
- type: 'variable',
533
- value: 'inputFontSize',
534
- }
535
- },
536
- inputHoverFontLineHeight: {
537
- fallback: {
538
- type: 'variable',
539
- value: 'inputFontLineHeight',
540
- }
541
- },
542
- inputHoverFontWeight: {
543
- fallback: {
544
- type: 'variable',
545
- value: 'inputFontWeight',
546
- }
547
- },
548
- inputHoverBorder: {
549
- fallback: {
550
- type: 'variable',
551
- value: 'inputBorder',
552
- }
553
- },
554
- inputHoverBorderRadius: {
555
- fallback: {
556
- type: 'variable',
557
- value: 'inputBorderRadius',
558
- }
559
- },
560
- inputHoverBoxShadow: {
561
- fallback: {
562
- type: 'variable',
563
- value: 'inputBoxShadow',
564
- }
565
- },
461
+ /** Inputs: Base */
462
+ inputColorBackground: {
463
+ fallback: {
464
+ type: 'static',
465
+ value: 'transparent',
466
+ },
467
+ },
468
+ inputColorText: {
469
+ fallback: {
470
+ type: 'variable',
471
+ value: 'colorText',
472
+ },
473
+ },
474
+ inputFontFamily: {
475
+ fallback: {
476
+ type: 'variable',
477
+ value: 'fontFamily',
478
+ },
479
+ },
480
+ inputFontSize: {
481
+ fallback: {
482
+ type: 'variable',
483
+ value: 'fontSizeBase',
484
+ },
485
+ },
486
+ inputFontLineHeight: {
487
+ fallback: {
488
+ type: 'variable',
489
+ value: 'fontLineHeightBase',
490
+ },
491
+ },
492
+ inputFontWeight: {
493
+ fallback: {
494
+ type: 'variable',
495
+ value: 'fontWeightBase',
496
+ },
497
+ },
498
+ inputBorder: {
499
+ fallback: {
500
+ type: 'func',
501
+ value: (theme) => `1px solid ${darken(theme.colorMutedBorder, 4)}`,
502
+ },
503
+ },
504
+ inputBorderRadius: {
505
+ fallback: {
506
+ type: 'variable',
507
+ value: 'borderRadius',
508
+ },
509
+ },
510
+ inputBoxShadow: {
511
+ fallback: {
512
+ type: 'static',
513
+ value: 'none',
514
+ },
515
+ },
566
516
 
567
- /** Inputs: Focus */
568
- inputFocusColorBackground: {
569
- fallback: {
570
- type: 'variable',
571
- value: 'inputHoverColorBackground',
572
- }
573
- },
574
- inputFocusColorText: {
575
- fallback: {
576
- type: 'variable',
577
- value: 'inputHoverColorText'
578
- }
579
- },
580
- inputFocusFontFamily: {
581
- fallback: {
582
- type: 'variable',
583
- value: 'inputHoverFontFamily',
584
- }
585
- },
586
- inputFocusFontSize: {
587
- fallback: {
588
- type: 'variable',
589
- value: 'inputHoverFontSize',
590
- }
591
- },
592
- inputFocusFontLineHeight: {
593
- fallback: {
594
- type: 'variable',
595
- value: 'inputHoverFontLineHeight',
596
- }
597
- },
598
- inputFocusFontWeight: {
599
- fallback: {
600
- type: 'variable',
601
- value: 'inputHoverFontWeight',
602
- }
603
- },
604
- inputFocusBorder: {
605
- fallback: {
606
- type: 'func',
607
- value: theme => {
608
- if(theme.inputHoverBorderProvided) {
609
- return theme.inputHoverBorder;
610
- }
611
- const inputBorder = new Border(theme.inputBorder);
612
- return inputBorder.updateColor(theme.colorPrimary).value;
613
- }
614
- }
615
- },
616
- inputFocusBorderRadius: {
617
- fallback: {
618
- type: 'variable',
619
- value: 'inputHoverBorderRadius',
620
- }
621
- },
622
- inputFocusBoxShadow: {
623
- fallback: {
624
- type: 'func',
625
- value: theme => `0 0 0 1px ${theme.colorPrimary}`,
626
- }
627
- },
517
+ /** Inputs: Hover */
518
+ inputHoverColorBackground: {
519
+ fallback: {
520
+ type: 'variable',
521
+ value: 'inputColorBackground',
522
+ },
523
+ },
524
+ inputHoverColorText: {
525
+ fallback: {
526
+ type: 'variable',
527
+ value: 'inputColorText',
528
+ },
529
+ },
530
+ inputHoverFontFamily: {
531
+ fallback: {
532
+ type: 'variable',
533
+ value: 'inputFontFamily',
534
+ },
535
+ },
536
+ inputHoverFontSize: {
537
+ fallback: {
538
+ type: 'variable',
539
+ value: 'inputFontSize',
540
+ },
541
+ },
542
+ inputHoverFontLineHeight: {
543
+ fallback: {
544
+ type: 'variable',
545
+ value: 'inputFontLineHeight',
546
+ },
547
+ },
548
+ inputHoverFontWeight: {
549
+ fallback: {
550
+ type: 'variable',
551
+ value: 'inputFontWeight',
552
+ },
553
+ },
554
+ inputHoverBorder: {
555
+ fallback: {
556
+ type: 'variable',
557
+ value: 'inputBorder',
558
+ },
559
+ },
560
+ inputHoverBorderRadius: {
561
+ fallback: {
562
+ type: 'variable',
563
+ value: 'inputBorderRadius',
564
+ },
565
+ },
566
+ inputHoverBoxShadow: {
567
+ fallback: {
568
+ type: 'variable',
569
+ value: 'inputBoxShadow',
570
+ },
571
+ },
628
572
 
629
- /** Inputs: Placholder */
630
- inputPlaceholderColorText: {
631
- fallback: {
632
- type: 'func',
633
- value: theme => {
634
- if(theme.inputColorTextProvided) {
635
- return mutedTextColor(theme.inputColorText);
636
- }
637
- return theme.colorMutedText;
638
- }
639
- }
640
- },
641
- inputPlaceholderFontFamily: {
642
- fallback: {
643
- type: 'variable',
644
- value: 'inputFontFamily',
645
- }
646
- },
647
- inputPlaceholderFontSize: {
648
- fallback: {
649
- type: 'variable',
650
- value: 'inputFontSize',
651
- }
652
- },
653
- inputPlaceholderFontLineHeight: {
654
- fallback: {
655
- type: 'variable',
656
- value: 'inputFontLineHeight',
657
- }
658
- },
659
- inputPlaceholderFontWeight: {
660
- fallback: {
661
- type: 'variable',
662
- value: 'inputFontWeight',
663
- }
664
- },
573
+ /** Inputs: Focus */
574
+ inputFocusColorBackground: {
575
+ fallback: {
576
+ type: 'variable',
577
+ value: 'inputHoverColorBackground',
578
+ },
579
+ },
580
+ inputFocusColorText: {
581
+ fallback: {
582
+ type: 'variable',
583
+ value: 'inputHoverColorText',
584
+ },
585
+ },
586
+ inputFocusFontFamily: {
587
+ fallback: {
588
+ type: 'variable',
589
+ value: 'inputHoverFontFamily',
590
+ },
591
+ },
592
+ inputFocusFontSize: {
593
+ fallback: {
594
+ type: 'variable',
595
+ value: 'inputHoverFontSize',
596
+ },
597
+ },
598
+ inputFocusFontLineHeight: {
599
+ fallback: {
600
+ type: 'variable',
601
+ value: 'inputHoverFontLineHeight',
602
+ },
603
+ },
604
+ inputFocusFontWeight: {
605
+ fallback: {
606
+ type: 'variable',
607
+ value: 'inputHoverFontWeight',
608
+ },
609
+ },
610
+ inputFocusBorder: {
611
+ fallback: {
612
+ type: 'func',
613
+ value: (theme) => {
614
+ if (theme.inputHoverBorderProvided) {
615
+ return theme.inputHoverBorder;
616
+ }
617
+ const inputBorder = new Border(theme.inputBorder);
618
+ return inputBorder.updateColor(theme.colorPrimary).value;
619
+ },
620
+ },
621
+ },
622
+ inputFocusBorderRadius: {
623
+ fallback: {
624
+ type: 'variable',
625
+ value: 'inputHoverBorderRadius',
626
+ },
627
+ },
628
+ inputFocusBoxShadow: {
629
+ fallback: {
630
+ type: 'func',
631
+ value: (theme) => `0 0 0 1px ${theme.colorPrimary}`,
632
+ },
633
+ },
665
634
 
666
- /** Inputs: Selection */
667
- inputSelectionColorText: {
668
- fallback: {
669
- type: 'static',
670
- value: 'initial',
671
- }
672
- },
673
- inputSelectionColorBackground: {
674
- fallback: {
675
- type: 'static',
676
- value: 'highlight',
677
- }
678
- },
635
+ /** Inputs: Placholder */
636
+ inputPlaceholderColorText: {
637
+ fallback: {
638
+ type: 'func',
639
+ value: (theme) => {
640
+ if (theme.inputColorTextProvided) {
641
+ return mutedTextColor(theme.inputColorText);
642
+ }
643
+ return theme.colorMutedText;
644
+ },
645
+ },
646
+ },
647
+ inputPlaceholderFontFamily: {
648
+ fallback: {
649
+ type: 'variable',
650
+ value: 'inputFontFamily',
651
+ },
652
+ },
653
+ inputPlaceholderFontSize: {
654
+ fallback: {
655
+ type: 'variable',
656
+ value: 'inputFontSize',
657
+ },
658
+ },
659
+ inputPlaceholderFontLineHeight: {
660
+ fallback: {
661
+ type: 'variable',
662
+ value: 'inputFontLineHeight',
663
+ },
664
+ },
665
+ inputPlaceholderFontWeight: {
666
+ fallback: {
667
+ type: 'variable',
668
+ value: 'inputFontWeight',
669
+ },
670
+ },
679
671
 
680
- /** Inputs Error */
681
- inputErrorColorBackground: {
682
- fallback: {
683
- type: 'variable',
684
- value: 'inputColorBackground',
685
- }
686
- },
687
- inputErrorColorText: {
688
- fallback: {
689
- type: 'variable',
690
- value: 'colorDanger'
691
- }
692
- },
693
- inputErrorFontFamily: {
694
- fallback: {
695
- type: 'variable',
696
- value: 'inputFontFamily',
697
- }
698
- },
699
- inputErrorFontSize: {
700
- fallback: {
701
- type: 'variable',
702
- value: 'inputFontSize',
703
- }
704
- },
705
- inputErrorFontLineHeight: {
706
- fallback: {
707
- type: 'variable',
708
- value: 'inputFontLineHeight',
709
- }
710
- },
711
- inputErrorFontWeight: {
712
- fallback: {
713
- type: 'variable',
714
- value: 'inputFontWeight',
715
- }
716
- },
717
- inputErrorBorder: {
718
- fallback: {
719
- type: 'func',
720
- value: theme => {
721
- if(theme.inputBorderProvided) {
722
- const inputBorder = new Border(theme.inputBorder);
723
- return inputBorder.updateColor(theme.colorDanger).value;
724
- }
725
- return `1px solid ${theme.colorDanger}`;
726
- }
727
- }
728
- },
729
- inputErrorBorderRadius: {
730
- fallback: {
731
- type: 'variable',
732
- value: 'inputBorderRadius',
733
- }
734
- },
735
- inputErrorBoxShadow: {
736
- fallback: {
737
- type: 'variable',
738
- value: 'inputBoxShadow',
739
- }
740
- },
672
+ /** Inputs: Selection */
673
+ inputSelectionColorText: {
674
+ fallback: {
675
+ type: 'static',
676
+ value: 'initial',
677
+ },
678
+ },
679
+ inputSelectionColorBackground: {
680
+ fallback: {
681
+ type: 'static',
682
+ value: 'highlight',
683
+ },
684
+ },
741
685
 
742
- /** Inputs Error: Hover */
743
- inputErrorHoverColorBackground: {
744
- fallback: {
745
- type: 'variable',
746
- value: 'inputErrorColorBackground',
747
- }
748
- },
749
- inputErrorHoverColorText: {
750
- fallback: {
751
- type: 'variable',
752
- value: 'inputErrorColorText'
753
- }
754
- },
755
- inputErrorHoverFontFamily: {
756
- fallback: {
757
- type: 'variable',
758
- value: 'inputErrorFontFamily',
759
- }
760
- },
761
- inputErrorHoverFontSize: {
762
- fallback: {
763
- type: 'variable',
764
- value: 'inputErrorFontSize',
765
- }
766
- },
767
- inputErrorHoverFontLineHeight: {
768
- fallback: {
769
- type: 'variable',
770
- value: 'inputErrorFontLineHeight',
771
- }
772
- },
773
- inputErrorHoverFontWeight: {
774
- fallback: {
775
- type: 'variable',
776
- value: 'inputErrorFontWeight',
777
- }
778
- },
779
- inputErrorHoverBorder: {
780
- fallback: {
781
- type: 'variable',
782
- value: 'inputErrorBorder'
783
- }
784
- },
785
- inputErrorHoverBorderRadius: {
786
- fallback: {
787
- type: 'variable',
788
- value: 'inputErrorBorderRadius',
789
- }
790
- },
791
- inputErrorHoverBoxShadow: {
792
- fallback: {
793
- type: 'variable',
794
- value: 'inputErrorBoxShadow',
795
- }
796
- },
686
+ /** Inputs Error */
687
+ inputErrorColorBackground: {
688
+ fallback: {
689
+ type: 'variable',
690
+ value: 'inputColorBackground',
691
+ },
692
+ },
693
+ inputErrorColorText: {
694
+ fallback: {
695
+ type: 'variable',
696
+ value: 'colorDanger',
697
+ },
698
+ },
699
+ inputErrorFontFamily: {
700
+ fallback: {
701
+ type: 'variable',
702
+ value: 'inputFontFamily',
703
+ },
704
+ },
705
+ inputErrorFontSize: {
706
+ fallback: {
707
+ type: 'variable',
708
+ value: 'inputFontSize',
709
+ },
710
+ },
711
+ inputErrorFontLineHeight: {
712
+ fallback: {
713
+ type: 'variable',
714
+ value: 'inputFontLineHeight',
715
+ },
716
+ },
717
+ inputErrorFontWeight: {
718
+ fallback: {
719
+ type: 'variable',
720
+ value: 'inputFontWeight',
721
+ },
722
+ },
723
+ inputErrorBorder: {
724
+ fallback: {
725
+ type: 'func',
726
+ value: (theme) => {
727
+ if (theme.inputBorderProvided) {
728
+ const inputBorder = new Border(theme.inputBorder);
729
+ return inputBorder.updateColor(theme.colorDanger).value;
730
+ }
731
+ return `1px solid ${theme.colorDanger}`;
732
+ },
733
+ },
734
+ },
735
+ inputErrorBorderRadius: {
736
+ fallback: {
737
+ type: 'variable',
738
+ value: 'inputBorderRadius',
739
+ },
740
+ },
741
+ inputErrorBoxShadow: {
742
+ fallback: {
743
+ type: 'variable',
744
+ value: 'inputBoxShadow',
745
+ },
746
+ },
797
747
 
798
- /** Inputs Error: Focus */
799
- inputErrorFocusColorBackground: {
800
- fallback: {
801
- type: 'variable',
802
- value: 'inputErrorHoverColorBackground',
803
- }
804
- },
805
- inputErrorFocusColorText: {
806
- fallback: {
807
- type: 'variable',
808
- value: 'inputErrorHoverColorText'
809
- }
810
- },
811
- inputErrorFocusFontFamily: {
812
- fallback: {
813
- type: 'variable',
814
- value: 'inputErrorHoverFontFamily',
815
- }
816
- },
817
- inputErrorFocusFontSize: {
818
- fallback: {
819
- type: 'variable',
820
- value: 'inputErrorHoverFontSize',
821
- }
822
- },
823
- inputErrorFocusFontLineHeight: {
824
- fallback: {
825
- type: 'variable',
826
- value: 'inputErrorHoverFontLineHeight',
827
- }
828
- },
829
- inputErrorFocusFontWeight: {
830
- fallback: {
831
- type: 'variable',
832
- value: 'inputErrorHoverFontWeight',
833
- }
834
- },
835
- inputErrorFocusBorder: {
836
- fallback: {
837
- type: 'variable',
838
- value: 'inputErrorHoverBorder'
839
- }
840
- },
841
- inputErrorFocusBorderRadius: {
842
- fallback: {
843
- type: 'variable',
844
- value: 'inputErrorHoverBorderRadius',
845
- }
846
- },
847
- inputErrorFocusBoxShadow: {
848
- fallback: {
849
- type: 'variable',
850
- value: 'inputErrorHoverBoxShadow',
851
- }
852
- },
748
+ /** Inputs Error: Hover */
749
+ inputErrorHoverColorBackground: {
750
+ fallback: {
751
+ type: 'variable',
752
+ value: 'inputErrorColorBackground',
753
+ },
754
+ },
755
+ inputErrorHoverColorText: {
756
+ fallback: {
757
+ type: 'variable',
758
+ value: 'inputErrorColorText',
759
+ },
760
+ },
761
+ inputErrorHoverFontFamily: {
762
+ fallback: {
763
+ type: 'variable',
764
+ value: 'inputErrorFontFamily',
765
+ },
766
+ },
767
+ inputErrorHoverFontSize: {
768
+ fallback: {
769
+ type: 'variable',
770
+ value: 'inputErrorFontSize',
771
+ },
772
+ },
773
+ inputErrorHoverFontLineHeight: {
774
+ fallback: {
775
+ type: 'variable',
776
+ value: 'inputErrorFontLineHeight',
777
+ },
778
+ },
779
+ inputErrorHoverFontWeight: {
780
+ fallback: {
781
+ type: 'variable',
782
+ value: 'inputErrorFontWeight',
783
+ },
784
+ },
785
+ inputErrorHoverBorder: {
786
+ fallback: {
787
+ type: 'variable',
788
+ value: 'inputErrorBorder',
789
+ },
790
+ },
791
+ inputErrorHoverBorderRadius: {
792
+ fallback: {
793
+ type: 'variable',
794
+ value: 'inputErrorBorderRadius',
795
+ },
796
+ },
797
+ inputErrorHoverBoxShadow: {
798
+ fallback: {
799
+ type: 'variable',
800
+ value: 'inputErrorBoxShadow',
801
+ },
802
+ },
853
803
 
854
- /** Inputs Error: Placholder */
855
- inputErrorPlaceholderColorText: {
856
- fallback: {
857
- type: 'func',
858
- value: theme => {
859
- if(theme.inputErrorColorTextProvided) {
860
- return mutedTextColor(theme.inputErrorColorText);
861
- }
862
- return mutedTextColor(theme.colorDanger);
863
- }
864
- }
865
- },
866
- inputErrorPlaceholderFontFamily: {
867
- fallback: {
868
- type: 'variable',
869
- value: 'inputPlaceholderFontFamily',
870
- }
871
- },
872
- inputErrorPlaceholderFontSize: {
873
- fallback: {
874
- type: 'variable',
875
- value: 'inputPlaceholderFontSize',
876
- }
877
- },
878
- inputErrorPlaceholderFontLineHeight: {
879
- fallback: {
880
- type: 'variable',
881
- value: 'inputPlaceholderFontLineHeight',
882
- }
883
- },
884
- inputErrorPlaceholderFontWeight: {
885
- fallback: {
886
- type: 'variable',
887
- value: 'inputPlaceholderFontWeight',
888
- }
889
- },
804
+ /** Inputs Error: Focus */
805
+ inputErrorFocusColorBackground: {
806
+ fallback: {
807
+ type: 'variable',
808
+ value: 'inputErrorHoverColorBackground',
809
+ },
810
+ },
811
+ inputErrorFocusColorText: {
812
+ fallback: {
813
+ type: 'variable',
814
+ value: 'inputErrorHoverColorText',
815
+ },
816
+ },
817
+ inputErrorFocusFontFamily: {
818
+ fallback: {
819
+ type: 'variable',
820
+ value: 'inputErrorHoverFontFamily',
821
+ },
822
+ },
823
+ inputErrorFocusFontSize: {
824
+ fallback: {
825
+ type: 'variable',
826
+ value: 'inputErrorHoverFontSize',
827
+ },
828
+ },
829
+ inputErrorFocusFontLineHeight: {
830
+ fallback: {
831
+ type: 'variable',
832
+ value: 'inputErrorHoverFontLineHeight',
833
+ },
834
+ },
835
+ inputErrorFocusFontWeight: {
836
+ fallback: {
837
+ type: 'variable',
838
+ value: 'inputErrorHoverFontWeight',
839
+ },
840
+ },
841
+ inputErrorFocusBorder: {
842
+ fallback: {
843
+ type: 'variable',
844
+ value: 'inputErrorHoverBorder',
845
+ },
846
+ },
847
+ inputErrorFocusBorderRadius: {
848
+ fallback: {
849
+ type: 'variable',
850
+ value: 'inputErrorHoverBorderRadius',
851
+ },
852
+ },
853
+ inputErrorFocusBoxShadow: {
854
+ fallback: {
855
+ type: 'variable',
856
+ value: 'inputErrorHoverBoxShadow',
857
+ },
858
+ },
890
859
 
891
- /** Inputs Error: Selection */
892
- inputErrorSelectionColorText: {
893
- fallback: {
894
- type: 'variable',
895
- value: 'inputSelectionColorText',
896
- }
897
- },
898
- inputErrorSelectionColorBackground: {
899
- fallback: {
900
- type: 'variable',
901
- value: 'inputSelectionColorBackground',
902
- }
903
- },
860
+ /** Inputs Error: Placholder */
861
+ inputErrorPlaceholderColorText: {
862
+ fallback: {
863
+ type: 'func',
864
+ value: (theme) => {
865
+ if (theme.inputErrorColorTextProvided) {
866
+ return mutedTextColor(theme.inputErrorColorText);
867
+ }
868
+ return mutedTextColor(theme.colorDanger);
869
+ },
870
+ },
871
+ },
872
+ inputErrorPlaceholderFontFamily: {
873
+ fallback: {
874
+ type: 'variable',
875
+ value: 'inputPlaceholderFontFamily',
876
+ },
877
+ },
878
+ inputErrorPlaceholderFontSize: {
879
+ fallback: {
880
+ type: 'variable',
881
+ value: 'inputPlaceholderFontSize',
882
+ },
883
+ },
884
+ inputErrorPlaceholderFontLineHeight: {
885
+ fallback: {
886
+ type: 'variable',
887
+ value: 'inputPlaceholderFontLineHeight',
888
+ },
889
+ },
890
+ inputErrorPlaceholderFontWeight: {
891
+ fallback: {
892
+ type: 'variable',
893
+ value: 'inputPlaceholderFontWeight',
894
+ },
895
+ },
904
896
 
905
- /** Labels */
906
- labels: {
907
- fallback: {
908
- type: 'static',
909
- value: 'floating',
910
- }
911
- },
912
- }
897
+ /** Inputs Error: Selection */
898
+ inputErrorSelectionColorText: {
899
+ fallback: {
900
+ type: 'variable',
901
+ value: 'inputSelectionColorText',
902
+ },
903
+ },
904
+ inputErrorSelectionColorBackground: {
905
+ fallback: {
906
+ type: 'variable',
907
+ value: 'inputSelectionColorBackground',
908
+ },
909
+ },
913
910
 
911
+ /** Labels */
912
+ labels: {
913
+ fallback: {
914
+ type: 'static',
915
+ value: 'floating',
916
+ },
917
+ },
918
+ };
914
919
 
915
920
  export default new Proxy(properties, {
916
- get(obj, prop, receiver) {
917
- if(prop in obj) {
918
- if(obj[prop].value) {
919
- return obj[prop].value;
920
- }
921
- const { type, value } = obj[prop].fallback;
922
- if(type === 'static') {
923
- return value;
924
- }
925
- if(type === 'variable') {
926
- return `var(--rebilly-${value})`;
927
- }
928
- if(type === 'func') {
929
- return value(receiver);
930
- }
931
- }
932
- if(prop.endsWith('Provided')) {
933
- const target = prop.replace('Provided', '');
934
- if(target in obj) {
935
- return obj[target].isProvided;
936
- }
937
- }
938
- return undefined;
939
- },
921
+ get(obj, prop, receiver) {
922
+ if (prop in obj) {
923
+ if (obj[prop].value) {
924
+ return obj[prop].value;
925
+ }
926
+ const { type, value } = obj[prop].fallback;
927
+ if (type === 'static') {
928
+ return value;
929
+ }
930
+ if (type === 'variable') {
931
+ return `var(--rebilly-${value})`;
932
+ }
933
+ if (type === 'func') {
934
+ return value(receiver);
935
+ }
936
+ }
937
+ if (prop.endsWith('Provided')) {
938
+ const target = prop.replace('Provided', '');
939
+ if (target in obj) {
940
+ return obj[target].isProvided;
941
+ }
942
+ }
943
+ return undefined;
944
+ },
940
945
 
941
- set: (obj, prop, value) => {
942
- if(!(prop in obj) || !value) {
943
- throw new Error(`Invalid theme option provided: ${prop}`);
944
- }
946
+ set: (obj, prop, value) => {
947
+ if (!(prop in obj) || !value) {
948
+ throw new Error(`Invalid theme option provided: ${prop}`);
949
+ }
945
950
 
946
- obj[prop].value = value;
947
- obj[prop].isProvided = true;
948
- return true;
949
- }
950
- });
951
+ obj[prop].value = value;
952
+ obj[prop].isProvided = true;
953
+ return true;
954
+ },
955
+ });