@rebilly/instruments 4.8.0 → 4.8.2
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.
- package/CHANGELOG.md +14 -0
- package/dist/index.js +3 -3
- package/dist/index.min.js +3 -3
- package/package.json +5 -1
- package/.babelrc +0 -26
- package/project.json +0 -31
- package/rollup.config.mjs +0 -79
- package/src/data/options-schema/index.js +0 -112
- package/src/data/options-schema/schemas/options-schema.js +0 -448
- package/src/events/base-event.js +0 -47
- package/src/events/events.spec.js +0 -11
- package/src/events/index.js +0 -15
- package/src/functions/destroy.js +0 -29
- package/src/functions/destroy.spec.js +0 -63
- package/src/functions/mount/fetch-data.js +0 -234
- package/src/functions/mount/fetch-data.spec.js +0 -317
- package/src/functions/mount/get-lead-source-data.js +0 -46
- package/src/functions/mount/get-lead-source-data.spec.js +0 -38
- package/src/functions/mount/index.js +0 -105
- package/src/functions/mount/mount.spec.js +0 -96
- package/src/functions/mount/setup-element.js +0 -29
- package/src/functions/mount/setup-framepay-theme.js +0 -104
- package/src/functions/mount/setup-framepay.js +0 -26
- package/src/functions/mount/setup-i18n.js +0 -21
- package/src/functions/mount/setup-options.js +0 -100
- package/src/functions/mount/setup-options.spec.js +0 -353
- package/src/functions/mount/setup-storefront.js +0 -23
- package/src/functions/mount/setup-styles-vars.js +0 -30
- package/src/functions/mount/setup-user-flow.js +0 -60
- package/src/functions/on.js +0 -22
- package/src/functions/on.spec.js +0 -75
- package/src/functions/purchase.js +0 -173
- package/src/functions/purchase.spec.js +0 -80
- package/src/functions/setup.js +0 -66
- package/src/functions/setup.spec.js +0 -111
- package/src/functions/show.js +0 -30
- package/src/functions/show.spec.js +0 -62
- package/src/functions/update.js +0 -40
- package/src/functions/update.spec.js +0 -104
- package/src/i18n/en.json +0 -35
- package/src/i18n/es.json +0 -32
- package/src/i18n/i18n.spec.js +0 -27
- package/src/i18n/index.js +0 -59
- package/src/index.js +0 -3
- package/src/instance.js +0 -48
- package/src/instance.spec.js +0 -44
- package/src/loader/index.js +0 -145
- package/src/loader/loader.spec.js +0 -74
- package/src/state/iframes.js +0 -23
- package/src/state/index.js +0 -64
- package/src/storefront/account-and-website.js +0 -18
- package/src/storefront/account-and-website.spec.js +0 -73
- package/src/storefront/deposit-requests.js +0 -12
- package/src/storefront/fetch-plans-from-addons-bumpOffer.js +0 -30
- package/src/storefront/fetch-products-from-plans.js +0 -59
- package/src/storefront/fetch-products-from-plans.spec.js +0 -113
- package/src/storefront/index.js +0 -78
- package/src/storefront/invoices.js +0 -23
- package/src/storefront/invoices.spec.js +0 -92
- package/src/storefront/models/account-model.js +0 -36
- package/src/storefront/models/base-model.js +0 -7
- package/src/storefront/models/deposit-request-model.js +0 -24
- package/src/storefront/models/invoice-model.js +0 -20
- package/src/storefront/models/payment-metadata.js +0 -7
- package/src/storefront/models/plan-model.js +0 -94
- package/src/storefront/models/product-model.js +0 -3
- package/src/storefront/models/ready-to-pay-model.js +0 -76
- package/src/storefront/models/summary-model.js +0 -56
- package/src/storefront/models/transaction-model.js +0 -16
- package/src/storefront/models/website-model.js +0 -3
- package/src/storefront/payment-instruments.js +0 -47
- package/src/storefront/payment-instruments.spec.js +0 -88
- package/src/storefront/purchase.js +0 -60
- package/src/storefront/purchase.spec.js +0 -53
- package/src/storefront/ready-to-pay.js +0 -96
- package/src/storefront/ready-to-pay.spec.js +0 -80
- package/src/storefront/storefront.spec.js +0 -14
- package/src/storefront/summary.js +0 -114
- package/src/storefront/summary.spec.js +0 -136
- package/src/storefront/transactions.js +0 -12
- package/src/style/base/__snapshots__/theme.spec.js.snap +0 -143
- package/src/style/base/default-theme.js +0 -955
- package/src/style/base/index.js +0 -688
- package/src/style/base/theme.js +0 -30
- package/src/style/base/theme.spec.js +0 -19
- package/src/style/index.js +0 -11
- package/src/style/utils/border.js +0 -47
- package/src/style/utils/color-values.js +0 -35
- package/src/style/utils/minifyCss.js +0 -14
- package/src/utils/add-dom-element.js +0 -17
- package/src/utils/format-currency.js +0 -8
- package/src/utils/has-valid-css-selector.js +0 -4
- package/src/utils/index.js +0 -15
- package/src/utils/is-dom-element.js +0 -3
- package/src/utils/process-property-as-dom-element.js +0 -31
- package/src/utils/quantity.js +0 -47
- package/src/utils/sleep.js +0 -5
- package/src/views/amount-selector.js +0 -48
- package/src/views/common/iframe/base-iframe.js +0 -66
- package/src/views/common/iframe/events/change-iframe-src-handler.js +0 -6
- package/src/views/common/iframe/events/dispatch-event-handler.js +0 -8
- package/src/views/common/iframe/events/resize-component-handler.js +0 -9
- package/src/views/common/iframe/events/show-error-handler.js +0 -5
- package/src/views/common/iframe/events/stop-loader-handler.js +0 -9
- package/src/views/common/iframe/events/update-addons-handler.js +0 -23
- package/src/views/common/iframe/events/update-coupons-handler.js +0 -12
- package/src/views/common/iframe/events/update-items-handler.js +0 -34
- package/src/views/common/iframe/index.js +0 -5
- package/src/views/common/iframe/modal-iframe.js +0 -82
- package/src/views/common/iframe/view-iframe.js +0 -23
- package/src/views/common/render-utilities.js +0 -4
- package/src/views/confirmation.js +0 -45
- package/src/views/errors.js +0 -115
- package/src/views/form.js +0 -61
- package/src/views/method-selector/__snapshots__/method-selector.spec.js.snap +0 -135
- package/src/views/method-selector/express-methods.js +0 -52
- package/src/views/method-selector/generate-digital-wallet.js +0 -53
- package/src/views/method-selector/generate-digital-wallet.spec.js +0 -121
- package/src/views/method-selector/generate-framepay-config.js +0 -56
- package/src/views/method-selector/generate-framepay-config.spec.js +0 -216
- package/src/views/method-selector/get-method-data.js +0 -11
- package/src/views/method-selector/get-payment-methods.js +0 -25
- package/src/views/method-selector/get-payment-methods.spec.js +0 -41
- package/src/views/method-selector/index.js +0 -223
- package/src/views/method-selector/method-selector.spec.js +0 -20
- package/src/views/method-selector/mount-bump-offer.js +0 -120
- package/src/views/method-selector/mount-express-methods.js +0 -107
- package/src/views/modal.js +0 -103
- package/src/views/result.js +0 -24
- package/src/views/summary.js +0 -38
- package/tests/async-utilities.js +0 -22
- package/tests/mocks/framepay-mock.js +0 -15
- package/tests/mocks/rebilly-api-mock.js +0 -11
- package/tests/mocks/rebilly-instruments-mock.js +0 -141
- package/tests/mocks/storefront-api-mock.js +0 -62
- package/tests/mocks/storefront-mock.js +0 -20
- package/tests/msw/server.js +0 -14
- package/tests/setup-test.js +0 -30
- package/vitest.config.js +0 -18
|
@@ -1,955 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
mutedTextColor,
|
|
3
|
-
darken,
|
|
4
|
-
mutedBorderColor,
|
|
5
|
-
} from '../utils/color-values';
|
|
6
|
-
import Border from '../utils/border';
|
|
7
|
-
|
|
8
|
-
const properties = {
|
|
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
|
-
},
|
|
51
|
-
|
|
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
|
-
},
|
|
83
|
-
|
|
84
|
-
/** Misc */
|
|
85
|
-
borderRadius: {
|
|
86
|
-
fallback: {
|
|
87
|
-
type: 'static',
|
|
88
|
-
value: '6px',
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
|
|
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
|
-
},
|
|
111
|
-
|
|
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
|
-
},
|
|
167
|
-
|
|
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
|
-
},
|
|
223
|
-
|
|
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
|
-
},
|
|
292
|
-
|
|
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
|
-
},
|
|
348
|
-
|
|
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
|
-
},
|
|
404
|
-
|
|
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
|
-
},
|
|
460
|
-
|
|
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
|
-
},
|
|
516
|
-
|
|
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
|
-
},
|
|
572
|
-
|
|
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
|
-
},
|
|
634
|
-
|
|
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
|
-
},
|
|
671
|
-
|
|
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
|
-
},
|
|
685
|
-
|
|
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
|
-
},
|
|
747
|
-
|
|
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
|
-
},
|
|
803
|
-
|
|
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
|
-
},
|
|
859
|
-
|
|
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
|
-
},
|
|
896
|
-
|
|
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
|
-
},
|
|
910
|
-
|
|
911
|
-
/** Labels */
|
|
912
|
-
labels: {
|
|
913
|
-
fallback: {
|
|
914
|
-
type: 'static',
|
|
915
|
-
value: 'floating',
|
|
916
|
-
},
|
|
917
|
-
},
|
|
918
|
-
};
|
|
919
|
-
|
|
920
|
-
export default new Proxy(properties, {
|
|
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
|
-
},
|
|
945
|
-
|
|
946
|
-
set: (obj, prop, value) => {
|
|
947
|
-
if (!(prop in obj) || !value) {
|
|
948
|
-
throw new Error(`Invalid theme option provided: ${prop}`);
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
obj[prop].value = value;
|
|
952
|
-
obj[prop].isProvided = true;
|
|
953
|
-
return true;
|
|
954
|
-
},
|
|
955
|
-
});
|