@rebilly/instruments 1.0.2-beta.1 → 1.0.2-beta.10
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/.babelrc +13 -4
- package/.eslintrc.js +27 -0
- package/.prettierrc.js +11 -0
- package/CONTRIBUTING.md +4 -0
- package/README.md +350 -0
- package/dist/events/base-event.js +40 -11
- package/dist/events/events.spec.js +18 -0
- package/dist/events/index.js +10 -7
- package/dist/functions/destroy.js +27 -5
- package/dist/functions/destroy.spec.js +69 -0
- package/dist/functions/initialize.js +24 -20
- package/dist/functions/initialize.spec.js +4 -4
- package/dist/functions/mount/fetch-summary-data.js +26 -11
- package/dist/functions/mount/fetch-summary-data.spec.js +15 -16
- package/dist/functions/mount/index.js +168 -106
- package/dist/functions/mount/mount.spec.js +14 -36
- package/dist/functions/on.js +25 -17
- package/dist/functions/on.spec.js +36 -18
- package/dist/functions/purchase.js +33 -74
- package/dist/functions/purchase.spec.js +17 -14
- package/dist/functions/show.js +31 -8
- package/dist/functions/show.spec.js +42 -17
- package/dist/functions/update.js +60 -4
- package/dist/functions/update.spec.js +100 -0
- package/dist/i18n/en.json +19 -0
- package/dist/i18n/es.json +19 -0
- package/dist/i18n/index.js +5 -0
- package/dist/index.js +67 -55
- package/dist/index.spec.js +6 -10
- package/dist/loader/index.js +24 -4
- package/dist/loader/loader.spec.js +4 -4
- package/dist/storefront/models/ready-to-pay-model.js +7 -1
- package/dist/storefront/plans.js +9 -10
- package/dist/storefront/plans.spec.js +20 -20
- package/dist/storefront/products.js +9 -10
- package/dist/storefront/products.spec.js +20 -20
- package/dist/storefront/purchase.js +9 -8
- package/dist/storefront/purchase.spec.js +7 -4
- package/dist/storefront/ready-to-pay.js +12 -11
- package/dist/storefront/ready-to-pay.spec.js +24 -19
- package/dist/storefront/storefront.spec.js +1 -1
- package/dist/storefront/summary.js +11 -12
- package/dist/storefront/summary.spec.js +25 -24
- package/dist/style/base/__snapshots__/theme.spec.js.snap +52 -0
- package/dist/style/base/index.js +72 -0
- package/dist/style/base/theme.js +73 -0
- package/dist/style/base/theme.spec.js +30 -0
- package/dist/style/browserslist.js +8 -0
- package/dist/style/components/address.js +64 -0
- package/dist/style/components/button.js +61 -0
- package/dist/style/components/divider.js +48 -0
- package/dist/style/components/forms/checkbox.js +83 -0
- package/dist/style/components/forms/field.js +53 -0
- package/dist/style/components/forms/form.js +28 -0
- package/dist/style/components/forms/input.js +45 -0
- package/dist/style/components/forms/label.js +43 -0
- package/dist/style/components/forms/select.js +63 -0
- package/dist/style/components/forms/validation.js +34 -0
- package/dist/style/components/icons.js +22 -0
- package/dist/style/components/index.js +57 -0
- package/dist/style/components/loader.js +48 -0
- package/dist/style/components/methods.js +104 -0
- package/dist/style/components/overlay.js +33 -0
- package/dist/style/helpers/index.js +59 -0
- package/dist/style/index.js +48 -0
- package/dist/style/payment-instruments/content.js +17 -0
- package/dist/style/payment-instruments/index.js +20 -0
- package/dist/{styles → style/payment-instruments}/payment-card.js +14 -6
- package/dist/{styles/shade-tint-values-helper.js → style/utils/color-values.js} +5 -9
- package/dist/style/vendor/framepay.js +34 -0
- package/dist/style/vendor/postmate.js +17 -0
- package/dist/style/views/confirmation.js +85 -0
- package/dist/style/views/index.js +29 -0
- package/dist/style/views/method-selector.js +20 -0
- package/dist/style/views/modal.js +93 -0
- package/dist/style/views/result.js +61 -0
- package/dist/style/views/summary.js +123 -0
- package/dist/utils/format-currency.js +1 -0
- package/dist/utils/has-valid-css-selector.js +1 -1
- package/dist/utils/index.js +3 -19
- package/dist/utils/process-property-as-dom-element.js +0 -2
- package/dist/utils/sleep.js +10 -0
- package/{src/components → dist/views}/__snapshots__/summary.spec.js.snap +7 -3
- package/dist/views/common/iframe/base-iframe.js +57 -0
- package/dist/views/common/iframe/event-listeners.js +50 -0
- package/dist/views/common/iframe/index.js +19 -0
- package/dist/views/common/iframe/method-iframe.js +33 -0
- package/dist/views/common/iframe/modal-iframe.js +38 -0
- package/dist/views/common/iframe/view-iframe.js +31 -0
- package/dist/views/common/render-utilities.js +11 -0
- package/dist/views/confirmation.js +82 -0
- package/dist/views/method-selector/__snapshots__/method-selector.spec.js.snap +3 -0
- package/dist/views/method-selector/express-methods/apple-pay.js +92 -0
- package/dist/views/method-selector/express-methods/google-pay.js +32 -0
- package/dist/views/method-selector/express-methods/paypal.js +19 -0
- package/dist/views/method-selector/generate-digital-wallet.js +59 -0
- package/dist/views/method-selector/generate-digital-wallet.spec.js +132 -0
- package/dist/views/method-selector/get-method-data.js +25 -0
- package/dist/{components/form → views/method-selector}/get-payment-methods.js +22 -6
- package/dist/views/method-selector/get-payment-methods.spec.js +44 -0
- package/dist/views/method-selector/index.js +133 -0
- package/dist/views/method-selector/method-selector.spec.js +139 -0
- package/dist/views/method-selector/mount-express-methods.js +69 -0
- package/dist/views/method-selector/mount-methods.js +78 -0
- package/dist/views/modal.js +83 -0
- package/dist/views/result.js +42 -0
- package/dist/{components → views}/summary.js +36 -25
- package/dist/{components → views}/summary.spec.js +49 -22
- package/package.json +11 -5
- package/src/events/base-event.js +35 -12
- package/src/events/events.spec.js +11 -0
- package/src/events/index.js +12 -6
- package/src/functions/destroy.js +22 -3
- package/src/functions/destroy.spec.js +63 -0
- package/src/functions/initialize.js +23 -18
- package/src/functions/initialize.spec.js +9 -7
- package/src/functions/mount/fetch-summary-data.js +16 -13
- package/src/functions/mount/fetch-summary-data.spec.js +22 -27
- package/src/functions/mount/index.js +194 -133
- package/src/functions/mount/mount.spec.js +83 -84
- package/src/functions/on.js +17 -14
- package/src/functions/on.spec.js +39 -29
- package/src/functions/purchase.js +24 -64
- package/src/functions/purchase.spec.js +19 -17
- package/src/functions/show.js +26 -6
- package/src/functions/show.spec.js +41 -19
- package/src/functions/update.js +49 -3
- package/src/functions/update.spec.js +107 -0
- package/src/i18n/i18n.spec.js +6 -4
- package/src/i18n/index.js +19 -11
- package/src/index.js +42 -51
- package/src/index.spec.js +11 -20
- package/src/loader/index.js +55 -39
- package/src/loader/loader.spec.js +30 -23
- package/src/storefront/index.js +9 -7
- package/src/storefront/models/plan-model.js +1 -1
- package/src/storefront/models/product-model.js +1 -1
- package/src/storefront/models/ready-to-pay-model.js +10 -4
- package/src/storefront/models/summary-model.js +8 -15
- package/src/storefront/plans.js +16 -12
- package/src/storefront/plans.spec.js +29 -37
- package/src/storefront/products.js +16 -12
- package/src/storefront/products.spec.js +28 -39
- package/src/storefront/purchase.js +8 -6
- package/src/storefront/purchase.spec.js +18 -17
- package/src/storefront/ready-to-pay.js +19 -13
- package/src/storefront/ready-to-pay.spec.js +41 -41
- package/src/storefront/storefront.spec.js +1 -1
- package/src/storefront/summary.js +14 -12
- package/src/storefront/summary.spec.js +37 -50
- package/src/style/base/__snapshots__/theme.spec.js.snap +52 -0
- package/src/style/base/index.js +63 -0
- package/src/style/base/theme.js +61 -0
- package/src/style/base/theme.spec.js +32 -0
- package/src/style/browserslist.js +1 -0
- package/src/style/components/address.js +55 -0
- package/src/style/components/button.js +54 -0
- package/src/style/components/divider.js +39 -0
- package/src/style/components/forms/checkbox.js +76 -0
- package/src/style/components/forms/field.js +44 -0
- package/src/style/components/forms/form.js +19 -0
- package/src/style/components/forms/input.js +36 -0
- package/src/style/components/forms/label.js +34 -0
- package/src/style/components/forms/select.js +54 -0
- package/src/style/components/forms/validation.js +25 -0
- package/src/style/components/icons.js +13 -0
- package/src/style/components/index.js +35 -0
- package/src/style/components/loader.js +41 -0
- package/src/style/components/methods.js +93 -0
- package/src/style/components/overlay.js +24 -0
- package/src/style/helpers/index.js +51 -0
- package/src/style/index.js +30 -0
- package/src/style/payment-instruments/content.js +8 -0
- package/src/style/payment-instruments/index.js +10 -0
- package/src/style/payment-instruments/payment-card.js +26 -0
- package/src/style/utils/color-values.js +9 -0
- package/src/style/vendor/framepay.js +25 -0
- package/src/style/vendor/postmate.js +8 -0
- package/src/style/views/confirmation.js +76 -0
- package/src/style/views/index.js +16 -0
- package/src/style/views/method-selector.js +11 -0
- package/src/style/views/modal.js +84 -0
- package/src/style/views/result.js +52 -0
- package/src/style/views/summary.js +114 -0
- package/src/utils/add-dom-element.js +12 -13
- package/src/utils/format-currency.js +4 -1
- package/src/utils/has-valid-css-selector.js +2 -2
- package/src/utils/index.js +2 -6
- package/src/utils/is-dom-element.js +1 -1
- package/src/utils/process-property-as-dom-element.js +27 -24
- package/src/utils/sleep.js +3 -0
- package/src/views/__snapshots__/summary.spec.js.snap +292 -0
- package/src/views/common/iframe/base-iframe.js +46 -0
- package/src/views/common/iframe/event-listeners.js +27 -0
- package/src/views/common/iframe/index.js +7 -0
- package/src/views/common/iframe/method-iframe.js +21 -0
- package/src/views/common/iframe/modal-iframe.js +27 -0
- package/src/views/common/iframe/view-iframe.js +18 -0
- package/src/views/common/render-utilities.js +4 -0
- package/src/views/confirmation.js +57 -0
- package/src/views/method-selector/__snapshots__/method-selector.spec.js.snap +3 -0
- package/src/views/method-selector/express-methods/apple-pay.js +78 -0
- package/src/views/method-selector/express-methods/google-pay.js +25 -0
- package/src/views/method-selector/express-methods/paypal.js +7 -0
- package/src/views/method-selector/generate-digital-wallet.js +44 -0
- package/src/views/method-selector/generate-digital-wallet.spec.js +131 -0
- package/src/{components/form → views/method-selector}/get-method-data.js +9 -5
- package/src/views/method-selector/get-payment-methods.js +40 -0
- package/src/views/method-selector/get-payment-methods.spec.js +40 -0
- package/src/views/method-selector/index.js +110 -0
- package/src/views/method-selector/method-selector.spec.js +146 -0
- package/src/views/method-selector/mount-express-methods.js +53 -0
- package/src/views/method-selector/mount-methods.js +71 -0
- package/src/views/modal.js +84 -0
- package/src/views/result.js +30 -0
- package/src/{components → views}/summary.js +65 -33
- package/src/views/summary.spec.js +170 -0
- package/tests/async-utilities.js +22 -0
- package/tests/mocks/rebilly-instruments-mock.js +105 -7
- package/dist/components/confirmation.js +0 -113
- package/dist/components/form/form.js +0 -143
- package/dist/components/form/form.spec.js +0 -111
- package/dist/components/form/get-method-data.js +0 -21
- package/dist/components/form/method-selector.js +0 -60
- package/dist/components/form/mount-express-payment-methods.js +0 -102
- package/dist/components/form/process-digital-wallet-options.js +0 -24
- package/dist/components/form/zoid-helpers.js +0 -131
- package/dist/components/result.js +0 -68
- package/dist/events/instrument-ready.js +0 -24
- package/dist/events/purchase-complete.js +0 -24
- package/dist/styles/base-styles.js +0 -793
- package/dist/styles/flat-theme-object.js +0 -23
- package/dist/styles/framepay.js +0 -38
- package/dist/styles/main.js +0 -29
- package/dist/styles/style-variables.js +0 -44
- package/dist/utils/camel-case.js +0 -10
- package/dist/utils/kebab-case.js +0 -10
- package/dist/utils/un-kebab-case.js +0 -10
- package/src/components/confirmation.js +0 -81
- package/src/components/form/__snapshots__/form.spec.js.snap +0 -43
- package/src/components/form/form.js +0 -117
- package/src/components/form/form.spec.js +0 -109
- package/src/components/form/get-payment-methods.js +0 -32
- package/src/components/form/method-selector.js +0 -47
- package/src/components/form/mount-express-payment-methods.js +0 -84
- package/src/components/form/process-digital-wallet-options.js +0 -11
- package/src/components/form/zoid-helpers.js +0 -117
- package/src/components/result.js +0 -50
- package/src/components/summary.spec.js +0 -106
- package/src/events/instrument-ready.js +0 -11
- package/src/events/purchase-complete.js +0 -11
- package/src/styles/base-styles.js +0 -784
- package/src/styles/flat-theme-object.js +0 -12
- package/src/styles/framepay.js +0 -30
- package/src/styles/main.js +0 -17
- package/src/styles/payment-card.js +0 -18
- package/src/styles/shade-tint-values-helper.js +0 -13
- package/src/styles/style-variables.js +0 -34
- package/src/utils/camel-case.js +0 -3
- package/src/utils/kebab-case.js +0 -3
- package/src/utils/un-kebab-case.js +0 -3
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the input component.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const input = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Input
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-form-field-input {
|
|
9
|
+
font-size: ${theme.typography.fontSize};
|
|
10
|
+
line-height: ${theme.typography.lineHeight};
|
|
11
|
+
padding: ${theme.space.form.padding};
|
|
12
|
+
min-height: ${theme.space.form.minHeight};
|
|
13
|
+
border: 1px solid ${theme.getComputed.color.mutedBorder};
|
|
14
|
+
border-radius: ${theme.borderRadius};
|
|
15
|
+
color: ${theme.color.text};
|
|
16
|
+
background: transparent;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
width: 100%;
|
|
19
|
+
transition: all 200ms;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.rebilly-instruments-form-field-input:focus {
|
|
23
|
+
outline: none;
|
|
24
|
+
border: 1px solid ${theme.color.primary};
|
|
25
|
+
box-shadow: 0 0 0 1px ${theme.color.primary};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.rebilly-instruments-form-field-input::placeholder {
|
|
29
|
+
color: ${theme.color.text};
|
|
30
|
+
opacity: 0.5;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.rebilly-instruments-form-field-input:disabled {
|
|
34
|
+
opacity: 0.6;
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the label component.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const label = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Label
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-form-field-label {
|
|
9
|
+
left: ${theme.space.form.horizontalPadding};
|
|
10
|
+
color: ${theme.color.text};
|
|
11
|
+
top: calc(${theme.space.form.minHeight} / 2);
|
|
12
|
+
background: transparent;
|
|
13
|
+
opacity: 0;
|
|
14
|
+
position: absolute;
|
|
15
|
+
transform: translateY(-50%);
|
|
16
|
+
transition: all 200ms;
|
|
17
|
+
cursor: text;
|
|
18
|
+
pointer-events: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rebilly-instruments-form-field-input:not(:placeholder-shown) + .rebilly-instruments-form-field-label,
|
|
22
|
+
.rebilly-instruments-form-field-select:focus + .rebilly-instruments-form-field-label,
|
|
23
|
+
.rebilly-instruments-form-field-label.is-active {
|
|
24
|
+
padding: 0 ${theme.space.xxs};
|
|
25
|
+
left: calc(${theme.space.form.horizontalPadding} - ${theme.space.xxs});
|
|
26
|
+
font-size: ${theme.typography.captionFontSize};
|
|
27
|
+
line-height: ${theme.typography.captionLineHeight};
|
|
28
|
+
color: ${theme.color.text};
|
|
29
|
+
background: ${theme.color.background};
|
|
30
|
+
font-weight: 500;
|
|
31
|
+
opacity: 1;
|
|
32
|
+
top: 0;
|
|
33
|
+
}
|
|
34
|
+
`;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the select component.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const select = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Select
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-form-field-select {
|
|
9
|
+
font-size: ${theme.typography.fontSize};
|
|
10
|
+
line-height: ${theme.typography.lineHeight};
|
|
11
|
+
padding: ${theme.space.form.padding};
|
|
12
|
+
min-height: ${theme.space.form.minHeight};
|
|
13
|
+
border: 1px solid ${theme.getComputed.color.mutedBorder};
|
|
14
|
+
border-radius: ${theme.borderRadius};
|
|
15
|
+
color: ${theme.color.text};
|
|
16
|
+
background: transparent;
|
|
17
|
+
box-sizing: border-box;
|
|
18
|
+
width: 100%;
|
|
19
|
+
transition: all 200ms;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.rebilly-instruments-form-field-select:focus {
|
|
23
|
+
outline: none;
|
|
24
|
+
border: 1px solid ${theme.color.primary};
|
|
25
|
+
box-shadow: 0 0 0 1px ${theme.color.primary};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.rebilly-instruments-form-field-select:disabled {
|
|
29
|
+
opacity: 0.6;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.rebilly-instruments-form-field-select {
|
|
33
|
+
-webkit-appearance: none;
|
|
34
|
+
-moz-appearance: none;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.rebilly-instruments-form-field-select + .rebilly-instruments-form-field-label {
|
|
38
|
+
font-size: ${theme.typography.fontSize};
|
|
39
|
+
opacity: 0.5;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.rebilly-instruments-form-field-select::-ms-expand { display: none; }
|
|
43
|
+
|
|
44
|
+
.rebilly-instruments-form-field-select-arrow {
|
|
45
|
+
border: solid ${theme.color.text};
|
|
46
|
+
position: absolute;
|
|
47
|
+
width: 8px;
|
|
48
|
+
height: 8px;
|
|
49
|
+
border-width: 0 2px 2px 0;
|
|
50
|
+
transform: rotate(45deg);
|
|
51
|
+
right: 16px;
|
|
52
|
+
top: 16px;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the form validations.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const validation = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Validations
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input,
|
|
9
|
+
.rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select {
|
|
10
|
+
border-color: ${theme.color.errorText};
|
|
11
|
+
color: ${theme.color.errorText};
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.rebilly-instruments-form-field-error-wrapper {
|
|
15
|
+
margin-top: ${theme.space.xxs};
|
|
16
|
+
margin-bottom: calc(${theme.space.xxs} + ${theme.space.s});
|
|
17
|
+
padding: 0;
|
|
18
|
+
list-style: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.rebilly-instruments-form-field-error-wrapper > li {
|
|
22
|
+
color: ${theme.color.errorText};
|
|
23
|
+
padding: 0;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the icons component.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const icons = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Icons
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-icon {
|
|
9
|
+
width: ${theme.typography.lineHeight};
|
|
10
|
+
height: ${theme.typography.lineHeight};
|
|
11
|
+
fill: ${theme.color.text};
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { expressMethods, methods } from './methods';
|
|
2
|
+
import { form } from './forms/form';
|
|
3
|
+
import { checkbox } from './forms/checkbox';
|
|
4
|
+
import { field } from './forms/field';
|
|
5
|
+
import { input } from './forms/input';
|
|
6
|
+
import { label } from './forms/label';
|
|
7
|
+
import { select } from './forms/select';
|
|
8
|
+
import { validation } from './forms/validation';
|
|
9
|
+
import { button } from './button';
|
|
10
|
+
import { divider } from './divider';
|
|
11
|
+
import { loader } from './loader';
|
|
12
|
+
import { icons } from './icons';
|
|
13
|
+
import { address } from './address';
|
|
14
|
+
import { overlay } from './overlay';
|
|
15
|
+
|
|
16
|
+
// Order of components matters for style cascade
|
|
17
|
+
export const components = (theme) => `
|
|
18
|
+
/* Components
|
|
19
|
+
------------------------------------------------------------ */
|
|
20
|
+
${expressMethods(theme)}
|
|
21
|
+
${methods()}
|
|
22
|
+
${form(theme)}
|
|
23
|
+
${field(theme)}
|
|
24
|
+
${input(theme)}
|
|
25
|
+
${select(theme)}
|
|
26
|
+
${label(theme)}
|
|
27
|
+
${checkbox(theme)}
|
|
28
|
+
${validation(theme)}
|
|
29
|
+
${button(theme)}
|
|
30
|
+
${divider(theme)}
|
|
31
|
+
${loader(theme)}
|
|
32
|
+
${icons(theme)}
|
|
33
|
+
${address(theme)}
|
|
34
|
+
${overlay(theme)}
|
|
35
|
+
`;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the loader component.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const loader = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Loader
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-loader {
|
|
9
|
+
display: none;
|
|
10
|
+
position: absolute;
|
|
11
|
+
top: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
left: 0;
|
|
14
|
+
right: 0;
|
|
15
|
+
justify-content: center;
|
|
16
|
+
align-items: center;
|
|
17
|
+
background-color: ${theme.color.background};
|
|
18
|
+
z-index: 9000;
|
|
19
|
+
transition: all 200ms;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.rebilly-instruments-loader.is-active {
|
|
23
|
+
display: flex;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.rebilly-instruments-loader-spinner {
|
|
27
|
+
border: 4px solid ${theme.getComputed.color.primaryValues
|
|
28
|
+
.tint(80)
|
|
29
|
+
.hexString()};
|
|
30
|
+
border-top: 4px solid ${theme.color.primary};
|
|
31
|
+
border-radius: 50%;
|
|
32
|
+
width: 40px;
|
|
33
|
+
height: 40px;
|
|
34
|
+
animation: spin 0.5s ease infinite;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
@keyframes spin {
|
|
38
|
+
0% { transform: rotate(0deg); }
|
|
39
|
+
100% { transform: rotate(360deg); }
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the methods component.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const expressMethods = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Express methods
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
@keyframes rebillyExpressShine {
|
|
10
|
+
to {
|
|
11
|
+
background-position-x: -200%;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rebilly-instruments-express-methods.is-compact {
|
|
16
|
+
border: 1px solid ${theme.getComputed.color.mutedBorder};
|
|
17
|
+
padding: calc(${theme.space.xs} + ${theme.space.s}) ${theme.space.s} ${theme.space.s};
|
|
18
|
+
border-radius: ${theme.borderRadius};
|
|
19
|
+
position: relative;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.rebilly-instruments-express-methods iframe {
|
|
23
|
+
display: block;
|
|
24
|
+
margin-bottom: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {
|
|
28
|
+
border-radius: 6px;
|
|
29
|
+
margin-bottom: ${theme.space.xs};
|
|
30
|
+
background: linear-gradient(110deg, ${theme.getComputed.color.mutedBorder} 0%, ${theme.color.background} 25%, ${theme.getComputed.color.mutedBorder} 50%);
|
|
31
|
+
background-size: 200% 100%;
|
|
32
|
+
animation: 1.5s rebillyExpressShine linear infinite;
|
|
33
|
+
}
|
|
34
|
+
.rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {
|
|
35
|
+
margin: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {
|
|
39
|
+
display: flex;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {
|
|
44
|
+
flex: 1 1 0px;
|
|
45
|
+
max-width: 260px;
|
|
46
|
+
margin: 0 ${theme.space.xs};
|
|
47
|
+
}
|
|
48
|
+
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {
|
|
49
|
+
margin-left: 0;
|
|
50
|
+
}
|
|
51
|
+
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {
|
|
52
|
+
margin-right: 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.rebilly-instruments-express-methods .rebilly-instruments-express-methods-label {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {
|
|
59
|
+
position: absolute;
|
|
60
|
+
top: -12px; left: 50%;
|
|
61
|
+
transform: translateX(-50%);
|
|
62
|
+
color: ${theme.color.text};
|
|
63
|
+
padding: 0 ${theme.space.s};
|
|
64
|
+
line-height: ${theme.typography.lineHeight};
|
|
65
|
+
background: ${theme.color.background};
|
|
66
|
+
display: inline-block;
|
|
67
|
+
font-weight: 500;
|
|
68
|
+
min-height: auto;
|
|
69
|
+
margin: 0;
|
|
70
|
+
border: 1px soplid red;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
@media (max-width: 600px) {
|
|
74
|
+
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container {
|
|
75
|
+
flex-direction: column;
|
|
76
|
+
}
|
|
77
|
+
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {
|
|
78
|
+
max-width: 100%;
|
|
79
|
+
margin: 0 0 ${theme.space.xs};
|
|
80
|
+
}
|
|
81
|
+
.rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {
|
|
82
|
+
margin: 0;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
`;
|
|
86
|
+
|
|
87
|
+
export const methods = () => `
|
|
88
|
+
/**
|
|
89
|
+
* Methods
|
|
90
|
+
*/
|
|
91
|
+
|
|
92
|
+
.rebilly-instruments-methods {}
|
|
93
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the overlay component.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const overlay = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Overlay
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-overlay {
|
|
9
|
+
position: fixed;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
top: 0;
|
|
13
|
+
bottom: 0;
|
|
14
|
+
background: rgba(0,0,0,0.8);
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: center;
|
|
17
|
+
align-items: center;
|
|
18
|
+
color: #ffffff;
|
|
19
|
+
font-family: ${theme.typography.fontFamily};
|
|
20
|
+
font-size: calc(${theme.typography.fontSize} * 1.12);
|
|
21
|
+
line-height: ${theme.typography.lineHeight};
|
|
22
|
+
z-index: 9001
|
|
23
|
+
}
|
|
24
|
+
`;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to helpers.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
|
|
5
|
+
export const helpers = (theme) => `
|
|
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
|
+
|
|
19
|
+
.rebilly-instruments-helper-mt-xxs { margin-top: ${theme.space.xxs}!important }
|
|
20
|
+
.rebilly-instruments-helper-mt-xs { margin-top: ${theme.space.xs}!important }
|
|
21
|
+
.rebilly-instruments-helper-mt-s { margin-top: ${theme.space.s}!important }
|
|
22
|
+
.rebilly-instruments-helper-mt-m { margin-top: ${theme.space.m}!important }
|
|
23
|
+
.rebilly-instruments-helper-mt-l { margin-top: ${theme.space.l}!important }
|
|
24
|
+
.rebilly-instruments-helper-mt-xl { margin-top: ${theme.space.xl}!important }
|
|
25
|
+
.rebilly-instruments-helper-mt-xxl { margin-top: ${theme.space.xxl}!important }
|
|
26
|
+
.rebilly-instruments-helper-mt-0 { margin-top: 0!important }
|
|
27
|
+
.rebilly-instruments-helper-mr-xxs { margin-right: ${theme.space.xxs}!important }
|
|
28
|
+
.rebilly-instruments-helper-mr-xs { margin-right: ${theme.space.xs}!important }
|
|
29
|
+
.rebilly-instruments-helper-mr-s { margin-right: ${theme.space.s}!important }
|
|
30
|
+
.rebilly-instruments-helper-mr-m { margin-right: ${theme.space.m}!important }
|
|
31
|
+
.rebilly-instruments-helper-mr-l { margin-right: ${theme.space.l}!important }
|
|
32
|
+
.rebilly-instruments-helper-mr-xl { margin-right: ${theme.space.xl}!important }
|
|
33
|
+
.rebilly-instruments-helper-mr-xxl { margin-right: ${theme.space.xxl}!important }
|
|
34
|
+
.rebilly-instruments-helper-mr-0 { margin-right: 0!important }
|
|
35
|
+
.rebilly-instruments-helper-mb-xxs { margin-bottom: ${theme.space.xxs}!important }
|
|
36
|
+
.rebilly-instruments-helper-mb-xs { margin-bottom: ${theme.space.xs}!important }
|
|
37
|
+
.rebilly-instruments-helper-mb-s { margin-bottom: ${theme.space.s}!important }
|
|
38
|
+
.rebilly-instruments-helper-mb-m { margin-bottom: ${theme.space.m}!important }
|
|
39
|
+
.rebilly-instruments-helper-mb-l { margin-bottom: ${theme.space.l}!important }
|
|
40
|
+
.rebilly-instruments-helper-mb-xl { margin-bottom: ${theme.space.xl}!important }
|
|
41
|
+
.rebilly-instruments-helper-mb-xxl { margin-bottom: ${theme.space.xxl}!important }
|
|
42
|
+
.rebilly-instruments-helper-mb-0 { margin-bottom: 0!important }
|
|
43
|
+
.rebilly-instruments-helper-ml-xxs { margin-left: ${theme.space.xxs}!important }
|
|
44
|
+
.rebilly-instruments-helper-ml-xs { margin-left: ${theme.space.xs}!important }
|
|
45
|
+
.rebilly-instruments-helper-ml-s { margin-left: ${theme.space.s}!important }
|
|
46
|
+
.rebilly-instruments-helper-ml-m { margin-left: ${theme.space.m}!important }
|
|
47
|
+
.rebilly-instruments-helper-ml-l { margin-left: ${theme.space.l}!important }
|
|
48
|
+
.rebilly-instruments-helper-ml-xl { margin-left: ${theme.space.xl}!important }
|
|
49
|
+
.rebilly-instruments-helper-ml-xxl { margin-left: ${theme.space.xxl}!important }
|
|
50
|
+
.rebilly-instruments-helper-ml-0 { margin-left: 0!important }
|
|
51
|
+
`;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import postcss from 'postcss';
|
|
2
|
+
import autoprefixer from 'autoprefixer';
|
|
3
|
+
import { browserslist } from './browserslist';
|
|
4
|
+
|
|
5
|
+
import { Theme } from './base/theme';
|
|
6
|
+
import { base } from './base';
|
|
7
|
+
import { framepayStyle } from './vendor/framepay';
|
|
8
|
+
import { postmateStyle } from './vendor/postmate';
|
|
9
|
+
import { components } from './components';
|
|
10
|
+
import { paymentInstruments } from './payment-instruments';
|
|
11
|
+
import { views } from './views';
|
|
12
|
+
import { helpers } from './helpers';
|
|
13
|
+
|
|
14
|
+
export const mainStyle = async (themeOverride) => {
|
|
15
|
+
const resolvedTheme = new Theme(themeOverride).build();
|
|
16
|
+
|
|
17
|
+
const style = `
|
|
18
|
+
${base(resolvedTheme)}
|
|
19
|
+
${components(resolvedTheme)}
|
|
20
|
+
${views(resolvedTheme)}
|
|
21
|
+
${paymentInstruments(resolvedTheme)}
|
|
22
|
+
${framepayStyle(resolvedTheme)}
|
|
23
|
+
${postmateStyle(resolvedTheme)}
|
|
24
|
+
${helpers(resolvedTheme)}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
return postcss([autoprefixer(browserslist)])
|
|
28
|
+
.process(style, { from: undefined })
|
|
29
|
+
.then((result) => result.css);
|
|
30
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { methodContent } from './content';
|
|
2
|
+
import { paymentCard } from './payment-card';
|
|
3
|
+
|
|
4
|
+
// Order of components matters for style cascade
|
|
5
|
+
export const paymentInstruments = (theme) => `
|
|
6
|
+
/* Payment instruments
|
|
7
|
+
------------------------------------------------------------ */
|
|
8
|
+
${methodContent()}
|
|
9
|
+
${paymentCard(theme)}
|
|
10
|
+
`;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export const paymentCard = (theme) => `
|
|
2
|
+
/**
|
|
3
|
+
* Payment card
|
|
4
|
+
*/
|
|
5
|
+
.rebilly-instruments-payment-card-brands {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
width: 100%;
|
|
8
|
+
justify-content: flex-end;
|
|
9
|
+
margin-top: ${theme.space.s}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rebilly-instruments-payment-card-brands figure {
|
|
13
|
+
margin: 0 0 0 ${theme.space.xxs};
|
|
14
|
+
padding: 0;
|
|
15
|
+
height: 26px;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.rebilly-instruments-payment-card-brands figure img {
|
|
19
|
+
width: 42px;
|
|
20
|
+
border-radius: ${theme.borderRadius};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.rebilly-instruments-modal-container.rebilly-instruments-payment-card {
|
|
24
|
+
max-width: 600px;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const framepayStyle = (theme) => `
|
|
2
|
+
.rebilly-instruments-framepay .rebilly-framepay {
|
|
3
|
+
box-shadow: none;
|
|
4
|
+
min-height: ${theme.space.form.minHeight};
|
|
5
|
+
border: 1px solid ${theme.getComputed.color.mutedBorder};
|
|
6
|
+
margin-bottom: 0;
|
|
7
|
+
background: ${theme.color.background};
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.rebilly-instruments-framepay .rebilly-framepay.rebilly-framepay-focus {
|
|
11
|
+
border: 1px solid ${theme.color.primary};
|
|
12
|
+
box-shadow: 0 0 0 1px ${theme.color.primary};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.rebilly-instruments-framepay .rebilly-framepay.rebilly-framepay-invalid {
|
|
16
|
+
border: 1px solid ${theme.color.errorText};
|
|
17
|
+
box-shadow: none;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.rebilly-instruments-framepay .rebilly-framepay.rebilly-framepay-digital-wallet {
|
|
21
|
+
min-height: auto;
|
|
22
|
+
border: none;
|
|
23
|
+
margin: 0;
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the confirmation view.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const confirmation = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Confirmation
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-confirmation {
|
|
9
|
+
padding: 2px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.rebilly-instruments-confirmation-go-back-link {
|
|
13
|
+
display: inline-block;
|
|
14
|
+
margin-bottom: ${theme.space.m};
|
|
15
|
+
margin-left: -${theme.space.xs};
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.rebilly-instruments-confirmation-address-title {
|
|
19
|
+
display: flex;
|
|
20
|
+
justify-content: flex-start;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.rebilly-instruments-confirmation-address-title .rebilly-instruments-link {
|
|
24
|
+
margin-left: ${theme.space.s};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.rebilly-instruments-confirmation-address-actions {
|
|
28
|
+
margin-top: ${theme.space.m};
|
|
29
|
+
display: flex;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.rebilly-instruments-confirmation-address-actions :first-child {
|
|
33
|
+
margin: 0 ${theme.space.xs} 0 0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.rebilly-instruments-confirmation-address-actions :last-child {
|
|
37
|
+
margin: 0 0 0 ${theme.space.xs};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.rebilly-instruments-confirmation-payment-method {
|
|
41
|
+
display: inline-flex;
|
|
42
|
+
align-items: center;
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
height: 26px;
|
|
45
|
+
margin: 0 0 ${theme.space.l};
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.rebilly-instruments-confirmation-payment-method figure {
|
|
49
|
+
margin: 0 ${theme.space.xxs} 0 0;
|
|
50
|
+
height: 26px;
|
|
51
|
+
padding: 0;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.rebilly-instruments-confirmation-payment-method figure img {
|
|
55
|
+
width: 42px;
|
|
56
|
+
border-radius: ${theme.borderRadius};
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.rebilly-instruments-confirmation-payment-method-brand,
|
|
60
|
+
.rebilly-instruments-confirmation-payment-method-exp,
|
|
61
|
+
.rebilly-instruments-confirmation-payment-method-last4 {
|
|
62
|
+
display: inline-block;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.rebilly-instruments-confirmation-payment-method-brand {
|
|
66
|
+
margin: 0 0 0 ${theme.space.s};
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.rebilly-instruments-confirmation-payment-method-last4 {
|
|
70
|
+
margin: 0 ${theme.space.s};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.rebilly-instruments-confirmation-payment-method-exp {
|
|
74
|
+
color: ${theme.getComputed.color.mutedText};
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { summary } from './summary';
|
|
2
|
+
import { methodSelector } from './method-selector';
|
|
3
|
+
import { confirmation } from './confirmation';
|
|
4
|
+
import { result } from './result';
|
|
5
|
+
import { modal } from './modal';
|
|
6
|
+
|
|
7
|
+
// Order of components matters for style cascade
|
|
8
|
+
export const views = (theme) => `
|
|
9
|
+
/* Views
|
|
10
|
+
------------------------------------------------------------ */
|
|
11
|
+
${summary(theme)}
|
|
12
|
+
${methodSelector(theme)}
|
|
13
|
+
${confirmation(theme)}
|
|
14
|
+
${result(theme)}
|
|
15
|
+
${modal(theme)}
|
|
16
|
+
`;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// -----------------------------------------------------------------------------
|
|
2
|
+
// This file contains all styles related to the selector view.
|
|
3
|
+
// -----------------------------------------------------------------------------
|
|
4
|
+
export const methodSelector = (theme) => `
|
|
5
|
+
/**
|
|
6
|
+
* Method selector
|
|
7
|
+
*/
|
|
8
|
+
.rebilly-instruments-method-selector {
|
|
9
|
+
padding-top: ${theme.space.s};
|
|
10
|
+
}
|
|
11
|
+
`;
|