@rebilly/instruments 3.0.0-beta.0 → 3.1.2-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 (169) hide show
  1. package/dist/index.js +88 -107
  2. package/dist/index.min.js +88 -0
  3. package/package.json +17 -6
  4. package/rollup.config.js +84 -0
  5. package/src/functions/mount/fetch-data.js +13 -1
  6. package/src/functions/mount/index.js +6 -42
  7. package/src/functions/mount/setup-framepay-theme.js +2 -2
  8. package/src/functions/mount/setup-options.js +3 -0
  9. package/src/functions/mount/setup-user-flow.js +49 -0
  10. package/src/functions/purchase.js +1 -1
  11. package/src/functions/setup.js +1 -1
  12. package/src/functions/show.spec.js +1 -1
  13. package/src/i18n/en.json +3 -0
  14. package/src/i18n/index.js +1 -1
  15. package/src/index.js +1 -61
  16. package/src/instance.js +65 -0
  17. package/src/{index.spec.js → instance.spec.js} +2 -1
  18. package/src/loader/index.js +21 -1
  19. package/src/storefront/models/ready-to-pay-model.js +13 -2
  20. package/src/storefront/plans.js +8 -4
  21. package/src/storefront/plans.spec.js +8 -2
  22. package/src/storefront/products.js +8 -4
  23. package/src/storefront/products.spec.js +8 -2
  24. package/src/storefront/ready-to-pay.js +5 -4
  25. package/src/style/base/__snapshots__/theme.spec.js.snap +34 -2
  26. package/src/style/base/default-theme.js +106 -3
  27. package/src/style/components/button.js +17 -1
  28. package/src/style/components/forms/label.js +0 -5
  29. package/src/style/components/loader.js +2 -1
  30. package/src/style/payment-instruments/payment-card.js +2 -1
  31. package/src/style/utils/remove-empty-null.js +9 -9
  32. package/src/style/vendor/postmate.js +13 -0
  33. package/src/style/views/confirmation.js +2 -1
  34. package/src/views/common/iframe/base-iframe.js +2 -0
  35. package/src/views/common/iframe/event-listeners.js +10 -0
  36. package/src/views/common/iframe/method-iframe.js +3 -1
  37. package/src/views/confirmation.js +1 -0
  38. package/src/views/method-selector/express-methods/{google-pay.js → index.js} +3 -2
  39. package/src/views/method-selector/mount-express-methods.js +6 -18
  40. package/src/views/result.js +1 -0
  41. package/tests/mocks/rebilly-instruments-mock.js +2 -2
  42. package/dist/events/base-event.js +0 -66
  43. package/dist/events/events.spec.js +0 -18
  44. package/dist/events/index.js +0 -22
  45. package/dist/functions/destroy.js +0 -34
  46. package/dist/functions/destroy.spec.js +0 -69
  47. package/dist/functions/mount/fetch-data.js +0 -187
  48. package/dist/functions/mount/fetch-data.spec.js +0 -189
  49. package/dist/functions/mount/index.js +0 -218
  50. package/dist/functions/mount/mount.spec.js +0 -64
  51. package/dist/functions/mount/setup-element.js +0 -40
  52. package/dist/functions/mount/setup-framepay-theme.js +0 -95
  53. package/dist/functions/mount/setup-framepay.js +0 -46
  54. package/dist/functions/mount/setup-i18n.js +0 -33
  55. package/dist/functions/mount/setup-options.js +0 -99
  56. package/dist/functions/mount/setup-options.spec.js +0 -66
  57. package/dist/functions/mount/setup-storefront.js +0 -34
  58. package/dist/functions/mount/setup-styles.js +0 -43
  59. package/dist/functions/on.js +0 -40
  60. package/dist/functions/on.spec.js +0 -55
  61. package/dist/functions/purchase.js +0 -158
  62. package/dist/functions/purchase.spec.js +0 -74
  63. package/dist/functions/setup.js +0 -85
  64. package/dist/functions/setup.spec.js +0 -87
  65. package/dist/functions/show.js +0 -55
  66. package/dist/functions/show.spec.js +0 -61
  67. package/dist/functions/update.js +0 -74
  68. package/dist/functions/update.spec.js +0 -86
  69. package/dist/i18n/en.json +0 -22
  70. package/dist/i18n/es.json +0 -22
  71. package/dist/i18n/i18n.spec.js +0 -22
  72. package/dist/i18n/index.js +0 -72
  73. package/dist/index.spec.js +0 -35
  74. package/dist/loader/index.js +0 -94
  75. package/dist/loader/loader.spec.js +0 -69
  76. package/dist/storefront/index.js +0 -73
  77. package/dist/storefront/invoices.js +0 -27
  78. package/dist/storefront/models/base-model.js +0 -18
  79. package/dist/storefront/models/invoice-model.js +0 -14
  80. package/dist/storefront/models/plan-model.js +0 -14
  81. package/dist/storefront/models/product-model.js +0 -14
  82. package/dist/storefront/models/ready-to-pay-model.js +0 -46
  83. package/dist/storefront/models/summary-model.js +0 -79
  84. package/dist/storefront/models/transaction-model.js +0 -31
  85. package/dist/storefront/payment-instruments.js +0 -47
  86. package/dist/storefront/payment-instruments.spec.js +0 -55
  87. package/dist/storefront/plans.js +0 -37
  88. package/dist/storefront/plans.spec.js +0 -64
  89. package/dist/storefront/products.js +0 -40
  90. package/dist/storefront/products.spec.js +0 -65
  91. package/dist/storefront/purchase.js +0 -43
  92. package/dist/storefront/purchase.spec.js +0 -48
  93. package/dist/storefront/ready-to-pay.js +0 -58
  94. package/dist/storefront/ready-to-pay.spec.js +0 -69
  95. package/dist/storefront/storefront.spec.js +0 -15
  96. package/dist/storefront/summary.js +0 -55
  97. package/dist/storefront/summary.spec.js +0 -124
  98. package/dist/storefront/transactions.js +0 -27
  99. package/dist/style/base/__snapshots__/theme.spec.js.snap +0 -195
  100. package/dist/style/base/default-theme.js +0 -699
  101. package/dist/style/base/index.js +0 -104
  102. package/dist/style/base/theme.js +0 -41
  103. package/dist/style/base/theme.spec.js +0 -19
  104. package/dist/style/browserslist.js +0 -8
  105. package/dist/style/components/address.js +0 -64
  106. package/dist/style/components/button.js +0 -71
  107. package/dist/style/components/divider.js +0 -48
  108. package/dist/style/components/forms/checkbox.js +0 -86
  109. package/dist/style/components/forms/field.js +0 -65
  110. package/dist/style/components/forms/form.js +0 -28
  111. package/dist/style/components/forms/input.js +0 -86
  112. package/dist/style/components/forms/label.js +0 -69
  113. package/dist/style/components/forms/select.js +0 -95
  114. package/dist/style/components/forms/validation.js +0 -81
  115. package/dist/style/components/icons.js +0 -22
  116. package/dist/style/components/index.js +0 -57
  117. package/dist/style/components/loader.js +0 -50
  118. package/dist/style/components/methods.js +0 -108
  119. package/dist/style/components/overlay.js +0 -33
  120. package/dist/style/helpers/index.js +0 -59
  121. package/dist/style/index.js +0 -50
  122. package/dist/style/payment-instruments/content.js +0 -17
  123. package/dist/style/payment-instruments/index.js +0 -20
  124. package/dist/style/payment-instruments/payment-card.js +0 -35
  125. package/dist/style/utils/border.js +0 -47
  126. package/dist/style/utils/color-values.js +0 -58
  127. package/dist/style/utils/remove-empty-null.js +0 -20
  128. package/dist/style/vendor/framepay.js +0 -37
  129. package/dist/style/vendor/postmate.js +0 -17
  130. package/dist/style/views/confirmation.js +0 -85
  131. package/dist/style/views/index.js +0 -29
  132. package/dist/style/views/method-selector.js +0 -20
  133. package/dist/style/views/modal.js +0 -93
  134. package/dist/style/views/result.js +0 -61
  135. package/dist/style/views/summary.js +0 -127
  136. package/dist/utils/add-dom-element.js +0 -26
  137. package/dist/utils/format-currency.js +0 -15
  138. package/dist/utils/has-valid-css-selector.js +0 -11
  139. package/dist/utils/index.js +0 -55
  140. package/dist/utils/is-dom-element.js +0 -10
  141. package/dist/utils/process-property-as-dom-element.js +0 -38
  142. package/dist/utils/sleep.js +0 -10
  143. package/dist/views/__snapshots__/summary.spec.js.snap +0 -246
  144. package/dist/views/common/iframe/base-iframe.js +0 -59
  145. package/dist/views/common/iframe/event-listeners.js +0 -50
  146. package/dist/views/common/iframe/index.js +0 -19
  147. package/dist/views/common/iframe/method-iframe.js +0 -33
  148. package/dist/views/common/iframe/modal-iframe.js +0 -84
  149. package/dist/views/common/iframe/view-iframe.js +0 -31
  150. package/dist/views/common/render-utilities.js +0 -11
  151. package/dist/views/confirmation.js +0 -92
  152. package/dist/views/method-selector/__snapshots__/method-selector.spec.js.snap +0 -3
  153. package/dist/views/method-selector/express-methods/apple-pay.js +0 -92
  154. package/dist/views/method-selector/express-methods/google-pay.js +0 -31
  155. package/dist/views/method-selector/express-methods/paypal.js +0 -19
  156. package/dist/views/method-selector/generate-digital-wallet.js +0 -68
  157. package/dist/views/method-selector/generate-digital-wallet.spec.js +0 -135
  158. package/dist/views/method-selector/get-method-data.js +0 -25
  159. package/dist/views/method-selector/get-payment-methods.js +0 -66
  160. package/dist/views/method-selector/get-payment-methods.spec.js +0 -46
  161. package/dist/views/method-selector/index.js +0 -122
  162. package/dist/views/method-selector/method-selector.spec.js +0 -124
  163. package/dist/views/method-selector/mount-express-methods.js +0 -69
  164. package/dist/views/method-selector/mount-methods.js +0 -74
  165. package/dist/views/modal.js +0 -88
  166. package/dist/views/result.js +0 -40
  167. package/dist/views/summary.js +0 -215
  168. package/dist/views/summary.spec.js +0 -134
  169. package/src/views/method-selector/express-methods/paypal.js +0 -7
@@ -1,58 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.alphaColor = alphaColor;
7
- exports.lighten = exports.darken = exports.mutedBorderColor = exports.mutedTextColor = exports.colorValues = void 0;
8
-
9
- var _values = _interopRequireDefault(require("values.js"));
10
-
11
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
12
-
13
- const colorValues = color => new _values.default(color);
14
-
15
- exports.colorValues = colorValues;
16
-
17
- function alphaColor(color, alphaValue = 1) {
18
- if (color === null) {
19
- return color;
20
- }
21
-
22
- const _alphaColor = colorValues(color);
23
-
24
- _alphaColor.alpha = alphaValue;
25
- return _alphaColor.rgbString();
26
- }
27
-
28
- const mutedTextColor = color => alphaColor(color, 0.6);
29
-
30
- exports.mutedTextColor = mutedTextColor;
31
-
32
- const mutedBorderColor = color => alphaColor(color, 0.25);
33
-
34
- exports.mutedBorderColor = mutedBorderColor;
35
-
36
- const darken = (color, percent) => {
37
- if (color === null) {
38
- return color;
39
- }
40
-
41
- const _color = colorValues(color);
42
-
43
- return _color.shade(percent).hexString();
44
- };
45
-
46
- exports.darken = darken;
47
-
48
- const lighten = (color, percent) => {
49
- if (color === null) {
50
- return color;
51
- }
52
-
53
- const _color = colorValues(color);
54
-
55
- return _color.tint(percent).hexString();
56
- };
57
-
58
- exports.lighten = lighten;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- var _postcss = _interopRequireDefault(require("postcss"));
9
-
10
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
-
12
- var _default = _postcss.default.plugin('postcss-remove-empty-null', () => root => {
13
- root.walkDecls(decl => {
14
- if ((decl.value === '\'\'' || decl.value === '""' || decl.value.includes('null')) && decl.prop !== 'content') {
15
- decl.remove();
16
- }
17
- });
18
- });
19
-
20
- exports.default = _default;
@@ -1,37 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.framepayStyle = void 0;
7
-
8
- const framepayStyle = () => `
9
- .rebilly-instruments-framepay .rebilly-framepay {
10
- min-height: var(--rebilly-spacings-form-element-min-height);
11
- border: var(--rebilly-inputBorder);
12
- margin-bottom: 0;
13
- background: var(--rebilly-inputColorBackground);
14
- border-radius: var(--rebilly-inputBorderRadius);
15
- box-shadow: var(--rebilly-inputBoxShadow);
16
- }
17
-
18
- .rebilly-instruments-framepay .rebilly-framepay.rebilly-framepay-focus {
19
- background: var(--rebilly-inputFocusColorBackground);
20
- border: var(--rebilly-inputFocusBorder);
21
- border-radius: var(--rebilly-inputFocusBorderRadius);
22
- box-shadow: var(--rebilly-inputFocusBoxShadow);
23
- }
24
-
25
- .rebilly-instruments-framepay .rebilly-framepay.rebilly-framepay-invalid {
26
- border-color: var(--rebilly-colorDanger);
27
- box-shadow: none;
28
- }
29
-
30
- .rebilly-instruments-framepay .rebilly-framepay.rebilly-framepay-digital-wallet {
31
- min-height: auto;
32
- border: none;
33
- margin: 0;
34
- }
35
- `;
36
-
37
- exports.framepayStyle = framepayStyle;
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.postmateStyle = void 0;
7
-
8
- const postmateStyle = () => `
9
- .rebilly-instruments-iframe {
10
- border: none;
11
- width: 100%;
12
- min-height: var(--rebilly-spacings-form-element-min-height);
13
- transition: all 0.2s ease;
14
- }
15
- `;
16
-
17
- exports.postmateStyle = postmateStyle;
@@ -1,85 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.confirmation = void 0;
7
-
8
- // -----------------------------------------------------------------------------
9
- // This file contains all styles related to the confirmation view.
10
- // -----------------------------------------------------------------------------
11
- const confirmation = () => `
12
- /**
13
- * Confirmation
14
- */
15
- .rebilly-instruments-confirmation {
16
- padding: 2px;
17
- }
18
-
19
- .rebilly-instruments-confirmation-go-back-link {
20
- display: inline-block;
21
- margin-bottom: var(--rebilly-spacings-base);
22
- margin-left: calc(var(--rebilly-spacings-xs) * -1);
23
- }
24
-
25
- .rebilly-instruments-confirmation-address-title {
26
- display: flex;
27
- justify-content: flex-start;
28
- }
29
-
30
- .rebilly-instruments-confirmation-address-title .rebilly-instruments-link {
31
- margin-left: var(--rebilly-spacings-s);
32
- }
33
-
34
- .rebilly-instruments-confirmation-address-actions {
35
- margin-top: var(--rebilly-spacings-base);
36
- display: flex;
37
- }
38
-
39
- .rebilly-instruments-confirmation-address-actions :first-child {
40
- margin: 0 var(--rebilly-spacings-xs) 0 0;
41
- }
42
-
43
- .rebilly-instruments-confirmation-address-actions :last-child {
44
- margin: 0 0 0 var(--rebilly-spacings-xs);
45
- }
46
-
47
- .rebilly-instruments-confirmation-payment-method {
48
- display: inline-flex;
49
- align-items: center;
50
- justify-content: space-between;
51
- height: 26px;
52
- margin: 0 0 var(--rebilly-spacings-l);
53
- }
54
-
55
- .rebilly-instruments-confirmation-payment-method figure {
56
- margin: 0 var(--rebilly-spacings-2xs) 0 0;
57
- height: 26px;
58
- padding: 0;
59
- }
60
-
61
- .rebilly-instruments-confirmation-payment-method figure img {
62
- width: 42px;
63
- border-radius: 4px;
64
- }
65
-
66
- .rebilly-instruments-confirmation-payment-method-brand,
67
- .rebilly-instruments-confirmation-payment-method-exp,
68
- .rebilly-instruments-confirmation-payment-method-last4 {
69
- display: inline-block;
70
- }
71
-
72
- .rebilly-instruments-confirmation-payment-method-brand {
73
- margin: 0 0 0 var(--rebilly-spacings-s);
74
- }
75
-
76
- .rebilly-instruments-confirmation-payment-method-last4 {
77
- margin: 0 var(--rebilly-spacings-s);
78
- }
79
-
80
- .rebilly-instruments-confirmation-payment-method-exp {
81
- color: var(--rebilly-colorMutedText);
82
- }
83
- `;
84
-
85
- exports.confirmation = confirmation;
@@ -1,29 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.views = void 0;
7
-
8
- var _summary = require("./summary");
9
-
10
- var _methodSelector = require("./method-selector");
11
-
12
- var _confirmation = require("./confirmation");
13
-
14
- var _result = require("./result");
15
-
16
- var _modal = require("./modal");
17
-
18
- // Order of components matters for style cascade
19
- const views = theme => `
20
- /* Views
21
- ------------------------------------------------------------ */
22
- ${(0, _summary.summary)(theme)}
23
- ${(0, _methodSelector.methodSelector)(theme)}
24
- ${(0, _confirmation.confirmation)(theme)}
25
- ${(0, _result.result)(theme)}
26
- ${(0, _modal.modal)(theme)}
27
- `;
28
-
29
- exports.views = views;
@@ -1,20 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.methodSelector = void 0;
7
-
8
- // -----------------------------------------------------------------------------
9
- // This file contains all styles related to the selector view.
10
- // -----------------------------------------------------------------------------
11
- const methodSelector = () => `
12
- /**
13
- * Method selector
14
- */
15
- .rebilly-instruments-method-selector.has-express-compact {
16
- padding-top: var(--rebilly-spacings-s);
17
- }
18
- `;
19
-
20
- exports.methodSelector = methodSelector;
@@ -1,93 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.modal = void 0;
7
-
8
- // -----------------------------------------------------------------------------
9
- // This file contains all styles related to the modal view.
10
- // -----------------------------------------------------------------------------
11
- const modal = () => `
12
- /**
13
- * Modal
14
- */
15
-
16
- .rebilly-instruments-modal-overlay {
17
- position: fixed;
18
- top: 0;
19
- left: 0;
20
- overflow-x: hidden;
21
- overflow-y: auto;
22
- z-index: 1055;
23
- padding: 30px;
24
- width: 100%;
25
- height: 100%;
26
- margin: 0;
27
- padding: 0;
28
- transition: all 0.12s ease-in-out;
29
- background-color: rgba(0,0,0,0.7);
30
- opacity: 0
31
- }
32
-
33
- .rebilly-instruments-modal-overlay.is-visible {
34
- opacity: 1;
35
- }
36
-
37
- .rebilly-instruments-modal-container {
38
- transition: all .24s ease-in-out;
39
- position: relative;
40
- max-width: 800px;
41
- background: var(--rebilly-colorBackground);
42
- margin: 50px auto 20px;
43
- box-shadow: 0 19px 38px rgba(0,0,0,0.20), 0 15px 12px rgba(0,0,0,0.12);
44
- border-radius: 4px;
45
- transform: translateY(-50px);
46
- opacity: 0;
47
- }
48
-
49
- .rebilly-instruments-modal-container.is-visible {
50
- transform: translateY(0);
51
- opacity: 1;
52
- }
53
-
54
- .rebilly-instruments-modal-container.is-redirect {
55
- max-width: 60vw;
56
- width: auto;
57
- }
58
-
59
- .rebilly-instruments-modal-content {
60
- transition: all .15s;
61
- padding: 20px;
62
- overflow: hidden;
63
- background-color: var(--rebilly-colorBackground);
64
- text-align: center;
65
- border-radius: 4px;
66
- }
67
-
68
- .rebilly-instruments-modal-content .rebilly-instruments-iframe {
69
- transition: all .15s;
70
- height: auto;
71
- min-height: 360px;
72
- }
73
-
74
- .rebilly-instruments-modal-container.is-redirect .rebilly-instruments-modal-content {
75
- padding: 0;
76
- }
77
-
78
- .rebilly-instruments-modal-close {
79
- position: absolute;
80
- width: 30px;
81
- height: 30px;
82
- top: -40px;
83
- right: 0;
84
- fill: #FFF;
85
- cursor: pointer;
86
- }
87
-
88
- .rebilly-instruments-modal-close:hover{
89
- color: #000;
90
- }
91
- `;
92
-
93
- exports.modal = modal;
@@ -1,61 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.result = void 0;
7
-
8
- // -----------------------------------------------------------------------------
9
- // This file contains all styles related to the result view.
10
- // -----------------------------------------------------------------------------
11
- const result = () => `
12
- /**
13
- * Result
14
- */
15
- .rebilly-instruments-results .rebilly-instruments-h1 {
16
- text-align: center;
17
- margin: 0;
18
- }
19
-
20
- .rebilly-instruments-results-icon {
21
- width: 160px;
22
- margin: 0 auto var(--rebilly-spacings-base) auto;
23
- display: block;
24
- }
25
-
26
- .rebilly-instruments-results-icon g {
27
- stroke: var(--rebilly-colorPrimary);
28
- }
29
-
30
- .rebilly-instruments-results-icon.is-error g {
31
- stroke: var(--rebilly-colorDanger);
32
- }
33
-
34
- .rebilly-instruments-results-icon path {
35
- stroke-linecap: round;
36
- stroke-linejoin: round;
37
- }
38
-
39
- .rebilly-instruments-results-icon path.circle {
40
- stroke-dasharray: 350;
41
- stroke-dashoffset: 0;
42
- animation: 0.6s cubic-bezier(1.0, 0.5, 0.8, 1.0) 1 rebillyDashResultIcon;
43
- }
44
-
45
- .rebilly-instruments-results-icon path.mark {
46
- stroke-dasharray: 350;
47
- stroke-dashoffset: 0;
48
- animation: 1s cubic-bezier(1.0, 0.5, 0.8, 1.0) 1 rebillyDashResultIcon;
49
- }
50
-
51
- @keyframes rebillyDashResultIcon {
52
- from {
53
- stroke-dashoffset: 350;
54
- }
55
- to {
56
- stroke-dashoffset: 0;
57
- }
58
- }
59
- `;
60
-
61
- exports.result = result;
@@ -1,127 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.summary = void 0;
7
-
8
- // -----------------------------------------------------------------------------
9
- // This file contains all styles related to the summary view.
10
- // -----------------------------------------------------------------------------
11
- const summary = () => `
12
- /**
13
- * Summary
14
- */
15
- .rebilly-instruments-summary-line-item {
16
- border-bottom: 1px solid var(--rebilly-colorMutedBorder);
17
- padding: var(--rebilly-spacings-s) 0;
18
- display: flex;
19
- align-items: center;
20
- position: relative;
21
- }
22
-
23
- .rebilly-instruments-summary-line-item:first-child {
24
- padding-top: 0;
25
- }
26
-
27
- .rebilly-instruments-summary-line-item-figure {
28
- margin: 0 var(--rebilly-spacings-s) 0 0;
29
- flex: 0 0 auto;
30
- width: 48px;
31
- height: 48px;
32
- border-radius: var(--rebilly-borderRadius);
33
- border: 1px solid var(--rebilly-colorMutedBorder);
34
- overflow: hidden;
35
- }
36
-
37
- .rebilly-instruments-summary-line-item-figure img {
38
- width: 100%;
39
- }
40
-
41
- .rebilly-instruments-summary-line-item-synopsis {
42
- flex: 1 2 auto;
43
- }
44
-
45
- .rebilly-instruments-summary-line-item-synopsis-title {
46
- margin: 0;
47
- font-weight: 500;
48
- }
49
-
50
- .rebilly-instruments-summary-line-item-synopsis-description {
51
- color: var(--rebilly-colorMutedText);
52
- margin: 0;
53
- font-size: calc(var(--rebilly-fontSizeBase) * 0.875);
54
- line-height: 1;
55
- }
56
-
57
- .rebilly-instruments-summary-line-item-price-breakdown {
58
- display: flex;
59
- justify-content: center;
60
- align-items: center;
61
- color: var(--rebilly-colorMutedText);
62
- margin: 0 0 0 var(--rebilly-spacings-s);
63
- }
64
-
65
- .rebilly-instruments-summary-line-item-price-breakdown .rebilly-instruments-icon {
66
- fill: var(--rebilly-colorMutedText);
67
- }
68
-
69
- .rebilly-instruments-summary-line-item-price-breakdown-unit-price {
70
- color: var(--rebilly-colorText);
71
- }
72
-
73
- .rebilly-instruments-summary-breakdown table {
74
- width: 100%;
75
- margin: var(--rebilly-spacings-xs) 0;
76
- color: inherit;
77
- }
78
-
79
- .rebilly-instruments-summary-breakdown table colgroup col:first-child {
80
- width: 85%;
81
- }
82
-
83
- .rebilly-instruments-summary-breakdown table colgroup col {
84
- width: 15%;
85
- }
86
-
87
- .rebilly-instruments-summary-breakdown table tr td {
88
- text-align: right;
89
- }
90
-
91
- .rebilly-instruments-summary-breakdown table tr td:first-child {
92
- padding-right: var(--rebilly-spacings-s);
93
- font-weight: 500;
94
- }
95
-
96
- .rebilly-instruments-summary-breakdown table {
97
- border-bottom: 1px solid var(--rebilly-colorMutedBorder);
98
- padding-bottom: var(--rebilly-spacings-xs);
99
- }
100
-
101
- .rebilly-instruments-summary-breakdown-total {
102
- padding-top: var(--rebilly-spacings-xs);
103
- display: flex;
104
- align-items: center;
105
- }
106
-
107
- .rebilly-instruments-summary-breakdown-total p {
108
- margin: var(--rebilly-spacings-s) 0;
109
- }
110
-
111
- .rebilly-instruments-summary-breakdown-total-amount {
112
- flex: 1 2 80%;
113
- font-size: calc(var(--rebilly-fontSizeBase) * 1.5);
114
- font-weight: 500;
115
- text-align: right;
116
- font-weight: bold;
117
- }
118
-
119
- .rebilly-instruments-summary-breakdown-total-amount-currency {
120
- font-size: var(--rebilly-fontSizeBase);
121
- font-weight: normal;
122
- color: var(--rebilly-colorMutedText);
123
- margin-right: var(--rebilly-spacings-s);
124
- }
125
- `;
126
-
127
- exports.summary = summary;
@@ -1,26 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = addDOMElement;
7
-
8
- function addDOMElement({
9
- element = 'div',
10
- attributes = {},
11
- content = null,
12
- target = 'body',
13
- insertMethod = 'append'
14
- } = {}) {
15
- const ELEMENT = document.createElement(element);
16
- const ELEMENT_ATTRIBUTES = Object.entries(attributes);
17
- ELEMENT_ATTRIBUTES.forEach(([attribute, value]) => {
18
- ELEMENT.setAttribute(attribute, value);
19
- });
20
-
21
- if (content) {
22
- ELEMENT.innerHTML = content;
23
- }
24
-
25
- document[target][insertMethod](ELEMENT);
26
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = formatCurrency;
7
-
8
- function formatCurrency(number, currency) {
9
- const converToNumber = Number(number);
10
- if (Number.isNaN(converToNumber) || number === null) return '-';
11
- return new Intl.NumberFormat('en-US', {
12
- style: 'currency',
13
- currency: currency || 'USD'
14
- }).format(number);
15
- }
@@ -1,11 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = hasValidCSSSelector;
7
-
8
- function hasValidCSSSelector(selector) {
9
- const REGEX_CSS_SELECTOR = /([.#][_a-z]+[_a-z0-9-:\\]*)/gi;
10
- return typeof selector === 'string' && selector.match(REGEX_CSS_SELECTOR);
11
- }
@@ -1,55 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- Object.defineProperty(exports, "addDOMElement", {
7
- enumerable: true,
8
- get: function () {
9
- return _addDomElement.default;
10
- }
11
- });
12
- Object.defineProperty(exports, "processPropertyAsDOMElement", {
13
- enumerable: true,
14
- get: function () {
15
- return _processPropertyAsDomElement.default;
16
- }
17
- });
18
- Object.defineProperty(exports, "isDOMElement", {
19
- enumerable: true,
20
- get: function () {
21
- return _isDomElement.default;
22
- }
23
- });
24
- Object.defineProperty(exports, "hasValidCSSSelector", {
25
- enumerable: true,
26
- get: function () {
27
- return _hasValidCssSelector.default;
28
- }
29
- });
30
- Object.defineProperty(exports, "formatCurrency", {
31
- enumerable: true,
32
- get: function () {
33
- return _formatCurrency.default;
34
- }
35
- });
36
- Object.defineProperty(exports, "sleep", {
37
- enumerable: true,
38
- get: function () {
39
- return _sleep.default;
40
- }
41
- });
42
-
43
- var _addDomElement = _interopRequireDefault(require("./add-dom-element"));
44
-
45
- var _processPropertyAsDomElement = _interopRequireDefault(require("./process-property-as-dom-element"));
46
-
47
- var _isDomElement = _interopRequireDefault(require("./is-dom-element"));
48
-
49
- var _hasValidCssSelector = _interopRequireDefault(require("./has-valid-css-selector"));
50
-
51
- var _formatCurrency = _interopRequireDefault(require("./format-currency"));
52
-
53
- var _sleep = _interopRequireDefault(require("./sleep"));
54
-
55
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = isDOMElement;
7
-
8
- function isDOMElement(element) {
9
- return element instanceof Element || element instanceof HTMLDocument;
10
- }