@rebilly/instruments 2.1.1-beta.0 → 3.0.0-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.
Files changed (83) hide show
  1. package/dist/functions/mount/fetch-data.js +4 -0
  2. package/dist/functions/mount/index.js +6 -0
  3. package/dist/functions/mount/mount.spec.js +2 -4
  4. package/dist/functions/mount/setup-framepay-theme.js +95 -0
  5. package/dist/functions/mount/setup-options.js +3 -0
  6. package/dist/i18n/en.json +1 -1
  7. package/dist/style/base/__snapshots__/theme.spec.js.snap +188 -45
  8. package/dist/style/base/default-theme.js +699 -0
  9. package/dist/style/base/index.js +48 -16
  10. package/dist/style/base/theme.js +16 -49
  11. package/dist/style/base/theme.spec.js +4 -15
  12. package/dist/style/components/address.js +3 -3
  13. package/dist/style/components/button.js +32 -22
  14. package/dist/style/components/divider.js +9 -9
  15. package/dist/style/components/forms/checkbox.js +12 -9
  16. package/dist/style/components/forms/field.js +18 -6
  17. package/dist/style/components/forms/form.js +2 -2
  18. package/dist/style/components/forms/input.js +54 -13
  19. package/dist/style/components/forms/label.js +44 -18
  20. package/dist/style/components/forms/select.js +54 -22
  21. package/dist/style/components/forms/validation.js +53 -6
  22. package/dist/style/components/icons.js +4 -4
  23. package/dist/style/components/loader.js +5 -3
  24. package/dist/style/components/methods.js +18 -15
  25. package/dist/style/components/overlay.js +5 -5
  26. package/dist/style/helpers/index.js +46 -46
  27. package/dist/style/index.js +3 -1
  28. package/dist/style/payment-instruments/payment-card.js +4 -4
  29. package/dist/style/utils/border.js +47 -0
  30. package/dist/style/utils/color-values.js +39 -3
  31. package/dist/style/utils/remove-empty-null.js +20 -0
  32. package/dist/style/vendor/framepay.js +11 -8
  33. package/dist/style/vendor/postmate.js +2 -2
  34. package/dist/style/views/confirmation.js +13 -13
  35. package/dist/style/views/method-selector.js +2 -2
  36. package/dist/style/views/modal.js +6 -6
  37. package/dist/style/views/result.js +4 -4
  38. package/dist/style/views/summary.js +23 -23
  39. package/dist/views/__snapshots__/summary.spec.js.snap +4 -40
  40. package/dist/views/common/iframe/modal-iframe.js +6 -1
  41. package/dist/views/summary.js +17 -11
  42. package/package.json +3 -1
  43. package/src/functions/mount/fetch-data.js +4 -0
  44. package/src/functions/mount/index.js +2 -0
  45. package/src/functions/mount/mount.spec.js +3 -5
  46. package/src/functions/mount/setup-framepay-theme.js +82 -0
  47. package/src/functions/mount/setup-options.js +3 -0
  48. package/src/i18n/en.json +1 -1
  49. package/src/style/base/__snapshots__/theme.spec.js.snap +188 -45
  50. package/src/style/base/default-theme.js +674 -0
  51. package/src/style/base/index.js +48 -16
  52. package/src/style/base/theme.js +17 -47
  53. package/src/style/base/theme.spec.js +4 -16
  54. package/src/style/components/address.js +3 -3
  55. package/src/style/components/button.js +32 -24
  56. package/src/style/components/divider.js +9 -9
  57. package/src/style/components/forms/checkbox.js +11 -11
  58. package/src/style/components/forms/field.js +18 -6
  59. package/src/style/components/forms/form.js +2 -2
  60. package/src/style/components/forms/input.js +54 -13
  61. package/src/style/components/forms/label.js +44 -18
  62. package/src/style/components/forms/select.js +54 -22
  63. package/src/style/components/forms/validation.js +53 -6
  64. package/src/style/components/icons.js +4 -4
  65. package/src/style/components/loader.js +4 -5
  66. package/src/style/components/methods.js +18 -15
  67. package/src/style/components/overlay.js +5 -5
  68. package/src/style/helpers/index.js +46 -46
  69. package/src/style/index.js +2 -1
  70. package/src/style/payment-instruments/payment-card.js +4 -4
  71. package/src/style/utils/border.js +34 -0
  72. package/src/style/utils/color-values.js +27 -1
  73. package/src/style/utils/remove-empty-null.js +10 -0
  74. package/src/style/vendor/framepay.js +11 -8
  75. package/src/style/vendor/postmate.js +2 -2
  76. package/src/style/views/confirmation.js +13 -13
  77. package/src/style/views/method-selector.js +2 -2
  78. package/src/style/views/modal.js +6 -6
  79. package/src/style/views/result.js +4 -4
  80. package/src/style/views/summary.js +23 -23
  81. package/src/views/__snapshots__/summary.spec.js.snap +4 -40
  82. package/src/views/common/iframe/modal-iframe.js +7 -1
  83. package/src/views/summary.js +17 -11
@@ -8,35 +8,61 @@ exports.label = void 0;
8
8
  // -----------------------------------------------------------------------------
9
9
  // This file contains all styles related to the label component.
10
10
  // -----------------------------------------------------------------------------
11
- const label = theme => `
11
+ const label = () => `
12
12
  /**
13
13
  * Label
14
14
  */
15
15
  .rebilly-instruments-form-field-label {
16
- left: ${theme.space.form.horizontalPadding};
17
- color: ${theme.color.text};
18
- top: calc(${theme.space.form.minHeight} / 2);
16
+ font-size: calc(var(--rebilly-fontSizeBase) * 0.92);
17
+ line-height: calc(var(--rebilly-fontSizeBase) * 0.92);
18
+ margin-bottom: var(--rebilly-spacings-2xs);
19
+ }
20
+
21
+ /* Floating Labels */
22
+ .is-floating .rebilly-instruments-form-field-label {
23
+ font-size: var(--rebilly-fontSizeBase);
24
+ left: var(--rebilly-spacings-label-offset-left);
25
+ color: var(--rebilly-colorText);
26
+ top: 50%;
19
27
  background: transparent;
20
- opacity: 0;
28
+ opacity: 1;
21
29
  position: absolute;
22
- transform: translateY(-50%);
23
- transition: all 200ms;
30
+ transform: translateY(-50%) scale(1);
31
+ transition: transform 0.35s cubic-bezier(0.19, 1, 0.22, 1), background 0.35s cubic-bezier(0.19, 1, 0.22, 1);
24
32
  cursor: text;
25
33
  pointer-events: none;
34
+ transform-origin: left top;
35
+ }
36
+
37
+ /* Includes Google autocomplete fix */
38
+ .is-floating input:-webkit-autofill + .rebilly-instruments-form-field-label,
39
+ .is-floating input:-webkit-autofill:hover + .rebilly-instruments-form-field-label,
40
+ .is-floating input:-webkit-autofill:focus + .rebilly-instruments-form-field-label,
41
+ .is-floating select:-webkit-autofill + .rebilly-instruments-form-field-label,
42
+ .is-floating select:-webkit-autofill:hover + .rebilly-instruments-form-field-label,
43
+ .is-floating select:-webkit-autofill:focus + .rebilly-instruments-form-field-label {
44
+ padding: 0 var(--rebilly-spacings-2xs);
45
+ left: calc(var(--rebilly-spacings-label-offset-left) - var(--rebilly-spacings-2xs));
46
+ line-height: 1;
47
+ background: var(--rebilly-colorBackground);
48
+ opacity: 1!important;
49
+ transform: translateY(-175%) scale(0.875);
50
+ }
51
+
52
+ .is-floating .rebilly-instruments-form-field-select + .rebilly-instruments-form-field-label {
53
+ font-size: var(--rebilly-fontSizeBase);
54
+ opacity: 0.5;
26
55
  }
27
56
 
28
- .rebilly-instruments-form-field-input:not(:placeholder-shown) + .rebilly-instruments-form-field-label,
29
- .rebilly-instruments-form-field-select:focus + .rebilly-instruments-form-field-label,
30
- .rebilly-instruments-form-field-label.is-active {
31
- padding: 0 ${theme.space.xxs};
32
- left: calc(${theme.space.form.horizontalPadding} - ${theme.space.xxs});
33
- font-size: ${theme.typography.captionFontSize};
34
- line-height: ${theme.typography.captionLineHeight};
35
- color: ${theme.color.text};
36
- background: ${theme.color.background};
37
- font-weight: 500;
57
+ .is-floating .rebilly-instruments-form-field-input:focus + .rebilly-instruments-form-field-label,
58
+ .is-floating .rebilly-instruments-form-field-select:focus + .rebilly-instruments-form-field-label,
59
+ .is-floating .rebilly-instruments-form-field-label.is-active {
60
+ padding: 0 var(--rebilly-spacings-2xs);
61
+ left: calc(var(--rebilly-spacings-label-offset-left) - var(--rebilly-spacings-2xs));
62
+ line-height: 1;
63
+ background: var(--rebilly-colorBackground);
38
64
  opacity: 1;
39
- top: 0;
65
+ transform: translateY(-175%) scale(0.875);
40
66
  }
41
67
  `;
42
68
 
@@ -8,30 +8,59 @@ exports.select = void 0;
8
8
  // -----------------------------------------------------------------------------
9
9
  // This file contains all styles related to the select component.
10
10
  // -----------------------------------------------------------------------------
11
- const select = theme => `
11
+ const select = () => `
12
12
  /**
13
13
  * Select
14
14
  */
15
15
  .rebilly-instruments-form-field-select {
16
- font-size: ${theme.typography.fontSize};
17
- line-height: ${theme.typography.lineHeight};
18
- padding: ${theme.space.form.padding};
19
- min-height: ${theme.space.form.minHeight};
20
- border: 1px solid ${theme.getComputed.color.mutedBorder};
21
- border-radius: ${theme.borderRadius};
22
- color: ${theme.color.text};
23
- background: transparent;
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-select: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-select:focus {
30
46
  outline: none;
31
- border: 1px solid ${theme.color.primary};
32
- box-shadow: 0 0 0 1px ${theme.color.primary};
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
 
58
+ .rebilly-instruments-form-field-select::selection {
59
+ color: var(--rebilly-inputSelectionColorText);
60
+ background: var(--rebilly-inputSelectionColorBackground);
61
+ }
62
+
63
+
35
64
  .rebilly-instruments-form-field-select:disabled {
36
65
  opacity: 0.6;
37
66
  }
@@ -41,22 +70,25 @@ const select = theme => `
41
70
  -moz-appearance: none;
42
71
  }
43
72
 
44
- .rebilly-instruments-form-field-select + .rebilly-instruments-form-field-label {
45
- font-size: ${theme.typography.fontSize};
46
- opacity: 0.5;
47
- }
48
-
49
73
  .rebilly-instruments-form-field-select::-ms-expand { display: none; }
50
74
 
51
75
  .rebilly-instruments-form-field-select-arrow {
52
- border: solid ${theme.color.text};
76
+ border: solid var(--rebilly-inputColorText);
53
77
  position: absolute;
54
- width: 8px;
55
- height: 8px;
78
+ width: var(--rebilly-spacings-xs);
79
+ height: var(--rebilly-spacings-xs);
56
80
  border-width: 0 2px 2px 0;
57
- transform: rotate(45deg);
58
- right: 16px;
59
- top: 16px;
81
+ border-radius: 1px;
82
+ right: var(--rebilly-spacings-s);
83
+ top: 50%;
84
+ margin-top: calc(var(--rebilly-inputFontSize) * 0.875 - var(--rebilly-spacings-xs));
85
+ transform: translateY(-50%) rotate(45deg);
86
+ }
87
+
88
+ .is-floating .rebilly-instruments-form-field-select-arrow {
89
+ top: 50%;
90
+ margin-top: 0;
91
+ transform: translateY(-50%) rotate(45deg);
60
92
  }
61
93
  `;
62
94
 
@@ -8,25 +8,72 @@ exports.validation = void 0;
8
8
  // -----------------------------------------------------------------------------
9
9
  // This file contains all styles related to the form validations.
10
10
  // -----------------------------------------------------------------------------
11
- const validation = theme => `
11
+ const validation = () => `
12
12
  /**
13
13
  * Validations
14
14
  */
15
15
  .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input,
16
16
  .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select {
17
- border-color: ${theme.color.errorText};
18
- color: ${theme.color.errorText};
17
+ font-family: var(--rebilly-inputErrorFontFamily);
18
+ font-size: var(--rebilly-inputErrorFontSize);
19
+ font-weight: var(--rebilly-inputErrorFontWeight);
20
+ line-height: var(--rebilly-inputErrorFontLineHeight);
21
+ background: var(--rebilly-inputErrorColorBackground);
22
+ color: var(--rebilly-inputErrorColorText);
23
+ border: var(--rebilly-inputErrorBorder);
24
+ border-radius: var(--rebilly-inputErrorBorderRadius);
25
+ box-shadow: var(--rebilly-inputErrorBoxShadow);
26
+ }
27
+
28
+ .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input:hover,
29
+ .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select:hover {
30
+ font-family: var(--rebilly-inputErrorHoverFontFamily);
31
+ font-size: var(--rebilly-inputErrorHoverFontSize);
32
+ font-weight: var(--rebilly-inputErrorHoverFontWeight);
33
+ line-height: var(--rebilly-inputErrorHoverFontLineHeight);
34
+ background: var(--rebilly-inputErrorHoverColorBackground);
35
+ color: var(--rebilly-inputErrorHoverColorText);
36
+ border: var(--rebilly-inputErrorHoverBorder);
37
+ border-radius: var(--rebilly-inputErrorHoverBorderRadius);
38
+ box-shadow: var(--rebilly-inputErrorHoverBoxShadow);
39
+ }
40
+
41
+ .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input:focus,
42
+ .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select:focus {
43
+ font-family: var(--rebilly-inputErrorFocusFontFamily);
44
+ font-size: var(--rebilly-inputErrorFocusFontSize);
45
+ font-weight: var(--rebilly-inputErrorFocusFontWeight);
46
+ line-height: var(--rebilly-inputErrorFocusFontLineHeight);
47
+ background: var(--rebilly-inputErrorFocusColorBackground);
48
+ color: var(--rebilly-inputErrorFocusColorText);
49
+ border: var(--rebilly-inputErrorFocusBorder);
50
+ border-radius: var(--rebilly-inputErrorFocusBorderRadius);
51
+ box-shadow: var(--rebilly-inputErrorFocusBoxShadow);
52
+ }
53
+
54
+ .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input::placeholder {
55
+ color: var(--rebilly-inputErrorPlaceholderColorText);
56
+ font-family: var(--rebilly-inputErrorPlaceholderFontFamily);
57
+ font-size: var(--rebilly-inputErrorPlaceholderFontSize);
58
+ line-height: var(--rebilly-inputErrorPlaceholderFontLineHeight);
59
+ font-weight: var(--rebilly-inputErrorPlaceholderFontWeight);
60
+ }
61
+
62
+ .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-input::selection,
63
+ .rebilly-instruments-form-field.is-error .rebilly-instruments-form-field-select::selection {
64
+ color: var(--rebilly-inputErrorSelectionColorText);
65
+ background: var(--rebilly-inputErrorSelectionColorBackground);
19
66
  }
20
67
 
21
68
  .rebilly-instruments-form-field-error-wrapper {
22
- margin-top: ${theme.space.xxs};
23
- margin-bottom: calc(${theme.space.xxs} + ${theme.space.s});
69
+ margin-top: var(--rebilly-spacings-2xs);
70
+ margin-bottom: 0;
24
71
  padding: 0;
25
72
  list-style: none;
26
73
  }
27
74
 
28
75
  .rebilly-instruments-form-field-error-wrapper > li {
29
- color: ${theme.color.errorText};
76
+ color: var(--rebilly-colorDanger);
30
77
  padding: 0;
31
78
  }
32
79
  `;
@@ -8,14 +8,14 @@ exports.icons = void 0;
8
8
  // -----------------------------------------------------------------------------
9
9
  // This file contains all styles related to the icons component.
10
10
  // -----------------------------------------------------------------------------
11
- const icons = theme => `
11
+ const icons = () => `
12
12
  /**
13
13
  * Icons
14
14
  */
15
15
  .rebilly-instruments-icon {
16
- width: ${theme.typography.lineHeight};
17
- height: ${theme.typography.lineHeight};
18
- fill: ${theme.color.text};
16
+ width: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
17
+ height: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
18
+ fill: var(--rebilly-colorText);
19
19
  }
20
20
  `;
21
21
 
@@ -5,6 +5,8 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.loader = void 0;
7
7
 
8
+ var _colorValues = require("../utils/color-values");
9
+
8
10
  // -----------------------------------------------------------------------------
9
11
  // This file contains all styles related to the loader component.
10
12
  // -----------------------------------------------------------------------------
@@ -21,7 +23,7 @@ const loader = theme => `
21
23
  right: 0;
22
24
  justify-content: center;
23
25
  align-items: center;
24
- background-color: ${theme.color.background};
26
+ background-color: var(--rebilly-colorBackground);
25
27
  z-index: 9000;
26
28
  transition: all 200ms;
27
29
  }
@@ -31,8 +33,8 @@ const loader = theme => `
31
33
  }
32
34
 
33
35
  .rebilly-instruments-loader-spinner {
34
- border: 4px solid ${theme.getComputed.color.primaryValues.tint(80).hexString()};
35
- border-top: 4px solid ${theme.color.primary};
36
+ border: 4px solid ${(0, _colorValues.lighten)(theme.colorPrimary, 80)};
37
+ border-top: 4px solid var(--rebilly-colorPrimary);
36
38
  border-radius: 50%;
37
39
  width: 40px;
38
40
  height: 40px;
@@ -8,7 +8,7 @@ exports.methods = exports.expressMethods = void 0;
8
8
  // -----------------------------------------------------------------------------
9
9
  // This file contains all styles related to the methods component.
10
10
  // -----------------------------------------------------------------------------
11
- const expressMethods = theme => `
11
+ const expressMethods = () => `
12
12
  /**
13
13
  * Express methods
14
14
  */
@@ -20,9 +20,11 @@ const expressMethods = theme => `
20
20
  }
21
21
 
22
22
  .rebilly-instruments-express-methods.is-compact {
23
- border: 1px solid ${theme.getComputed.color.mutedBorder};
24
- padding: calc(${theme.space.xs} + ${theme.space.s}) ${theme.space.s} ${theme.space.s};
25
- border-radius: ${theme.borderRadius};
23
+ border: 1px solid var(--rebilly-colorMutedBorder);
24
+ padding: var(--rebilly-spacings-s);
25
+ padding-top: calc(var(--rebilly-spacings-xs) + var(--rebilly-spacings-s));
26
+ padding-top: calc(var(--rebilly-fontSizeBase) + var(--rebilly-spacings-2xs));
27
+ border-radius: 4px;
26
28
  position: relative;
27
29
  }
28
30
 
@@ -34,10 +36,11 @@ const expressMethods = theme => `
34
36
 
35
37
  .rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > * {
36
38
  border-radius: 6px;
37
- margin-bottom: ${theme.space.xs};
38
- background: linear-gradient(110deg, ${theme.getComputed.color.mutedBorder} 0%, ${theme.color.background} 25%, ${theme.getComputed.color.mutedBorder} 50%);
39
+ margin-bottom: var(--rebilly-spacings-xs);
40
+ background: linear-gradient(110deg, var(--rebilly-colorMutedBorder) 0%, var(--rebilly-colorBackground) 25%, var(--rebilly-colorMutedBorder) 50%);
39
41
  background-size: 200% 100%;
40
42
  animation: 1.5s rebillyExpressShine linear infinite;
43
+ height: 44px;
41
44
  }
42
45
  .rebilly-instruments-express-methods .rebilly-instruments-express-methods-container > *:last-child {
43
46
  margin: 0;
@@ -51,7 +54,7 @@ const expressMethods = theme => `
51
54
  .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {
52
55
  flex: 1 1 0px;
53
56
  max-width: 260px;
54
- margin: 0 ${theme.space.xs};
57
+ margin: 0 var(--rebilly-spacings-xs);
55
58
  }
56
59
  .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:first-child {
57
60
  margin-left: 0;
@@ -65,17 +68,17 @@ const expressMethods = theme => `
65
68
  }
66
69
  .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-label {
67
70
  position: absolute;
68
- top: -12px; left: 50%;
69
- transform: translateX(-50%);
70
- color: ${theme.color.text};
71
- padding: 0 ${theme.space.s};
72
- line-height: ${theme.typography.lineHeight};
73
- background: ${theme.color.background};
71
+ top: 0; left: 50%;
72
+ transform: translateX(-50%) translateY(-50%);
73
+ color: var(--rebilly-colorText);
74
+ padding: var(--rebilly-spacings-2xs) var(--rebilly-spacings-s);
75
+ line-height: 1;
76
+ background: var(--rebilly-colorBackground);
74
77
  display: inline-block;
75
78
  font-weight: 500;
76
79
  min-height: auto;
77
80
  margin: 0;
78
- border: 1px soplid red;
81
+ white-space: nowrap;
79
82
  }
80
83
 
81
84
  @media (max-width: 600px) {
@@ -84,7 +87,7 @@ const expressMethods = theme => `
84
87
  }
85
88
  .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > * {
86
89
  max-width: 100%;
87
- margin: 0 0 ${theme.space.xs};
90
+ margin: 0 0 var(--rebilly-spacings-xs);
88
91
  }
89
92
  .rebilly-instruments-express-methods.is-compact .rebilly-instruments-express-methods-container > *:last-child {
90
93
  margin: 0;
@@ -8,7 +8,7 @@ exports.overlay = void 0;
8
8
  // -----------------------------------------------------------------------------
9
9
  // This file contains all styles related to the overlay component.
10
10
  // -----------------------------------------------------------------------------
11
- const overlay = theme => `
11
+ const overlay = () => `
12
12
  /**
13
13
  * Overlay
14
14
  */
@@ -22,10 +22,10 @@ const overlay = theme => `
22
22
  display: flex;
23
23
  justify-content: center;
24
24
  align-items: center;
25
- color: #ffffff;
26
- font-family: ${theme.typography.fontFamily};
27
- font-size: calc(${theme.typography.fontSize} * 1.12);
28
- line-height: ${theme.typography.lineHeight};
25
+ color: #FFF;
26
+ font-family: var(--rebilly-fontFamily);
27
+ font-size: calc(var(--rebilly-fontSizeBase) * 1.12);
28
+ line-height: var(--rebilly-fontLineHeightBase, calc(var(--rebilly-fontSizeBase) * 1.5));
29
29
  z-index: 9001
30
30
  }
31
31
  `;
@@ -8,52 +8,52 @@ exports.helpers = void 0;
8
8
  // -----------------------------------------------------------------------------
9
9
  // This file contains all styles related to helpers.
10
10
  // -----------------------------------------------------------------------------
11
- const helpers = theme => `
12
- /* Helpers
13
- ------------------------------------------------------------ */
14
- .rebilly-instruments-helper-visually-hidden {
15
- border: 0;
16
- clip: rect(0 0 0 0);
17
- height: 1px;
18
- margin: -1px;
19
- overflow: hidden;
20
- padding: 0;
21
- position: absolute;
22
- width: 1px;
23
- }
11
+ const helpers = () => `
12
+ /* Helpers
13
+ ------------------------------------------------------------ */
14
+ .rebilly-instruments-helper-visually-hidden {
15
+ border: 0;
16
+ clip: rect(0 0 0 0);
17
+ height: 1px;
18
+ margin: -1px;
19
+ overflow: hidden;
20
+ padding: 0;
21
+ position: absolute;
22
+ width: 1px;
23
+ }
24
24
 
25
- .rebilly-instruments-helper-mt-xxs { margin-top: ${theme.space.xxs}!important }
26
- .rebilly-instruments-helper-mt-xs { margin-top: ${theme.space.xs}!important }
27
- .rebilly-instruments-helper-mt-s { margin-top: ${theme.space.s}!important }
28
- .rebilly-instruments-helper-mt-m { margin-top: ${theme.space.m}!important }
29
- .rebilly-instruments-helper-mt-l { margin-top: ${theme.space.l}!important }
30
- .rebilly-instruments-helper-mt-xl { margin-top: ${theme.space.xl}!important }
31
- .rebilly-instruments-helper-mt-xxl { margin-top: ${theme.space.xxl}!important }
32
- .rebilly-instruments-helper-mt-0 { margin-top: 0!important }
33
- .rebilly-instruments-helper-mr-xxs { margin-right: ${theme.space.xxs}!important }
34
- .rebilly-instruments-helper-mr-xs { margin-right: ${theme.space.xs}!important }
35
- .rebilly-instruments-helper-mr-s { margin-right: ${theme.space.s}!important }
36
- .rebilly-instruments-helper-mr-m { margin-right: ${theme.space.m}!important }
37
- .rebilly-instruments-helper-mr-l { margin-right: ${theme.space.l}!important }
38
- .rebilly-instruments-helper-mr-xl { margin-right: ${theme.space.xl}!important }
39
- .rebilly-instruments-helper-mr-xxl { margin-right: ${theme.space.xxl}!important }
40
- .rebilly-instruments-helper-mr-0 { margin-right: 0!important }
41
- .rebilly-instruments-helper-mb-xxs { margin-bottom: ${theme.space.xxs}!important }
42
- .rebilly-instruments-helper-mb-xs { margin-bottom: ${theme.space.xs}!important }
43
- .rebilly-instruments-helper-mb-s { margin-bottom: ${theme.space.s}!important }
44
- .rebilly-instruments-helper-mb-m { margin-bottom: ${theme.space.m}!important }
45
- .rebilly-instruments-helper-mb-l { margin-bottom: ${theme.space.l}!important }
46
- .rebilly-instruments-helper-mb-xl { margin-bottom: ${theme.space.xl}!important }
47
- .rebilly-instruments-helper-mb-xxl { margin-bottom: ${theme.space.xxl}!important }
48
- .rebilly-instruments-helper-mb-0 { margin-bottom: 0!important }
49
- .rebilly-instruments-helper-ml-xxs { margin-left: ${theme.space.xxs}!important }
50
- .rebilly-instruments-helper-ml-xs { margin-left: ${theme.space.xs}!important }
51
- .rebilly-instruments-helper-ml-s { margin-left: ${theme.space.s}!important }
52
- .rebilly-instruments-helper-ml-m { margin-left: ${theme.space.m}!important }
53
- .rebilly-instruments-helper-ml-l { margin-left: ${theme.space.l}!important }
54
- .rebilly-instruments-helper-ml-xl { margin-left: ${theme.space.xl}!important }
55
- .rebilly-instruments-helper-ml-xxl { margin-left: ${theme.space.xxl}!important }
56
- .rebilly-instruments-helper-ml-0 { margin-left: 0!important }
57
- `;
25
+ .rebilly-instruments-helper-mt-xxs { margin-top: var(--rebilly-spacings-2xs) !important }
26
+ .rebilly-instruments-helper-mt-xs { margin-top: var(--rebilly-spacings-xs) !important }
27
+ .rebilly-instruments-helper-mt-s { margin-top: var(--rebilly-spacings-s) !important }
28
+ .rebilly-instruments-helper-mt-m { margin-top: var(--rebilly-spacings-base) !important }
29
+ .rebilly-instruments-helper-mt-l { margin-top: var(--rebilly-spacings-l) !important }
30
+ .rebilly-instruments-helper-mt-xl { margin-top: var(--rebilly-spacings-xl) !important }
31
+ .rebilly-instruments-helper-mt-xxl { margin-top: var(--rebilly-spacings-2xl) !important }
32
+ .rebilly-instruments-helper-mt-0 { margin-top: 0!important }
33
+ .rebilly-instruments-helper-mr-xxs { margin-right: var(--rebilly-spacings-2xs) !important }
34
+ .rebilly-instruments-helper-mr-xs { margin-right: var(--rebilly-spacings-xs) !important }
35
+ .rebilly-instruments-helper-mr-s { margin-right: var(--rebilly-spacings-s) !important }
36
+ .rebilly-instruments-helper-mr-m { margin-right: var(--rebilly-spacings-base) !important }
37
+ .rebilly-instruments-helper-mr-l { margin-right: var(--rebilly-spacings-l) !important }
38
+ .rebilly-instruments-helper-mr-xl { margin-right: var(--rebilly-spacings-xl) !important }
39
+ .rebilly-instruments-helper-mr-xxl { margin-right: var(--rebilly-spacings-2xl) !important }
40
+ .rebilly-instruments-helper-mr-0 { margin-right: 0!important }
41
+ .rebilly-instruments-helper-mb-xxs { margin-bottom: var(--rebilly-spacings-2xs) !important }
42
+ .rebilly-instruments-helper-mb-xs { margin-bottom: var(--rebilly-spacings-xs) !important }
43
+ .rebilly-instruments-helper-mb-s { margin-bottom: var(--rebilly-spacings-s) !important }
44
+ .rebilly-instruments-helper-mb-m { margin-bottom: var(--rebilly-spacings-base) !important }
45
+ .rebilly-instruments-helper-mb-l { margin-bottom: var(--rebilly-spacings-l) !important }
46
+ .rebilly-instruments-helper-mb-xl { margin-bottom: var(--rebilly-spacings-xl) !important }
47
+ .rebilly-instruments-helper-mb-xxl { margin-bottom: var(--rebilly-spacings-2xl) !important }
48
+ .rebilly-instruments-helper-mb-0 { margin-bottom: 0!important }
49
+ .rebilly-instruments-helper-ml-xxs { margin-left: var(--rebilly-spacings-2xs) !important }
50
+ .rebilly-instruments-helper-ml-xs { margin-left: var(--rebilly-spacings-xs) !important }
51
+ .rebilly-instruments-helper-ml-s { margin-left: var(--rebilly-spacings-s) !important }
52
+ .rebilly-instruments-helper-ml-m { margin-left: var(--rebilly-spacings-base) !important }
53
+ .rebilly-instruments-helper-ml-l { margin-left: var(--rebilly-spacings-l) !important }
54
+ .rebilly-instruments-helper-ml-xl { margin-left: var(--rebilly-spacings-xl) !important }
55
+ .rebilly-instruments-helper-ml-xxl { margin-left: var(--rebilly-spacings-2xl) !important }
56
+ .rebilly-instruments-helper-ml-0 { margin-left: 0!important }
57
+ `;
58
58
 
59
59
  exports.helpers = helpers;
@@ -11,6 +11,8 @@ var _autoprefixer = _interopRequireDefault(require("autoprefixer"));
11
11
 
12
12
  var _browserslist = require("./browserslist");
13
13
 
14
+ var _removeEmptyNull = _interopRequireDefault(require("./utils/remove-empty-null"));
15
+
14
16
  var _theme = require("./base/theme");
15
17
 
16
18
  var _base = require("./base");
@@ -40,7 +42,7 @@ const mainStyle = async themeOverride => {
40
42
  ${(0, _postmate.postmateStyle)(resolvedTheme)}
41
43
  ${(0, _helpers.helpers)(resolvedTheme)}
42
44
  `;
43
- return (0, _postcss.default)([(0, _autoprefixer.default)(_browserslist.browserslist)]).process(style, {
45
+ return (0, _postcss.default)([_removeEmptyNull.default, (0, _autoprefixer.default)(_browserslist.browserslist)]).process(style, {
44
46
  from: undefined
45
47
  }).then(result => result.css);
46
48
  };
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.paymentCard = void 0;
7
7
 
8
- const paymentCard = theme => `
8
+ const paymentCard = () => `
9
9
  /**
10
10
  * Payment card
11
11
  */
@@ -13,18 +13,18 @@ const paymentCard = theme => `
13
13
  display: inline-flex;
14
14
  width: 100%;
15
15
  justify-content: flex-end;
16
- margin-top: ${theme.space.s}
16
+ margin-top: var(--rebilly-spacings-s);
17
17
  }
18
18
 
19
19
  .rebilly-instruments-payment-card-brands figure {
20
- margin: 0 0 0 ${theme.space.xxs};
20
+ margin: 0 0 0 var(--rebilly-spacings-2xs);
21
21
  padding: 0;
22
22
  height: 26px;
23
23
  }
24
24
 
25
25
  .rebilly-instruments-payment-card-brands figure img {
26
26
  width: 42px;
27
- border-radius: ${theme.borderRadius};
27
+ border-radius: 4px;
28
28
  }
29
29
 
30
30
  .rebilly-instruments-modal-container.rebilly-instruments-payment-card {
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ 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; }
9
+
10
+ class Border {
11
+ constructor(str) {
12
+ _defineProperty(this, "allStyles", ['none', 'hidden', 'dotted', 'dashed', 'solid', 'double', 'groove', 'ridge', 'inset', 'outset', 'initial', 'inherit']);
13
+
14
+ this.str = str || '';
15
+ const style = this.allStyles.find(s => this.str.includes(s));
16
+ const borderProps = this.str.split(style).map(a => a.trim());
17
+ this.border = [borderProps[0], style, borderProps[1]];
18
+ }
19
+
20
+ get stylePosition() {
21
+ let stylePosition = 0;
22
+
23
+ if (this.border.length === 3) {
24
+ stylePosition = 1;
25
+ } else if (this.border.length === 2) {
26
+ if (this.allStyles.includes(this.border[0])) {
27
+ stylePosition = 0;
28
+ } else {
29
+ stylePosition = 1;
30
+ }
31
+ }
32
+
33
+ return stylePosition;
34
+ }
35
+
36
+ updateColor(color) {
37
+ this.border[this.stylePosition + 1] = color;
38
+ return this;
39
+ }
40
+
41
+ get value() {
42
+ return this.border.join(' ');
43
+ }
44
+
45
+ }
46
+
47
+ exports.default = Border;