@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.
- package/dist/events/index.js +2 -1
- package/dist/functions/mount/fetch-data.js +187 -0
- package/dist/functions/mount/fetch-data.spec.js +189 -0
- package/dist/functions/mount/index.js +132 -164
- package/dist/functions/mount/mount.spec.js +2 -4
- package/dist/functions/mount/setup-element.js +40 -0
- package/dist/functions/mount/setup-framepay-theme.js +95 -0
- package/dist/functions/mount/setup-framepay.js +5 -1
- package/dist/functions/mount/setup-i18n.js +33 -0
- package/dist/functions/mount/setup-options.js +68 -47
- package/dist/functions/mount/setup-options.spec.js +66 -0
- package/dist/functions/mount/setup-storefront.js +6 -4
- package/dist/functions/mount/setup-styles.js +4 -2
- package/dist/functions/purchase.js +129 -24
- package/dist/functions/purchase.spec.js +13 -10
- package/dist/functions/setup.js +85 -0
- package/dist/functions/setup.spec.js +87 -0
- package/dist/functions/show.js +8 -4
- package/dist/functions/show.spec.js +9 -5
- package/dist/functions/update.js +39 -24
- package/dist/functions/update.spec.js +0 -4
- package/dist/i18n/en.json +5 -2
- package/dist/i18n/es.json +4 -1
- package/dist/index.js +17 -3
- package/dist/index.spec.js +3 -16
- package/dist/loader/index.js +4 -3
- package/dist/storefront/index.js +33 -0
- package/dist/storefront/invoices.js +27 -0
- package/dist/storefront/models/base-model.js +18 -0
- package/dist/storefront/models/invoice-model.js +14 -0
- package/dist/storefront/models/plan-model.js +4 -35
- package/dist/storefront/models/product-model.js +4 -23
- package/dist/storefront/models/summary-model.js +12 -25
- package/dist/storefront/models/transaction-model.js +31 -0
- package/dist/storefront/payment-instruments.js +47 -0
- package/dist/storefront/payment-instruments.spec.js +55 -0
- package/dist/storefront/plans.js +10 -18
- package/dist/storefront/plans.spec.js +3 -13
- package/dist/storefront/products.js +10 -13
- package/dist/storefront/products.spec.js +12 -19
- package/dist/storefront/purchase.js +23 -12
- package/dist/storefront/purchase.spec.js +1 -20
- package/dist/storefront/ready-to-pay.js +18 -15
- package/dist/storefront/ready-to-pay.spec.js +2 -12
- package/dist/storefront/summary.js +21 -17
- package/dist/storefront/summary.spec.js +4 -15
- package/dist/storefront/transactions.js +27 -0
- package/dist/style/base/__snapshots__/theme.spec.js.snap +188 -45
- package/dist/style/base/default-theme.js +699 -0
- package/dist/style/base/index.js +48 -16
- package/dist/style/base/theme.js +16 -48
- package/dist/style/base/theme.spec.js +4 -15
- package/dist/style/components/address.js +3 -3
- package/dist/style/components/button.js +32 -22
- package/dist/style/components/divider.js +9 -9
- package/dist/style/components/forms/checkbox.js +12 -9
- package/dist/style/components/forms/field.js +18 -6
- package/dist/style/components/forms/form.js +2 -2
- package/dist/style/components/forms/input.js +54 -13
- package/dist/style/components/forms/label.js +39 -18
- package/dist/style/components/forms/select.js +54 -22
- package/dist/style/components/forms/validation.js +53 -6
- package/dist/style/components/icons.js +4 -4
- package/dist/style/components/loader.js +5 -3
- package/dist/style/components/methods.js +18 -15
- package/dist/style/components/overlay.js +5 -5
- package/dist/style/helpers/index.js +46 -46
- package/dist/style/index.js +3 -1
- package/dist/style/payment-instruments/payment-card.js +4 -4
- package/dist/style/utils/border.js +47 -0
- package/dist/style/utils/color-values.js +39 -3
- package/dist/style/utils/remove-empty-null.js +20 -0
- package/dist/style/vendor/framepay.js +11 -8
- package/dist/style/vendor/postmate.js +2 -2
- package/dist/style/views/confirmation.js +13 -13
- package/dist/style/views/method-selector.js +2 -2
- package/dist/style/views/modal.js +6 -6
- package/dist/style/views/result.js +4 -4
- package/dist/style/views/summary.js +26 -22
- package/dist/views/__snapshots__/summary.spec.js.snap +77 -119
- package/dist/views/common/iframe/base-iframe.js +2 -0
- package/dist/views/common/iframe/modal-iframe.js +50 -4
- package/dist/views/confirmation.js +19 -8
- package/dist/views/method-selector/generate-digital-wallet.js +12 -3
- package/dist/views/method-selector/generate-digital-wallet.spec.js +11 -0
- package/dist/views/method-selector/get-payment-methods.js +13 -2
- package/dist/views/method-selector/get-payment-methods.spec.js +21 -19
- package/dist/views/method-selector/index.js +23 -34
- package/dist/views/method-selector/method-selector.spec.js +50 -55
- package/dist/views/method-selector/mount-methods.js +5 -8
- package/dist/views/modal.js +8 -2
- package/dist/views/result.js +3 -4
- package/dist/views/summary.js +156 -97
- package/dist/views/summary.spec.js +53 -58
- package/package.json +4 -2
- package/src/events/index.js +2 -1
- package/src/functions/mount/fetch-data.js +152 -0
- package/src/functions/mount/fetch-data.spec.js +238 -0
- package/src/functions/mount/index.js +101 -158
- package/src/functions/mount/mount.spec.js +3 -5
- package/src/functions/mount/setup-element.js +26 -0
- package/src/functions/mount/setup-framepay-theme.js +82 -0
- package/src/functions/mount/setup-framepay.js +5 -1
- package/src/functions/mount/setup-i18n.js +19 -0
- package/src/functions/mount/setup-options.js +78 -48
- package/src/functions/mount/setup-options.spec.js +60 -0
- package/src/functions/mount/setup-storefront.js +6 -4
- package/src/functions/mount/setup-styles.js +4 -2
- package/src/functions/on.spec.js +1 -1
- package/src/functions/purchase.js +99 -23
- package/src/functions/purchase.spec.js +10 -10
- package/src/functions/setup.js +48 -0
- package/src/functions/setup.spec.js +98 -0
- package/src/functions/show.js +2 -4
- package/src/functions/show.spec.js +3 -4
- package/src/functions/update.js +40 -25
- package/src/functions/update.spec.js +0 -4
- package/src/i18n/en.json +5 -2
- package/src/i18n/es.json +4 -1
- package/src/index.js +9 -3
- package/src/index.spec.js +3 -21
- package/src/loader/index.js +3 -3
- package/src/storefront/index.js +28 -0
- package/src/storefront/invoices.js +11 -0
- package/src/storefront/models/base-model.js +10 -0
- package/src/storefront/models/invoice-model.js +3 -0
- package/src/storefront/models/plan-model.js +3 -35
- package/src/storefront/models/product-model.js +3 -23
- package/src/storefront/models/summary-model.js +12 -19
- package/src/storefront/models/transaction-model.js +19 -0
- package/src/storefront/payment-instruments.js +30 -0
- package/src/storefront/payment-instruments.spec.js +69 -0
- package/src/storefront/plans.js +6 -17
- package/src/storefront/plans.spec.js +4 -11
- package/src/storefront/products.js +8 -16
- package/src/storefront/products.spec.js +16 -22
- package/src/storefront/purchase.js +14 -16
- package/src/storefront/purchase.spec.js +2 -14
- package/src/storefront/ready-to-pay.js +13 -16
- package/src/storefront/ready-to-pay.spec.js +3 -10
- package/src/storefront/summary.js +19 -17
- package/src/storefront/summary.spec.js +5 -12
- package/src/storefront/transactions.js +11 -0
- package/src/style/base/__snapshots__/theme.spec.js.snap +188 -45
- package/src/style/base/default-theme.js +674 -0
- package/src/style/base/index.js +48 -16
- package/src/style/base/theme.js +17 -47
- package/src/style/base/theme.spec.js +4 -16
- package/src/style/components/address.js +3 -3
- package/src/style/components/button.js +32 -24
- package/src/style/components/divider.js +9 -9
- package/src/style/components/forms/checkbox.js +11 -11
- package/src/style/components/forms/field.js +18 -6
- package/src/style/components/forms/form.js +2 -2
- package/src/style/components/forms/input.js +54 -13
- package/src/style/components/forms/label.js +39 -18
- package/src/style/components/forms/select.js +54 -22
- package/src/style/components/forms/validation.js +53 -6
- package/src/style/components/icons.js +4 -4
- package/src/style/components/loader.js +4 -5
- package/src/style/components/methods.js +18 -15
- package/src/style/components/overlay.js +5 -5
- package/src/style/helpers/index.js +46 -46
- package/src/style/index.js +2 -1
- package/src/style/payment-instruments/payment-card.js +4 -4
- package/src/style/utils/border.js +34 -0
- package/src/style/utils/color-values.js +27 -1
- package/src/style/utils/remove-empty-null.js +10 -0
- package/src/style/vendor/framepay.js +11 -8
- package/src/style/vendor/postmate.js +2 -2
- package/src/style/views/confirmation.js +13 -13
- package/src/style/views/method-selector.js +2 -2
- package/src/style/views/modal.js +6 -6
- package/src/style/views/result.js +4 -4
- package/src/style/views/summary.js +26 -22
- package/src/views/__snapshots__/summary.spec.js.snap +77 -119
- package/src/views/common/iframe/base-iframe.js +2 -0
- package/src/views/common/iframe/modal-iframe.js +45 -3
- package/src/views/confirmation.js +15 -5
- package/src/views/method-selector/generate-digital-wallet.js +10 -3
- package/src/views/method-selector/generate-digital-wallet.spec.js +10 -0
- package/src/views/method-selector/get-payment-methods.js +7 -2
- package/src/views/method-selector/get-payment-methods.spec.js +26 -23
- package/src/views/method-selector/index.js +21 -28
- package/src/views/method-selector/method-selector.spec.js +49 -64
- package/src/views/method-selector/mount-methods.js +5 -8
- package/src/views/modal.js +6 -2
- package/src/views/result.js +4 -3
- package/src/views/summary.js +161 -117
- package/src/views/summary.spec.js +60 -75
- package/tests/mocks/rebilly-instruments-mock.js +37 -7
- package/tests/mocks/storefront-api-mock.js +8 -0
- package/tests/mocks/storefront-mock.js +17 -0
- package/dist/functions/mount/fetch-summary-data.js +0 -46
- package/dist/functions/mount/fetch-summary-data.spec.js +0 -43
- package/src/functions/mount/fetch-summary-data.js +0 -29
- package/src/functions/mount/fetch-summary-data.spec.js +0 -40
|
@@ -1,30 +1,59 @@
|
|
|
1
1
|
// -----------------------------------------------------------------------------
|
|
2
2
|
// This file contains all styles related to the select component.
|
|
3
3
|
// -----------------------------------------------------------------------------
|
|
4
|
-
export const select = (
|
|
4
|
+
export const select = () => `
|
|
5
5
|
/**
|
|
6
6
|
* Select
|
|
7
7
|
*/
|
|
8
8
|
.rebilly-instruments-form-field-select {
|
|
9
|
-
font-size:
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
9
|
+
font-size: var(--rebilly-inputFontSize);
|
|
10
|
+
font-family: var(--rebilly-inputFontFamily);
|
|
11
|
+
font-weight: var(--rebilly-inputFontWeight);
|
|
12
|
+
line-height: var(--rebilly-inputFontLineHeight);
|
|
13
|
+
padding: var(--rebilly-spacings-input-py) var(--rebilly-spacings-input-px);
|
|
14
|
+
min-height: var(--rebilly-spacings-form-element-min-height);
|
|
15
|
+
border: var(--rebilly-inputBorder);
|
|
16
|
+
border-radius: var(--rebilly-inputBorderRadius);
|
|
17
|
+
color: var(--rebilly-inputColorText);
|
|
18
|
+
background: var(--rebilly-inputColorBackground);
|
|
17
19
|
box-sizing: border-box;
|
|
20
|
+
box-shadow: var(--rebilly-inputBoxShadow);
|
|
18
21
|
width: 100%;
|
|
19
22
|
transition: all 200ms;
|
|
23
|
+
order: 1;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rebilly-instruments-form-field-select:hover {
|
|
27
|
+
background: var(--rebilly-inputHoverColorBackground);
|
|
28
|
+
color: var(--rebilly-inputHoverColorText);
|
|
29
|
+
font-family: var(--rebilly-inputHoverFontFamily);
|
|
30
|
+
font-size: var(--rebilly-inputHoverFontSize);
|
|
31
|
+
line-height: var(--rebilly-inputHoverFontLineHeight);
|
|
32
|
+
font-weight: var(--rebilly-inputHoverFontWeight);
|
|
33
|
+
border: var(--rebilly-inputHoverBorder);
|
|
34
|
+
border-radius: var(--rebilly-inputHoverBorderRadius);
|
|
35
|
+
box-shadow: var(--rebilly-inputHoverBoxShadow);
|
|
20
36
|
}
|
|
21
37
|
|
|
22
38
|
.rebilly-instruments-form-field-select:focus {
|
|
23
39
|
outline: none;
|
|
24
|
-
|
|
25
|
-
|
|
40
|
+
background: var(--rebilly-inputFocusColorBackground);
|
|
41
|
+
color: var(--rebilly-inputFocusColorText);
|
|
42
|
+
font-family: var(--rebilly-inputFocusFontFamily);
|
|
43
|
+
font-size: var(--rebilly-inputFocusFontSize);
|
|
44
|
+
line-height: var(--rebilly-inputFocusFontLineHeight);
|
|
45
|
+
font-weight: var(--rebilly-inputFocusFontWeight);
|
|
46
|
+
border: var(--rebilly-inputFocusBorder);
|
|
47
|
+
border-radius: var(--rebilly-inputFocusBorderRadius);
|
|
48
|
+
box-shadow: var(--rebilly-inputFocusBoxShadow);
|
|
26
49
|
}
|
|
27
50
|
|
|
51
|
+
.rebilly-instruments-form-field-select::selection {
|
|
52
|
+
color: var(--rebilly-inputSelectionColorText);
|
|
53
|
+
background: var(--rebilly-inputSelectionColorBackground);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
28
57
|
.rebilly-instruments-form-field-select:disabled {
|
|
29
58
|
opacity: 0.6;
|
|
30
59
|
}
|
|
@@ -34,21 +63,24 @@ export const select = (theme) => `
|
|
|
34
63
|
-moz-appearance: none;
|
|
35
64
|
}
|
|
36
65
|
|
|
37
|
-
.rebilly-instruments-form-field-select + .rebilly-instruments-form-field-label {
|
|
38
|
-
font-size: ${theme.typography.fontSize};
|
|
39
|
-
opacity: 0.5;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
66
|
.rebilly-instruments-form-field-select::-ms-expand { display: none; }
|
|
43
67
|
|
|
44
68
|
.rebilly-instruments-form-field-select-arrow {
|
|
45
|
-
border: solid
|
|
69
|
+
border: solid var(--rebilly-inputColorText);
|
|
46
70
|
position: absolute;
|
|
47
|
-
width:
|
|
48
|
-
height:
|
|
71
|
+
width: var(--rebilly-spacings-xs);
|
|
72
|
+
height: var(--rebilly-spacings-xs);
|
|
49
73
|
border-width: 0 2px 2px 0;
|
|
50
|
-
|
|
51
|
-
right:
|
|
52
|
-
top:
|
|
74
|
+
border-radius: 1px;
|
|
75
|
+
right: var(--rebilly-spacings-s);
|
|
76
|
+
top: 50%;
|
|
77
|
+
margin-top: calc(var(--rebilly-inputFontSize) * 0.875 - var(--rebilly-spacings-xs));
|
|
78
|
+
transform: translateY(-50%) rotate(45deg);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.is-floating .rebilly-instruments-form-field-select-arrow {
|
|
82
|
+
top: 50%;
|
|
83
|
+
margin-top: 0;
|
|
84
|
+
transform: translateY(-50%) rotate(45deg);
|
|
53
85
|
}
|
|
54
86
|
`;
|
|
@@ -1,25 +1,72 @@
|
|
|
1
1
|
// -----------------------------------------------------------------------------
|
|
2
2
|
// This file contains all styles related to the form validations.
|
|
3
3
|
// -----------------------------------------------------------------------------
|
|
4
|
-
export const validation = (
|
|
4
|
+
export const validation = () => `
|
|
5
5
|
/**
|
|
6
6
|
* Validations
|
|
7
7
|
*/
|
|
8
8
|
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input,
|
|
9
9
|
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
font-family: var(--rebilly-inputErrorFontFamily);
|
|
11
|
+
font-size: var(--rebilly-inputErrorFontSize);
|
|
12
|
+
font-weight: var(--rebilly-inputErrorFontWeight);
|
|
13
|
+
line-height: var(--rebilly-inputErrorFontLineHeight);
|
|
14
|
+
background: var(--rebilly-inputErrorColorBackground);
|
|
15
|
+
color: var(--rebilly-inputErrorColorText);
|
|
16
|
+
border: var(--rebilly-inputErrorBorder);
|
|
17
|
+
border-radius: var(--rebilly-inputErrorBorderRadius);
|
|
18
|
+
box-shadow: var(--rebilly-inputErrorBoxShadow);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input:hover,
|
|
22
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select:hover {
|
|
23
|
+
font-family: var(--rebilly-inputErrorHoverFontFamily);
|
|
24
|
+
font-size: var(--rebilly-inputErrorHoverFontSize);
|
|
25
|
+
font-weight: var(--rebilly-inputErrorHoverFontWeight);
|
|
26
|
+
line-height: var(--rebilly-inputErrorHoverFontLineHeight);
|
|
27
|
+
background: var(--rebilly-inputErrorHoverColorBackground);
|
|
28
|
+
color: var(--rebilly-inputErrorHoverColorText);
|
|
29
|
+
border: var(--rebilly-inputErrorHoverBorder);
|
|
30
|
+
border-radius: var(--rebilly-inputErrorHoverBorderRadius);
|
|
31
|
+
box-shadow: var(--rebilly-inputErrorHoverBoxShadow);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input:focus,
|
|
35
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select:focus {
|
|
36
|
+
font-family: var(--rebilly-inputErrorFocusFontFamily);
|
|
37
|
+
font-size: var(--rebilly-inputErrorFocusFontSize);
|
|
38
|
+
font-weight: var(--rebilly-inputErrorFocusFontWeight);
|
|
39
|
+
line-height: var(--rebilly-inputErrorFocusFontLineHeight);
|
|
40
|
+
background: var(--rebilly-inputErrorFocusColorBackground);
|
|
41
|
+
color: var(--rebilly-inputErrorFocusColorText);
|
|
42
|
+
border: var(--rebilly-inputErrorFocusBorder);
|
|
43
|
+
border-radius: var(--rebilly-inputErrorFocusBorderRadius);
|
|
44
|
+
box-shadow: var(--rebilly-inputErrorFocusBoxShadow);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input::placeholder {
|
|
48
|
+
color: var(--rebilly-inputErrorPlaceholderColorText);
|
|
49
|
+
font-family: var(--rebilly-inputErrorPlaceholderFontFamily);
|
|
50
|
+
font-size: var(--rebilly-inputErrorPlaceholderFontSize);
|
|
51
|
+
line-height: var(--rebilly-inputErrorPlaceholderFontLineHeight);
|
|
52
|
+
font-weight: var(--rebilly-inputErrorPlaceholderFontWeight);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input::selection,
|
|
56
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select::selection {
|
|
57
|
+
color: var(--rebilly-inputErrorSelectionColorText);
|
|
58
|
+
background: var(--rebilly-inputErrorSelectionColorBackground);
|
|
12
59
|
}
|
|
13
60
|
|
|
14
61
|
.rebilly-instruments-form-field-error-wrapper {
|
|
15
|
-
margin-top:
|
|
16
|
-
margin-bottom:
|
|
62
|
+
margin-top: var(--rebilly-spacings-2xs);
|
|
63
|
+
margin-bottom: 0;
|
|
17
64
|
padding: 0;
|
|
18
65
|
list-style: none;
|
|
19
66
|
}
|
|
20
67
|
|
|
21
68
|
.rebilly-instruments-form-field-error-wrapper > li {
|
|
22
|
-
color:
|
|
69
|
+
color: var(--rebilly-colorDanger);
|
|
23
70
|
padding: 0;
|
|
24
71
|
}
|
|
25
72
|
`;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
// -----------------------------------------------------------------------------
|
|
2
2
|
// This file contains all styles related to the icons component.
|
|
3
3
|
// -----------------------------------------------------------------------------
|
|
4
|
-
export const icons = (
|
|
4
|
+
export const icons = () => `
|
|
5
5
|
/**
|
|
6
6
|
* Icons
|
|
7
7
|
*/
|
|
8
8
|
.rebilly-instruments-icon {
|
|
9
|
-
width:
|
|
10
|
-
height:
|
|
11
|
-
fill:
|
|
9
|
+
width: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
|
|
10
|
+
height: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
|
|
11
|
+
fill: var(--rebilly-colorText);
|
|
12
12
|
}
|
|
13
13
|
`;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { lighten } from '../utils/color-values';
|
|
1
2
|
// -----------------------------------------------------------------------------
|
|
2
3
|
// This file contains all styles related to the loader component.
|
|
3
4
|
// -----------------------------------------------------------------------------
|
|
@@ -14,7 +15,7 @@ export const loader = (theme) => `
|
|
|
14
15
|
right: 0;
|
|
15
16
|
justify-content: center;
|
|
16
17
|
align-items: center;
|
|
17
|
-
background-color:
|
|
18
|
+
background-color: var(--rebilly-colorBackground);
|
|
18
19
|
z-index: 9000;
|
|
19
20
|
transition: all 200ms;
|
|
20
21
|
}
|
|
@@ -24,10 +25,8 @@ export const loader = (theme) => `
|
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
.rebilly-instruments-loader-spinner {
|
|
27
|
-
border: 4px solid ${theme.
|
|
28
|
-
|
|
29
|
-
.hexString()};
|
|
30
|
-
border-top: 4px solid ${theme.color.primary};
|
|
28
|
+
border: 4px solid ${lighten(theme.colorPrimary, 80)};
|
|
29
|
+
border-top: 4px solid var(--rebilly-colorPrimary);
|
|
31
30
|
border-radius: 50%;
|
|
32
31
|
width: 40px;
|
|
33
32
|
height: 40px;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// -----------------------------------------------------------------------------
|
|
2
2
|
// This file contains all styles related to the methods component.
|
|
3
3
|
// -----------------------------------------------------------------------------
|
|
4
|
-
export const expressMethods = (
|
|
4
|
+
export const expressMethods = () => `
|
|
5
5
|
/**
|
|
6
6
|
* Express methods
|
|
7
7
|
*/
|
|
@@ -13,9 +13,11 @@ export const expressMethods = (theme) => `
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
.rebilly-instruments-express-methods.is-compact {
|
|
16
|
-
border: 1px solid
|
|
17
|
-
padding:
|
|
18
|
-
|
|
16
|
+
border: 1px solid var(--rebilly-colorMutedBorder);
|
|
17
|
+
padding: var(--rebilly-spacings-s);
|
|
18
|
+
padding-top: calc(var(--rebilly-spacings-xs) + var(--rebilly-spacings-s));
|
|
19
|
+
padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacings-2xs));
|
|
20
|
+
border-radius: 4px;
|
|
19
21
|
position: relative;
|
|
20
22
|
}
|
|
21
23
|
|
|
@@ -27,10 +29,11 @@ export const expressMethods = (theme) => `
|
|
|
27
29
|
|
|
28
30
|
.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {
|
|
29
31
|
border-radius: 6px;
|
|
30
|
-
margin-bottom:
|
|
31
|
-
background: linear-gradient(110deg,
|
|
32
|
+
margin-bottom: var(--rebilly-spacings-xs);
|
|
33
|
+
background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);
|
|
32
34
|
background-size: 200% 100%;
|
|
33
35
|
animation: 1.5s rebillyExpressShine linear infinite;
|
|
36
|
+
height: 44px;
|
|
34
37
|
}
|
|
35
38
|
.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {
|
|
36
39
|
margin: 0;
|
|
@@ -44,7 +47,7 @@ export const expressMethods = (theme) => `
|
|
|
44
47
|
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {
|
|
45
48
|
flex: 1 1 0px;
|
|
46
49
|
max-width: 260px;
|
|
47
|
-
margin: 0
|
|
50
|
+
margin: 0 var(--rebilly-spacings-xs);
|
|
48
51
|
}
|
|
49
52
|
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {
|
|
50
53
|
margin-left: 0;
|
|
@@ -58,17 +61,17 @@ export const expressMethods = (theme) => `
|
|
|
58
61
|
}
|
|
59
62
|
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {
|
|
60
63
|
position: absolute;
|
|
61
|
-
top:
|
|
62
|
-
transform: translateX(-50%);
|
|
63
|
-
color:
|
|
64
|
-
padding:
|
|
65
|
-
line-height:
|
|
66
|
-
background:
|
|
64
|
+
top: 0; left: 50%;
|
|
65
|
+
transform: translateX(-50%) translateY(-50%);
|
|
66
|
+
color: var(--rebilly-colorText);
|
|
67
|
+
padding: var(--rebilly-spacings-2xs) var(--rebilly-spacings-s);
|
|
68
|
+
line-height: 1;
|
|
69
|
+
background: var(--rebilly-colorBackground);
|
|
67
70
|
display: inline-block;
|
|
68
71
|
font-weight: 500;
|
|
69
72
|
min-height: auto;
|
|
70
73
|
margin: 0;
|
|
71
|
-
|
|
74
|
+
white-space: nowrap;
|
|
72
75
|
}
|
|
73
76
|
|
|
74
77
|
@media (max-width: 600px) {
|
|
@@ -77,7 +80,7 @@ export const expressMethods = (theme) => `
|
|
|
77
80
|
}
|
|
78
81
|
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {
|
|
79
82
|
max-width: 100%;
|
|
80
|
-
margin: 0 0
|
|
83
|
+
margin: 0 0 var(--rebilly-spacings-xs);
|
|
81
84
|
}
|
|
82
85
|
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {
|
|
83
86
|
margin: 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// -----------------------------------------------------------------------------
|
|
2
2
|
// This file contains all styles related to the overlay component.
|
|
3
3
|
// -----------------------------------------------------------------------------
|
|
4
|
-
export const overlay = (
|
|
4
|
+
export const overlay = () => `
|
|
5
5
|
/**
|
|
6
6
|
* Overlay
|
|
7
7
|
*/
|
|
@@ -15,10 +15,10 @@ export const overlay = (theme) => `
|
|
|
15
15
|
display: flex;
|
|
16
16
|
justify-content: center;
|
|
17
17
|
align-items: center;
|
|
18
|
-
color: #
|
|
19
|
-
font-family:
|
|
20
|
-
font-size: calc(
|
|
21
|
-
line-height:
|
|
18
|
+
color: #FFF;
|
|
19
|
+
font-family: var(--rebilly-fontFamily);
|
|
20
|
+
font-size: calc(var(--rebilly-fontSizeBase) * 1.12);
|
|
21
|
+
line-height: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
|
|
22
22
|
z-index: 9001
|
|
23
23
|
}
|
|
24
24
|
`;
|
|
@@ -2,50 +2,50 @@
|
|
|
2
2
|
// This file contains all styles related to helpers.
|
|
3
3
|
// -----------------------------------------------------------------------------
|
|
4
4
|
|
|
5
|
-
export const helpers = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
5
|
+
export const helpers = () => `
|
|
6
|
+
/* Helpers
|
|
7
|
+
------------------------------------------------------------ */
|
|
8
|
+
.rebilly-instruments-helper-visually-hidden {
|
|
9
|
+
border: 0;
|
|
10
|
+
clip: rect(0 0 0 0);
|
|
11
|
+
height: 1px;
|
|
12
|
+
margin: -1px;
|
|
13
|
+
overflow: hidden;
|
|
14
|
+
padding: 0;
|
|
15
|
+
position: absolute;
|
|
16
|
+
width: 1px;
|
|
17
|
+
}
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
19
|
+
.rebilly-instruments-helper-mt-xxs { margin-top: var(--rebilly-spacings-2xs) !important }
|
|
20
|
+
.rebilly-instruments-helper-mt-xs { margin-top: var(--rebilly-spacings-xs) !important }
|
|
21
|
+
.rebilly-instruments-helper-mt-s { margin-top: var(--rebilly-spacings-s) !important }
|
|
22
|
+
.rebilly-instruments-helper-mt-m { margin-top: var(--rebilly-spacings-base) !important }
|
|
23
|
+
.rebilly-instruments-helper-mt-l { margin-top: var(--rebilly-spacings-l) !important }
|
|
24
|
+
.rebilly-instruments-helper-mt-xl { margin-top: var(--rebilly-spacings-xl) !important }
|
|
25
|
+
.rebilly-instruments-helper-mt-xxl { margin-top: var(--rebilly-spacings-2xl) !important }
|
|
26
|
+
.rebilly-instruments-helper-mt-0 { margin-top: 0!important }
|
|
27
|
+
.rebilly-instruments-helper-mr-xxs { margin-right: var(--rebilly-spacings-2xs) !important }
|
|
28
|
+
.rebilly-instruments-helper-mr-xs { margin-right: var(--rebilly-spacings-xs) !important }
|
|
29
|
+
.rebilly-instruments-helper-mr-s { margin-right: var(--rebilly-spacings-s) !important }
|
|
30
|
+
.rebilly-instruments-helper-mr-m { margin-right: var(--rebilly-spacings-base) !important }
|
|
31
|
+
.rebilly-instruments-helper-mr-l { margin-right: var(--rebilly-spacings-l) !important }
|
|
32
|
+
.rebilly-instruments-helper-mr-xl { margin-right: var(--rebilly-spacings-xl) !important }
|
|
33
|
+
.rebilly-instruments-helper-mr-xxl { margin-right: var(--rebilly-spacings-2xl) !important }
|
|
34
|
+
.rebilly-instruments-helper-mr-0 { margin-right: 0!important }
|
|
35
|
+
.rebilly-instruments-helper-mb-xxs { margin-bottom: var(--rebilly-spacings-2xs) !important }
|
|
36
|
+
.rebilly-instruments-helper-mb-xs { margin-bottom: var(--rebilly-spacings-xs) !important }
|
|
37
|
+
.rebilly-instruments-helper-mb-s { margin-bottom: var(--rebilly-spacings-s) !important }
|
|
38
|
+
.rebilly-instruments-helper-mb-m { margin-bottom: var(--rebilly-spacings-base) !important }
|
|
39
|
+
.rebilly-instruments-helper-mb-l { margin-bottom: var(--rebilly-spacings-l) !important }
|
|
40
|
+
.rebilly-instruments-helper-mb-xl { margin-bottom: var(--rebilly-spacings-xl) !important }
|
|
41
|
+
.rebilly-instruments-helper-mb-xxl { margin-bottom: var(--rebilly-spacings-2xl) !important }
|
|
42
|
+
.rebilly-instruments-helper-mb-0 { margin-bottom: 0!important }
|
|
43
|
+
.rebilly-instruments-helper-ml-xxs { margin-left: var(--rebilly-spacings-2xs) !important }
|
|
44
|
+
.rebilly-instruments-helper-ml-xs { margin-left: var(--rebilly-spacings-xs) !important }
|
|
45
|
+
.rebilly-instruments-helper-ml-s { margin-left: var(--rebilly-spacings-s) !important }
|
|
46
|
+
.rebilly-instruments-helper-ml-m { margin-left: var(--rebilly-spacings-base) !important }
|
|
47
|
+
.rebilly-instruments-helper-ml-l { margin-left: var(--rebilly-spacings-l) !important }
|
|
48
|
+
.rebilly-instruments-helper-ml-xl { margin-left: var(--rebilly-spacings-xl) !important }
|
|
49
|
+
.rebilly-instruments-helper-ml-xxl { margin-left: var(--rebilly-spacings-2xl) !important }
|
|
50
|
+
.rebilly-instruments-helper-ml-0 { margin-left: 0!important }
|
|
51
|
+
`;
|
package/src/style/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import postcss from 'postcss';
|
|
2
2
|
import autoprefixer from 'autoprefixer';
|
|
3
3
|
import { browserslist } from './browserslist';
|
|
4
|
+
import removeEmptyAndNull from './utils/remove-empty-null';
|
|
4
5
|
|
|
5
6
|
import { Theme } from './base/theme';
|
|
6
7
|
import { base } from './base';
|
|
@@ -24,7 +25,7 @@ export const mainStyle = async (themeOverride) => {
|
|
|
24
25
|
${helpers(resolvedTheme)}
|
|
25
26
|
`;
|
|
26
27
|
|
|
27
|
-
return postcss([autoprefixer(browserslist)])
|
|
28
|
+
return postcss([removeEmptyAndNull, autoprefixer(browserslist)])
|
|
28
29
|
.process(style, { from: undefined })
|
|
29
30
|
.then((result) => result.css);
|
|
30
31
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const paymentCard = (
|
|
1
|
+
export const paymentCard = () => `
|
|
2
2
|
/**
|
|
3
3
|
* Payment card
|
|
4
4
|
*/
|
|
@@ -6,18 +6,18 @@ export const paymentCard = (theme) => `
|
|
|
6
6
|
display: inline-flex;
|
|
7
7
|
width: 100%;
|
|
8
8
|
justify-content: flex-end;
|
|
9
|
-
margin-top:
|
|
9
|
+
margin-top: var(--rebilly-spacings-s);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.rebilly-instruments-payment-card-brands figure {
|
|
13
|
-
margin: 0 0 0
|
|
13
|
+
margin: 0 0 0 var(--rebilly-spacings-2xs);
|
|
14
14
|
padding: 0;
|
|
15
15
|
height: 26px;
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
.rebilly-instruments-payment-card-brands figure img {
|
|
19
19
|
width: 42px;
|
|
20
|
-
border-radius:
|
|
20
|
+
border-radius: 4px;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
.rebilly-instruments-modal-container.rebilly-instruments-payment-card {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export default class Border {
|
|
2
|
+
allStyles = ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset', 'initial', 'inherit'];
|
|
3
|
+
|
|
4
|
+
constructor(str) {
|
|
5
|
+
this.str = str || '';
|
|
6
|
+
|
|
7
|
+
const style = this.allStyles.find(s => this.str.includes(s));
|
|
8
|
+
const borderProps = this.str.split(style).map(a => a.trim());
|
|
9
|
+
this.border = [borderProps[0], style, borderProps[1]];
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
get stylePosition() {
|
|
13
|
+
let stylePosition = 0;
|
|
14
|
+
if(this.border.length === 3) {
|
|
15
|
+
stylePosition = 1;
|
|
16
|
+
} else if(this.border.length === 2) {
|
|
17
|
+
if(this.allStyles.includes(this.border[0])) {
|
|
18
|
+
stylePosition = 0;
|
|
19
|
+
} else {
|
|
20
|
+
stylePosition = 1;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
return stylePosition;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
updateColor(color) {
|
|
27
|
+
this.border[this.stylePosition + 1] = color;
|
|
28
|
+
return this;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
get value() {
|
|
32
|
+
return this.border.join(' ');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -3,7 +3,33 @@ import Values from 'values.js';
|
|
|
3
3
|
export const colorValues = (color) => new Values(color);
|
|
4
4
|
|
|
5
5
|
export function alphaColor(color, alphaValue = 1) {
|
|
6
|
-
|
|
6
|
+
if(color === null) {
|
|
7
|
+
return color;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
const _alphaColor = colorValues(color);
|
|
7
11
|
_alphaColor.alpha = alphaValue;
|
|
8
12
|
return _alphaColor.rgbString();
|
|
9
13
|
}
|
|
14
|
+
|
|
15
|
+
export const mutedTextColor = (color) => alphaColor(color, 0.6);
|
|
16
|
+
|
|
17
|
+
export const mutedBorderColor = (color) => alphaColor(color, 0.25);
|
|
18
|
+
|
|
19
|
+
export const darken = (color, percent) => {
|
|
20
|
+
if(color === null) {
|
|
21
|
+
return color;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const _color = colorValues(color);
|
|
25
|
+
return _color.shade(percent).hexString()
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export const lighten = (color, percent) => {
|
|
29
|
+
if(color === null) {
|
|
30
|
+
return color;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const _color = colorValues(color);
|
|
34
|
+
return _color.tint(percent).hexString()
|
|
35
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import postcss from 'postcss';
|
|
2
|
+
|
|
3
|
+
export default postcss.plugin('postcss-remove-empty-null', () => (root) => {
|
|
4
|
+
root.walkDecls(decl => {
|
|
5
|
+
if ((decl.value === '\'\'' || decl.value === '""' || decl.value.includes('null')) && decl.prop !== 'content') {
|
|
6
|
+
decl.remove();
|
|
7
|
+
}
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
);
|
|
@@ -1,19 +1,22 @@
|
|
|
1
|
-
export const framepayStyle = (
|
|
1
|
+
export const framepayStyle = () => `
|
|
2
2
|
.rebilly-instruments-framepay .rebilly-framepay {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
border: 1px solid ${theme.getComputed.color.mutedBorder};
|
|
3
|
+
min-height: var(--rebilly-spacings-form-element-min-height);
|
|
4
|
+
border: var(--rebilly-inputBorder);
|
|
6
5
|
margin-bottom: 0;
|
|
7
|
-
background:
|
|
6
|
+
background: var(--rebilly-inputColorBackground);
|
|
7
|
+
border-radius: var(--rebilly-inputBorderRadius);
|
|
8
|
+
box-shadow: var(--rebilly-inputBoxShadow);
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.rebilly-instruments-framepay .rebilly-framepay.rebilly-framepay-focus {
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
background: var(--rebilly-inputFocusColorBackground);
|
|
13
|
+
border: var(--rebilly-inputFocusBorder);
|
|
14
|
+
border-radius: var(--rebilly-inputFocusBorderRadius);
|
|
15
|
+
box-shadow: var(--rebilly-inputFocusBoxShadow);
|
|
13
16
|
}
|
|
14
17
|
|
|
15
18
|
.rebilly-instruments-framepay .rebilly-framepay.rebilly-framepay-invalid {
|
|
16
|
-
border:
|
|
19
|
+
border-color: var(--rebilly-colorDanger);
|
|
17
20
|
box-shadow: none;
|
|
18
21
|
}
|
|
19
22
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export const postmateStyle = (
|
|
1
|
+
export const postmateStyle = () => `
|
|
2
2
|
.rebilly-instruments-iframe {
|
|
3
3
|
border: none;
|
|
4
4
|
width: 100%;
|
|
5
|
-
min-height:
|
|
5
|
+
min-height: var(--rebilly-spacings-form-element-min-height);
|
|
6
6
|
transition: all 0.2s ease;
|
|
7
7
|
}
|
|
8
8
|
`;
|