@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.
Files changed (197) hide show
  1. package/dist/events/index.js +2 -1
  2. package/dist/functions/mount/fetch-data.js +187 -0
  3. package/dist/functions/mount/fetch-data.spec.js +189 -0
  4. package/dist/functions/mount/index.js +132 -164
  5. package/dist/functions/mount/mount.spec.js +2 -4
  6. package/dist/functions/mount/setup-element.js +40 -0
  7. package/dist/functions/mount/setup-framepay-theme.js +95 -0
  8. package/dist/functions/mount/setup-framepay.js +5 -1
  9. package/dist/functions/mount/setup-i18n.js +33 -0
  10. package/dist/functions/mount/setup-options.js +68 -47
  11. package/dist/functions/mount/setup-options.spec.js +66 -0
  12. package/dist/functions/mount/setup-storefront.js +6 -4
  13. package/dist/functions/mount/setup-styles.js +4 -2
  14. package/dist/functions/purchase.js +129 -24
  15. package/dist/functions/purchase.spec.js +13 -10
  16. package/dist/functions/setup.js +85 -0
  17. package/dist/functions/setup.spec.js +87 -0
  18. package/dist/functions/show.js +8 -4
  19. package/dist/functions/show.spec.js +9 -5
  20. package/dist/functions/update.js +39 -24
  21. package/dist/functions/update.spec.js +0 -4
  22. package/dist/i18n/en.json +5 -2
  23. package/dist/i18n/es.json +4 -1
  24. package/dist/index.js +17 -3
  25. package/dist/index.spec.js +3 -16
  26. package/dist/loader/index.js +4 -3
  27. package/dist/storefront/index.js +33 -0
  28. package/dist/storefront/invoices.js +27 -0
  29. package/dist/storefront/models/base-model.js +18 -0
  30. package/dist/storefront/models/invoice-model.js +14 -0
  31. package/dist/storefront/models/plan-model.js +4 -35
  32. package/dist/storefront/models/product-model.js +4 -23
  33. package/dist/storefront/models/summary-model.js +12 -25
  34. package/dist/storefront/models/transaction-model.js +31 -0
  35. package/dist/storefront/payment-instruments.js +47 -0
  36. package/dist/storefront/payment-instruments.spec.js +55 -0
  37. package/dist/storefront/plans.js +10 -18
  38. package/dist/storefront/plans.spec.js +3 -13
  39. package/dist/storefront/products.js +10 -13
  40. package/dist/storefront/products.spec.js +12 -19
  41. package/dist/storefront/purchase.js +23 -12
  42. package/dist/storefront/purchase.spec.js +1 -20
  43. package/dist/storefront/ready-to-pay.js +18 -15
  44. package/dist/storefront/ready-to-pay.spec.js +2 -12
  45. package/dist/storefront/summary.js +21 -17
  46. package/dist/storefront/summary.spec.js +4 -15
  47. package/dist/storefront/transactions.js +27 -0
  48. package/dist/style/base/__snapshots__/theme.spec.js.snap +188 -45
  49. package/dist/style/base/default-theme.js +699 -0
  50. package/dist/style/base/index.js +48 -16
  51. package/dist/style/base/theme.js +16 -48
  52. package/dist/style/base/theme.spec.js +4 -15
  53. package/dist/style/components/address.js +3 -3
  54. package/dist/style/components/button.js +32 -22
  55. package/dist/style/components/divider.js +9 -9
  56. package/dist/style/components/forms/checkbox.js +12 -9
  57. package/dist/style/components/forms/field.js +18 -6
  58. package/dist/style/components/forms/form.js +2 -2
  59. package/dist/style/components/forms/input.js +54 -13
  60. package/dist/style/components/forms/label.js +39 -18
  61. package/dist/style/components/forms/select.js +54 -22
  62. package/dist/style/components/forms/validation.js +53 -6
  63. package/dist/style/components/icons.js +4 -4
  64. package/dist/style/components/loader.js +5 -3
  65. package/dist/style/components/methods.js +18 -15
  66. package/dist/style/components/overlay.js +5 -5
  67. package/dist/style/helpers/index.js +46 -46
  68. package/dist/style/index.js +3 -1
  69. package/dist/style/payment-instruments/payment-card.js +4 -4
  70. package/dist/style/utils/border.js +47 -0
  71. package/dist/style/utils/color-values.js +39 -3
  72. package/dist/style/utils/remove-empty-null.js +20 -0
  73. package/dist/style/vendor/framepay.js +11 -8
  74. package/dist/style/vendor/postmate.js +2 -2
  75. package/dist/style/views/confirmation.js +13 -13
  76. package/dist/style/views/method-selector.js +2 -2
  77. package/dist/style/views/modal.js +6 -6
  78. package/dist/style/views/result.js +4 -4
  79. package/dist/style/views/summary.js +26 -22
  80. package/dist/views/__snapshots__/summary.spec.js.snap +77 -119
  81. package/dist/views/common/iframe/base-iframe.js +2 -0
  82. package/dist/views/common/iframe/modal-iframe.js +50 -4
  83. package/dist/views/confirmation.js +19 -8
  84. package/dist/views/method-selector/generate-digital-wallet.js +12 -3
  85. package/dist/views/method-selector/generate-digital-wallet.spec.js +11 -0
  86. package/dist/views/method-selector/get-payment-methods.js +13 -2
  87. package/dist/views/method-selector/get-payment-methods.spec.js +21 -19
  88. package/dist/views/method-selector/index.js +23 -34
  89. package/dist/views/method-selector/method-selector.spec.js +50 -55
  90. package/dist/views/method-selector/mount-methods.js +5 -8
  91. package/dist/views/modal.js +8 -2
  92. package/dist/views/result.js +3 -4
  93. package/dist/views/summary.js +156 -97
  94. package/dist/views/summary.spec.js +53 -58
  95. package/package.json +4 -2
  96. package/src/events/index.js +2 -1
  97. package/src/functions/mount/fetch-data.js +152 -0
  98. package/src/functions/mount/fetch-data.spec.js +238 -0
  99. package/src/functions/mount/index.js +101 -158
  100. package/src/functions/mount/mount.spec.js +3 -5
  101. package/src/functions/mount/setup-element.js +26 -0
  102. package/src/functions/mount/setup-framepay-theme.js +82 -0
  103. package/src/functions/mount/setup-framepay.js +5 -1
  104. package/src/functions/mount/setup-i18n.js +19 -0
  105. package/src/functions/mount/setup-options.js +78 -48
  106. package/src/functions/mount/setup-options.spec.js +60 -0
  107. package/src/functions/mount/setup-storefront.js +6 -4
  108. package/src/functions/mount/setup-styles.js +4 -2
  109. package/src/functions/on.spec.js +1 -1
  110. package/src/functions/purchase.js +99 -23
  111. package/src/functions/purchase.spec.js +10 -10
  112. package/src/functions/setup.js +48 -0
  113. package/src/functions/setup.spec.js +98 -0
  114. package/src/functions/show.js +2 -4
  115. package/src/functions/show.spec.js +3 -4
  116. package/src/functions/update.js +40 -25
  117. package/src/functions/update.spec.js +0 -4
  118. package/src/i18n/en.json +5 -2
  119. package/src/i18n/es.json +4 -1
  120. package/src/index.js +9 -3
  121. package/src/index.spec.js +3 -21
  122. package/src/loader/index.js +3 -3
  123. package/src/storefront/index.js +28 -0
  124. package/src/storefront/invoices.js +11 -0
  125. package/src/storefront/models/base-model.js +10 -0
  126. package/src/storefront/models/invoice-model.js +3 -0
  127. package/src/storefront/models/plan-model.js +3 -35
  128. package/src/storefront/models/product-model.js +3 -23
  129. package/src/storefront/models/summary-model.js +12 -19
  130. package/src/storefront/models/transaction-model.js +19 -0
  131. package/src/storefront/payment-instruments.js +30 -0
  132. package/src/storefront/payment-instruments.spec.js +69 -0
  133. package/src/storefront/plans.js +6 -17
  134. package/src/storefront/plans.spec.js +4 -11
  135. package/src/storefront/products.js +8 -16
  136. package/src/storefront/products.spec.js +16 -22
  137. package/src/storefront/purchase.js +14 -16
  138. package/src/storefront/purchase.spec.js +2 -14
  139. package/src/storefront/ready-to-pay.js +13 -16
  140. package/src/storefront/ready-to-pay.spec.js +3 -10
  141. package/src/storefront/summary.js +19 -17
  142. package/src/storefront/summary.spec.js +5 -12
  143. package/src/storefront/transactions.js +11 -0
  144. package/src/style/base/__snapshots__/theme.spec.js.snap +188 -45
  145. package/src/style/base/default-theme.js +674 -0
  146. package/src/style/base/index.js +48 -16
  147. package/src/style/base/theme.js +17 -47
  148. package/src/style/base/theme.spec.js +4 -16
  149. package/src/style/components/address.js +3 -3
  150. package/src/style/components/button.js +32 -24
  151. package/src/style/components/divider.js +9 -9
  152. package/src/style/components/forms/checkbox.js +11 -11
  153. package/src/style/components/forms/field.js +18 -6
  154. package/src/style/components/forms/form.js +2 -2
  155. package/src/style/components/forms/input.js +54 -13
  156. package/src/style/components/forms/label.js +39 -18
  157. package/src/style/components/forms/select.js +54 -22
  158. package/src/style/components/forms/validation.js +53 -6
  159. package/src/style/components/icons.js +4 -4
  160. package/src/style/components/loader.js +4 -5
  161. package/src/style/components/methods.js +18 -15
  162. package/src/style/components/overlay.js +5 -5
  163. package/src/style/helpers/index.js +46 -46
  164. package/src/style/index.js +2 -1
  165. package/src/style/payment-instruments/payment-card.js +4 -4
  166. package/src/style/utils/border.js +34 -0
  167. package/src/style/utils/color-values.js +27 -1
  168. package/src/style/utils/remove-empty-null.js +10 -0
  169. package/src/style/vendor/framepay.js +11 -8
  170. package/src/style/vendor/postmate.js +2 -2
  171. package/src/style/views/confirmation.js +13 -13
  172. package/src/style/views/method-selector.js +2 -2
  173. package/src/style/views/modal.js +6 -6
  174. package/src/style/views/result.js +4 -4
  175. package/src/style/views/summary.js +26 -22
  176. package/src/views/__snapshots__/summary.spec.js.snap +77 -119
  177. package/src/views/common/iframe/base-iframe.js +2 -0
  178. package/src/views/common/iframe/modal-iframe.js +45 -3
  179. package/src/views/confirmation.js +15 -5
  180. package/src/views/method-selector/generate-digital-wallet.js +10 -3
  181. package/src/views/method-selector/generate-digital-wallet.spec.js +10 -0
  182. package/src/views/method-selector/get-payment-methods.js +7 -2
  183. package/src/views/method-selector/get-payment-methods.spec.js +26 -23
  184. package/src/views/method-selector/index.js +21 -28
  185. package/src/views/method-selector/method-selector.spec.js +49 -64
  186. package/src/views/method-selector/mount-methods.js +5 -8
  187. package/src/views/modal.js +6 -2
  188. package/src/views/result.js +4 -3
  189. package/src/views/summary.js +161 -117
  190. package/src/views/summary.spec.js +60 -75
  191. package/tests/mocks/rebilly-instruments-mock.js +37 -7
  192. package/tests/mocks/storefront-api-mock.js +8 -0
  193. package/tests/mocks/storefront-mock.js +17 -0
  194. package/dist/functions/mount/fetch-summary-data.js +0 -46
  195. package/dist/functions/mount/fetch-summary-data.spec.js +0 -43
  196. package/src/functions/mount/fetch-summary-data.js +0 -29
  197. package/src/functions/mount/fetch-summary-data.spec.js +0 -40
@@ -8,35 +8,56 @@ 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);
26
50
  }
27
51
 
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;
52
+ .is-floating .rebilly-instruments-form-field-input:focus + .rebilly-instruments-form-field-label,
53
+ .is-floating .rebilly-instruments-form-field-select:focus + .rebilly-instruments-form-field-label,
54
+ .is-floating .rebilly-instruments-form-field-label.is-active {
55
+ padding: 0 var(--rebilly-spacings-2xs);
56
+ left: calc(var(--rebilly-spacings-label-offset-left) - var(--rebilly-spacings-2xs));
57
+ line-height: 1;
58
+ background: var(--rebilly-colorBackground);
38
59
  opacity: 1;
39
- top: 0;
60
+ transform: translateY(-175%) scale(0.875);
40
61
  }
41
62
  `;
42
63
 
@@ -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;