@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
package/dist/style/base/index.js
CHANGED
|
@@ -6,6 +6,33 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.base = void 0;
|
|
7
7
|
|
|
8
8
|
const base = theme => `
|
|
9
|
+
/* Instruments 'global' variables
|
|
10
|
+
------------------------------------------------------------ */
|
|
11
|
+
:root,
|
|
12
|
+
#rebilly-instruments-app,
|
|
13
|
+
.rebilly-instruments-content,
|
|
14
|
+
.rebilly-instruments-loader,
|
|
15
|
+
.rebilly-instruments-modal-overlay {
|
|
16
|
+
${theme.cssVars}
|
|
17
|
+
|
|
18
|
+
--rebilly-spacings-base: calc(var(--rebilly-fontSizeBase) * 1.5);
|
|
19
|
+
--rebilly-spacings-2xs: calc(var(--rebilly-spacings-base) * 0.16667);
|
|
20
|
+
--rebilly-spacings-xs: calc(var(--rebilly-spacings-base) * 0.25);
|
|
21
|
+
--rebilly-spacings-s: calc(var(--rebilly-spacings-base) * 0.5);
|
|
22
|
+
--rebilly-spacings-m: var(--rebilly-spacings-base);
|
|
23
|
+
--rebilly-spacings-l: calc(var(--rebilly-spacings-base) * 2);
|
|
24
|
+
--rebilly-spacings-xl: calc(var(--rebilly-spacings-base) * 4);
|
|
25
|
+
--rebilly-spacings-2xl: calc(var(--rebilly-spacings-base) * 4.6667);
|
|
26
|
+
|
|
27
|
+
--rebilly-spacings-input-py: calc(var(--rebilly-spacings-2xs) * 2);
|
|
28
|
+
--rebilly-spacings-input-px: calc(var(--rebilly-spacings-s) + var(--rebilly-spacings-2xs));
|
|
29
|
+
--rebilly-spacings-label-offset-left: var(--rebilly-spacings-input-px);
|
|
30
|
+
--rebilly-spacings-form-element-min-height: calc(var(--rebilly-spacings-base) * 1.83333);
|
|
31
|
+
--rebilly-spacings-button-py: var(--rebilly-spacings-input-py);
|
|
32
|
+
--rebilly-spacings-button-px: var(--rebilly-spacings-input-px);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
|
|
9
36
|
/* Base, Typography
|
|
10
37
|
------------------------------------------------------------ */
|
|
11
38
|
/* Base setup for top level elements */
|
|
@@ -13,19 +40,21 @@ const base = theme => `
|
|
|
13
40
|
.rebilly-instruments-method-content,
|
|
14
41
|
.rebilly-instruments-confirmation,
|
|
15
42
|
.rebilly-instruments-results {
|
|
16
|
-
color:
|
|
17
|
-
background:
|
|
18
|
-
font-size:
|
|
19
|
-
|
|
20
|
-
|
|
43
|
+
color: var(--rebilly-colorText);
|
|
44
|
+
background: var(--rebilly-colorBackground);
|
|
45
|
+
font-size: var(--rebilly-fontSizeBase);
|
|
46
|
+
font-weight: var(--rebilly-fontWeightBase);
|
|
47
|
+
line-height: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
|
|
48
|
+
font-family: var(--rebilly-fontFamily);
|
|
21
49
|
-webkit-font-smoothing: antialiased;
|
|
22
50
|
-moz-osx-font-smoothing: grayscale;
|
|
23
51
|
text-align: left;
|
|
24
52
|
transition: all 200ms;
|
|
53
|
+
font-smooth: var(--rebilly-fontSmooth);
|
|
25
54
|
}
|
|
26
55
|
|
|
27
56
|
.rebilly-instruments-link {
|
|
28
|
-
color:
|
|
57
|
+
color: var(--rebilly-colorPrimary);
|
|
29
58
|
cursor: pointer;
|
|
30
59
|
}
|
|
31
60
|
|
|
@@ -34,7 +63,7 @@ const base = theme => `
|
|
|
34
63
|
}
|
|
35
64
|
|
|
36
65
|
.rebilly-instruments-link .rebilly-instruments-icon {
|
|
37
|
-
fill:
|
|
66
|
+
fill: var(--rebilly-colorPrimary);
|
|
38
67
|
}
|
|
39
68
|
|
|
40
69
|
.rebilly-instruments-link.has-icon-left,
|
|
@@ -43,29 +72,32 @@ const base = theme => `
|
|
|
43
72
|
}
|
|
44
73
|
|
|
45
74
|
.rebilly-instruments-link.has-icon-left .rebilly-instruments-icon {
|
|
46
|
-
margin-right:
|
|
75
|
+
margin-right: var(--rebilly-spacings-xs);
|
|
47
76
|
}
|
|
48
77
|
|
|
49
78
|
.rebilly-instruments-link.has-icon-right .rebilly-instruments-icon {
|
|
50
|
-
margin-left:
|
|
79
|
+
margin-left: var(--rebilly-spacings-xs);
|
|
51
80
|
}
|
|
52
81
|
|
|
53
82
|
/* Typography */
|
|
54
83
|
.rebilly-instruments-h1,
|
|
55
84
|
.rebilly-instruments-h2 {
|
|
56
|
-
font-weight:
|
|
85
|
+
font-weight: var(--rebilly-headingFontWeight);
|
|
86
|
+
font-family: var(--rebilly-headingFontFamily);
|
|
87
|
+
color: var(--rebilly-headingColorText);
|
|
57
88
|
}
|
|
58
89
|
|
|
59
90
|
.rebilly-instruments-h1 {
|
|
60
|
-
font-size: calc(
|
|
61
|
-
line-height:
|
|
62
|
-
|
|
91
|
+
font-size: calc(var(--rebilly-fontSizeBase) * 1.5);
|
|
92
|
+
line-height: 1.5;
|
|
93
|
+
line-height: calc(${theme.fontLineHeightBase} * 1.5);
|
|
94
|
+
margin: 0 0 calc(var(--rebilly-spacings-base) * 1.5) 0;
|
|
63
95
|
}
|
|
64
96
|
|
|
65
97
|
.rebilly-instruments-h2 {
|
|
66
|
-
font-size: calc(
|
|
67
|
-
line-height:
|
|
68
|
-
margin: 0 0
|
|
98
|
+
font-size: calc(var(--rebilly-fontSizeBase) * 1.125);
|
|
99
|
+
line-height: var(--rebilly-fontLineHeightBase, 1.33);
|
|
100
|
+
margin: 0 0 var(--rebilly-spacings-base) 0;
|
|
69
101
|
}
|
|
70
102
|
`;
|
|
71
103
|
|
package/dist/style/base/theme.js
CHANGED
|
@@ -5,69 +5,37 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.Theme = void 0;
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
var _colorValues = require("../utils/color-values");
|
|
8
|
+
var _defaultTheme = _interopRequireDefault(require("./default-theme"));
|
|
11
9
|
|
|
12
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
11
|
|
|
12
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
13
|
+
|
|
14
14
|
class Theme {
|
|
15
15
|
constructor(overrides = {}) {
|
|
16
16
|
this.overrides = overrides;
|
|
17
|
-
this.theme =
|
|
18
|
-
color: {
|
|
19
|
-
primary: '#0044d4',
|
|
20
|
-
errorText: '#cd5c5c',
|
|
21
|
-
text: '#0D2B3E',
|
|
22
|
-
buttonText: '#ffffff',
|
|
23
|
-
background: '#ffffff'
|
|
24
|
-
},
|
|
25
|
-
typography: {
|
|
26
|
-
fontFamily: 'Avenir, Helvetica, Arial, sans-serif',
|
|
27
|
-
fontSize: '16px',
|
|
28
|
-
lineHeight: '24px',
|
|
29
|
-
captionFontSize: '12px',
|
|
30
|
-
captionLineHeight: '12px'
|
|
31
|
-
},
|
|
32
|
-
space: {
|
|
33
|
-
xxs: '4px',
|
|
34
|
-
xs: '6px',
|
|
35
|
-
s: '12px',
|
|
36
|
-
m: '24px',
|
|
37
|
-
l: '48px',
|
|
38
|
-
xl: '96px',
|
|
39
|
-
xxl: '112px',
|
|
40
|
-
form: {
|
|
41
|
-
padding: '8px 16px',
|
|
42
|
-
verticalPadding: '8px',
|
|
43
|
-
horizontalPadding: '16px',
|
|
44
|
-
minHeight: '44px'
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
borderRadius: '4px'
|
|
48
|
-
};
|
|
17
|
+
this.theme = _defaultTheme.default;
|
|
49
18
|
}
|
|
50
19
|
|
|
51
|
-
|
|
52
|
-
|
|
20
|
+
overrideTheme() {
|
|
21
|
+
Object.keys(this.overrides).forEach(prop => {
|
|
22
|
+
this.theme[prop] = this.overrides[prop];
|
|
23
|
+
});
|
|
53
24
|
}
|
|
54
25
|
|
|
55
|
-
|
|
56
|
-
return {
|
|
57
|
-
color: {
|
|
58
|
-
primaryValues: (0, _colorValues.colorValues)(this.theme.color.primary),
|
|
59
|
-
mutedText: (0, _colorValues.alphaColor)(this.theme.color.text, 0.6),
|
|
60
|
-
mutedBorder: (0, _colorValues.alphaColor)(this.theme.color.text, 0.25)
|
|
61
|
-
}
|
|
62
|
-
};
|
|
26
|
+
get cssVars() {
|
|
27
|
+
return Object.keys(this.theme).filter(v => !Theme.nonCssProperties.includes(v)).map(p => `--rebilly-${p}: ${this.theme[p]};`).join('\n');
|
|
63
28
|
}
|
|
64
29
|
|
|
65
30
|
build() {
|
|
66
|
-
|
|
67
|
-
|
|
31
|
+
this.overrideTheme();
|
|
32
|
+
return { ...this.theme,
|
|
33
|
+
cssVars: this.cssVars
|
|
68
34
|
};
|
|
69
35
|
}
|
|
70
36
|
|
|
71
37
|
}
|
|
72
38
|
|
|
73
|
-
exports.Theme = Theme;
|
|
39
|
+
exports.Theme = Theme;
|
|
40
|
+
|
|
41
|
+
_defineProperty(Theme, "nonCssProperties", ['labels']);
|
|
@@ -2,10 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _theme = require("./theme");
|
|
4
4
|
|
|
5
|
-
var _values = _interopRequireDefault(require("values.js"));
|
|
6
|
-
|
|
7
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
|
-
|
|
9
5
|
describe('RebillyInstruments theme', () => {
|
|
10
6
|
it('builds the theme object', () => {
|
|
11
7
|
const theme = new _theme.Theme().build();
|
|
@@ -13,18 +9,11 @@ describe('RebillyInstruments theme', () => {
|
|
|
13
9
|
});
|
|
14
10
|
it('properly overrides the default properties', () => {
|
|
15
11
|
const overrides = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
text: 'gray'
|
|
19
|
-
}
|
|
12
|
+
colorPrimary: 'red',
|
|
13
|
+
buttonBorderRadius: '30px'
|
|
20
14
|
};
|
|
21
15
|
const theme = new _theme.Theme(overrides).build();
|
|
22
|
-
expect(theme.
|
|
23
|
-
expect(theme.
|
|
24
|
-
});
|
|
25
|
-
it('computes new styles from theme properties', () => {
|
|
26
|
-
const theme = new _theme.Theme().build();
|
|
27
|
-
expect(theme.getComputed.color.primaryValues instanceof _values.default).toEqual(true);
|
|
28
|
-
expect(theme.getComputed.color.mutedText).toEqual('rgba(13, 43, 62, 0.6)');
|
|
16
|
+
expect(theme.colorPrimary).toEqual('red');
|
|
17
|
+
expect(theme.buttonBorderRadius).toEqual('30px');
|
|
29
18
|
});
|
|
30
19
|
});
|
|
@@ -8,13 +8,13 @@ exports.address = void 0;
|
|
|
8
8
|
// -----------------------------------------------------------------------------
|
|
9
9
|
// This file contains all styles related to the address component.
|
|
10
10
|
// -----------------------------------------------------------------------------
|
|
11
|
-
const address =
|
|
11
|
+
const address = () => `
|
|
12
12
|
/**
|
|
13
13
|
* Address
|
|
14
14
|
*/
|
|
15
15
|
.rebilly-instruments-address {
|
|
16
|
-
margin: 0 0
|
|
17
|
-
color:
|
|
16
|
+
margin: 0 0 var(--rebilly-spacings-base);
|
|
17
|
+
color: var(--rebilly-colorMutedText);
|
|
18
18
|
font-style: normal;
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -8,22 +8,23 @@ exports.button = void 0;
|
|
|
8
8
|
// -----------------------------------------------------------------------------
|
|
9
9
|
// This file contains all styles related to the button component.
|
|
10
10
|
// -----------------------------------------------------------------------------
|
|
11
|
-
const button =
|
|
11
|
+
const button = () => `
|
|
12
12
|
/**
|
|
13
13
|
* Buttons
|
|
14
14
|
*/
|
|
15
15
|
.rebilly-instruments-button {
|
|
16
|
-
font-size:
|
|
17
|
-
font-family:
|
|
18
|
-
line-height:
|
|
19
|
-
padding:
|
|
16
|
+
font-size: var(--rebilly-buttonFontSize);
|
|
17
|
+
font-family: var(--rebilly-buttonFontFamily);
|
|
18
|
+
line-height: var(--rebilly-buttonFontLineHeight);
|
|
19
|
+
padding: var(--rebilly-spacings-button-py) var(--rebilly-spacings-button-px);
|
|
20
20
|
box-sizing: border-box;
|
|
21
|
-
background:
|
|
22
|
-
color:
|
|
23
|
-
border-radius:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
background: var(--rebilly-buttonColorBackground);
|
|
22
|
+
color: var(--rebilly-buttonColorText, #FFF);
|
|
23
|
+
border-radius: var(--rebilly-buttonBorderRadius);
|
|
24
|
+
font-weight: var(--rebilly-buttonFontWeight);
|
|
25
|
+
border: var(--rebilly-buttonBorder);
|
|
26
|
+
box-shadow: var(--rebilly-buttonBoxShadow);
|
|
27
|
+
margin: calc(var(--rebilly-spacings-2xs) + var(--rebilly-spacings-s) / 2) 0;
|
|
27
28
|
width: 100%;
|
|
28
29
|
cursor: pointer;
|
|
29
30
|
min-height: 44px;
|
|
@@ -31,25 +32,34 @@ const button = theme => `
|
|
|
31
32
|
outline: none;
|
|
32
33
|
}
|
|
33
34
|
|
|
34
|
-
.rebilly-instruments-button:hover
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
.rebilly-instruments-button:not([disabled]):hover {
|
|
36
|
+
background: var(--rebilly-buttonHoverColorBackground);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.rebilly-instruments-button:not([disabled]):active {
|
|
40
|
+
background: var(--rebilly-buttonActiveColorBackground);
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
.rebilly-instruments-button.rebilly-instruments-button-secondary {
|
|
40
|
-
background:
|
|
41
|
-
|
|
42
|
-
color:
|
|
44
|
+
background: var(--rebilly-colorBackground);
|
|
45
|
+
color: var(--rebilly-buttonColorBackground);
|
|
46
|
+
border-color: var(--rebilly-buttonColorBackground);
|
|
43
47
|
}
|
|
44
48
|
|
|
45
|
-
.rebilly-instruments-button.rebilly-instruments-button-secondary:hover,
|
|
46
|
-
.rebilly-instruments-button.rebilly-instruments-button-secondary:active {
|
|
47
|
-
background:
|
|
49
|
+
.rebilly-instruments-button.rebilly-instruments-button-secondary:not([disabled]):hover,
|
|
50
|
+
.rebilly-instruments-button.rebilly-instruments-button-secondary:not([disabled]):active {
|
|
51
|
+
background: var(--rebilly-colorBackground);
|
|
48
52
|
}
|
|
49
53
|
|
|
50
|
-
.rebilly-instruments-button:focus {
|
|
54
|
+
.rebilly-instruments-button:focus {
|
|
55
|
+
box-shadow: 0 0 0 1px var(--rebilly-colorPrimary);
|
|
56
|
+
}
|
|
51
57
|
|
|
52
|
-
.rebilly-instruments-button:disabled
|
|
58
|
+
.rebilly-instruments-button:disabled,
|
|
59
|
+
.rebilly-instruments-button:disabled:hover {
|
|
60
|
+
cursor: not-allowed;
|
|
61
|
+
opacity: 0.6;
|
|
62
|
+
}
|
|
53
63
|
|
|
54
64
|
.rebilly-instruments-button::first-letter { text-transform: uppercase; }
|
|
55
65
|
|
|
@@ -8,13 +8,13 @@ exports.divider = void 0;
|
|
|
8
8
|
// -----------------------------------------------------------------------------
|
|
9
9
|
// This file contains all styles related to the divider component.
|
|
10
10
|
// -----------------------------------------------------------------------------
|
|
11
|
-
const divider =
|
|
11
|
+
const divider = () => `
|
|
12
12
|
/**
|
|
13
13
|
* Divider
|
|
14
14
|
*/
|
|
15
15
|
.rebilly-instruments-divider {
|
|
16
|
-
line-height:
|
|
17
|
-
padding:
|
|
16
|
+
line-height: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
|
|
17
|
+
padding: var(--rebilly-spacings-base) 0;
|
|
18
18
|
margin: 0;
|
|
19
19
|
position: relative;
|
|
20
20
|
outline: 0;
|
|
@@ -23,7 +23,7 @@ const divider = theme => `
|
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
.rebilly-instruments-divider::before {
|
|
26
|
-
background:
|
|
26
|
+
background: var(--rebilly-colorMutedBorder);
|
|
27
27
|
content: '';
|
|
28
28
|
position: absolute;
|
|
29
29
|
left: 0;
|
|
@@ -33,13 +33,13 @@ const divider = theme => `
|
|
|
33
33
|
}
|
|
34
34
|
|
|
35
35
|
.rebilly-instruments-divider .rebilly-instruments-divider-label {
|
|
36
|
-
color:
|
|
36
|
+
color: var(--rebilly-colorMutedText);
|
|
37
37
|
font-weight: 500;
|
|
38
38
|
text-transform: uppercase;
|
|
39
|
-
padding: 0
|
|
40
|
-
line-height:
|
|
41
|
-
background-color:
|
|
42
|
-
font-size:
|
|
39
|
+
padding: 0 var(--rebilly-spacings-s);
|
|
40
|
+
line-height: calc(var(--rebilly-fontSizeBase) * 0.875);
|
|
41
|
+
background-color: var(--rebilly-colorBackground);
|
|
42
|
+
font-size: calc(var(--rebilly-fontSizeBase) * 0.875);
|
|
43
43
|
position: relative;
|
|
44
44
|
display: inline-block;
|
|
45
45
|
}
|
|
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.checkbox = void 0;
|
|
7
7
|
|
|
8
|
+
var _colorValues = require("../../utils/color-values");
|
|
9
|
+
|
|
8
10
|
// -----------------------------------------------------------------------------
|
|
9
11
|
// This file contains all styles related to the checkbox component.
|
|
10
12
|
// -----------------------------------------------------------------------------
|
|
@@ -15,9 +17,10 @@ const checkbox = theme => `
|
|
|
15
17
|
.rebilly-instruments-form-field-checkbox {
|
|
16
18
|
position: relative;
|
|
17
19
|
opacity: 1;
|
|
18
|
-
padding-left: calc(${theme.space.m} + ${theme.space.s});
|
|
19
20
|
align-items: center;
|
|
20
|
-
display:
|
|
21
|
+
display: flex;
|
|
22
|
+
flex-direction: row-reverse;
|
|
23
|
+
justify-content: start;
|
|
21
24
|
cursor: pointer;
|
|
22
25
|
transform: none;
|
|
23
26
|
}
|
|
@@ -35,13 +38,14 @@ const checkbox = theme => `
|
|
|
35
38
|
}
|
|
36
39
|
|
|
37
40
|
.rebilly-instruments-form-field-checkbox span {
|
|
38
|
-
position:
|
|
41
|
+
position: relative;
|
|
39
42
|
top: 0;
|
|
40
43
|
left: 0;
|
|
41
44
|
height: 24px;
|
|
42
45
|
width: 24px;
|
|
43
|
-
border-radius:
|
|
44
|
-
box-shadow: inset 0 0 0 1px
|
|
46
|
+
border-radius: 4px;
|
|
47
|
+
box-shadow: inset 0 0 0 1px var(--rebilly-colorMutedBorder);
|
|
48
|
+
margin-right: var(--rebilly-spacings-s);
|
|
45
49
|
background-color: transparent;
|
|
46
50
|
transition: all 200ms;
|
|
47
51
|
}
|
|
@@ -54,7 +58,7 @@ const checkbox = theme => `
|
|
|
54
58
|
opacity: 0;
|
|
55
59
|
width: 5px;
|
|
56
60
|
height: 11px;
|
|
57
|
-
border: solid
|
|
61
|
+
border: solid var(--rebilly-colorPrimary);
|
|
58
62
|
border-width: 0 2px 2px 0;
|
|
59
63
|
-webkit-transform: rotate(45deg);
|
|
60
64
|
-ms-transform: rotate(45deg);
|
|
@@ -63,7 +67,7 @@ const checkbox = theme => `
|
|
|
63
67
|
}
|
|
64
68
|
|
|
65
69
|
.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span {
|
|
66
|
-
box-shadow: inset 0 0 0 2px
|
|
70
|
+
box-shadow: inset 0 0 0 2px var(--rebilly-colorPrimary);
|
|
67
71
|
}
|
|
68
72
|
|
|
69
73
|
.rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span:after {
|
|
@@ -71,8 +75,7 @@ const checkbox = theme => `
|
|
|
71
75
|
}
|
|
72
76
|
|
|
73
77
|
.rebilly-instruments-form-field-checkbox input[type="checkbox"]:focus ~ span {
|
|
74
|
-
box-shadow: 0 0 0 2px ${theme.
|
|
75
|
-
inset 0 0 0 1px ${theme.color.primary};
|
|
78
|
+
box-shadow: 0 0 0 2px ${(0, _colorValues.lighten)(theme.colorPrimary, 80)}, inset 0 0 0 1px var(--rebilly-colorPrimary);
|
|
76
79
|
}
|
|
77
80
|
|
|
78
81
|
.rebilly-instruments-form-field-checkbox input[type="checkbox"]:disabled ~ span {
|
|
@@ -8,25 +8,37 @@ exports.field = void 0;
|
|
|
8
8
|
// -----------------------------------------------------------------------------
|
|
9
9
|
// This file contains all styles related to the field component.
|
|
10
10
|
// -----------------------------------------------------------------------------
|
|
11
|
-
const field =
|
|
11
|
+
const field = () => `
|
|
12
12
|
/**
|
|
13
13
|
* Field
|
|
14
14
|
*/
|
|
15
15
|
.rebilly-instruments-form-field {
|
|
16
|
-
margin: calc(
|
|
16
|
+
margin: calc(var(--rebilly-spacings-xs) + var(--rebilly-spacings-s)) 0;
|
|
17
|
+
position: relative;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.rebilly-instruments-form-field.is-compact {
|
|
21
|
+
margin-top: calc(var(--rebilly-spacings-2xs) + var(--rebilly-spacings-s));
|
|
22
|
+
margin-bottom: calc(var(--rebilly-spacings-2xs) + var(--rebilly-spacings-s));
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.rebilly-instruments-form-field > div {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-wrap: wrap;
|
|
28
|
+
flex-direction: column;
|
|
17
29
|
position: relative;
|
|
18
30
|
}
|
|
19
31
|
|
|
20
32
|
/* Field group */
|
|
21
33
|
.rebilly-instruments-form-field-group {
|
|
22
|
-
margin: calc(
|
|
34
|
+
margin: calc(calc(var(--rebilly-spacings-xs) * -1) - var(--rebilly-spacings-s)) 0;
|
|
23
35
|
display: flex;
|
|
24
36
|
}
|
|
25
37
|
|
|
26
38
|
.rebilly-instruments-form-field-group > * {
|
|
27
39
|
flex: 1 0;
|
|
28
|
-
margin-left:
|
|
29
|
-
margin-right:
|
|
40
|
+
margin-left: var(--rebilly-spacings-xs);
|
|
41
|
+
margin-right: var(--rebilly-spacings-xs);
|
|
30
42
|
}
|
|
31
43
|
|
|
32
44
|
.rebilly-instruments-form-field-group > *:first-child {
|
|
@@ -40,7 +52,7 @@ const field = theme => `
|
|
|
40
52
|
@media (max-width: 480px) {
|
|
41
53
|
.rebilly-instruments-form-field-group {
|
|
42
54
|
display: block;
|
|
43
|
-
margin: calc(
|
|
55
|
+
margin: calc(var(--rebilly-spacings-2xs) + var(--rebilly-spacings-s)) 0;
|
|
44
56
|
}
|
|
45
57
|
|
|
46
58
|
.rebilly-instruments-form-field-group > * {
|
|
@@ -8,7 +8,7 @@ exports.form = void 0;
|
|
|
8
8
|
// -----------------------------------------------------------------------------
|
|
9
9
|
// This file contains all styles related to the form component.
|
|
10
10
|
// -----------------------------------------------------------------------------
|
|
11
|
-
const form =
|
|
11
|
+
const form = () => `
|
|
12
12
|
/**
|
|
13
13
|
* Form
|
|
14
14
|
*/
|
|
@@ -19,7 +19,7 @@ const form = theme => `
|
|
|
19
19
|
.rebilly-instruments-form select:-webkit-autofill,
|
|
20
20
|
.rebilly-instruments-form select:-webkit-autofill:hover,
|
|
21
21
|
.rebilly-instruments-form select:-webkit-autofill:focus {
|
|
22
|
-
-webkit-text-fill-color:
|
|
22
|
+
-webkit-text-fill-color: var(--rebilly-colorText);
|
|
23
23
|
-webkit-box-shadow: 0 0 0px 1000px transparent inset;
|
|
24
24
|
transition: background-color 5000s ease-in-out 0s;
|
|
25
25
|
}
|
|
@@ -8,38 +8,79 @@ exports.input = void 0;
|
|
|
8
8
|
// -----------------------------------------------------------------------------
|
|
9
9
|
// This file contains all styles related to the input component.
|
|
10
10
|
// -----------------------------------------------------------------------------
|
|
11
|
-
const input =
|
|
11
|
+
const input = () => `
|
|
12
12
|
/**
|
|
13
13
|
* Input
|
|
14
14
|
*/
|
|
15
15
|
.rebilly-instruments-form-field-input {
|
|
16
|
-
font-size:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
16
|
+
font-size: var(--rebilly-inputFontSize);
|
|
17
|
+
font-family: var(--rebilly-inputFontFamily);
|
|
18
|
+
font-weight: var(--rebilly-inputFontWeight);
|
|
19
|
+
line-height: var(--rebilly-inputFontLineHeight);
|
|
20
|
+
padding: var(--rebilly-spacings-input-py) var(--rebilly-spacings-input-px);
|
|
21
|
+
min-height: var(--rebilly-spacings-form-element-min-height);
|
|
22
|
+
border: var(--rebilly-inputBorder);
|
|
23
|
+
border-radius: var(--rebilly-inputBorderRadius);
|
|
24
|
+
color: var(--rebilly-inputColorText);
|
|
25
|
+
background: var(--rebilly-inputColorBackground);
|
|
24
26
|
box-sizing: border-box;
|
|
27
|
+
box-shadow: var(--rebilly-inputBoxShadow);
|
|
25
28
|
width: 100%;
|
|
26
29
|
transition: all 200ms;
|
|
30
|
+
order: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.rebilly-instruments-form-field-input:hover {
|
|
34
|
+
background: var(--rebilly-inputHoverColorBackground);
|
|
35
|
+
color: var(--rebilly-inputHoverColorText);
|
|
36
|
+
font-family: var(--rebilly-inputHoverFontFamily);
|
|
37
|
+
font-size: var(--rebilly-inputHoverFontSize);
|
|
38
|
+
line-height: var(--rebilly-inputHoverFontLineHeight);
|
|
39
|
+
font-weight: var(--rebilly-inputHoverFontWeight);
|
|
40
|
+
border: var(--rebilly-inputHoverBorder);
|
|
41
|
+
border-radius: var(--rebilly-inputHoverBorderRadius);
|
|
42
|
+
box-shadow: var(--rebilly-inputHoverBoxShadow);
|
|
27
43
|
}
|
|
28
44
|
|
|
29
45
|
.rebilly-instruments-form-field-input:focus {
|
|
30
46
|
outline: none;
|
|
31
|
-
|
|
32
|
-
|
|
47
|
+
background: var(--rebilly-inputFocusColorBackground);
|
|
48
|
+
color: var(--rebilly-inputFocusColorText);
|
|
49
|
+
font-family: var(--rebilly-inputFocusFontFamily);
|
|
50
|
+
font-size: var(--rebilly-inputFocusFontSize);
|
|
51
|
+
line-height: var(--rebilly-inputFocusFontLineHeight);
|
|
52
|
+
font-weight: var(--rebilly-inputFocusFontWeight);
|
|
53
|
+
border: var(--rebilly-inputFocusBorder);
|
|
54
|
+
border-radius: var(--rebilly-inputFocusBorderRadius);
|
|
55
|
+
box-shadow: var(--rebilly-inputFocusBoxShadow);
|
|
33
56
|
}
|
|
34
57
|
|
|
35
58
|
.rebilly-instruments-form-field-input::placeholder {
|
|
36
|
-
color:
|
|
37
|
-
|
|
59
|
+
color: var(--rebilly-inputPlaceholderColorText);
|
|
60
|
+
font-family: var(--rebilly-inputPlaceholderFontFamily);
|
|
61
|
+
font-size: var(--rebilly-inputPlaceholderFontSize);
|
|
62
|
+
line-height: var(--rebilly-inputPlaceholderFontLineHeight);
|
|
63
|
+
font-weight: var(--rebilly-inputPlaceholderFontWeight);
|
|
64
|
+
opacity: 1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.rebilly-instruments-form-field-input::selection {
|
|
68
|
+
color: var(--rebilly-inputSelectionColorText);
|
|
69
|
+
background: var(--rebilly-inputSelectionColorBackground);
|
|
38
70
|
}
|
|
39
71
|
|
|
40
72
|
.rebilly-instruments-form-field-input:disabled {
|
|
41
73
|
opacity: 0.6;
|
|
42
74
|
}
|
|
75
|
+
|
|
76
|
+
/* Floating Labels */
|
|
77
|
+
.is-floating .rebilly-instruments-form-field-input::placeholder {
|
|
78
|
+
opacity: 0;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.is-floating .rebilly-instruments-form-field-input:focus::placeholder {
|
|
82
|
+
opacity: 1;
|
|
83
|
+
}
|
|
43
84
|
`;
|
|
44
85
|
|
|
45
86
|
exports.input = input;
|