@rebilly/instruments 1.0.1-beta → 1.0.2-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) hide show
  1. package/.babelrc +23 -5
  2. package/.eslintrc.js +27 -0
  3. package/.prettierrc.js +11 -0
  4. package/CONTRIBUTING.md +4 -0
  5. package/README.md +361 -2
  6. package/dist/events/base-event.js +51 -37
  7. package/dist/events/events.spec.js +18 -0
  8. package/dist/events/index.js +11 -8
  9. package/dist/functions/destroy.js +27 -5
  10. package/dist/functions/destroy.spec.js +69 -0
  11. package/dist/functions/initialize.js +60 -41
  12. package/dist/functions/initialize.spec.js +13 -13
  13. package/dist/functions/mount/fetch-summary-data.js +46 -0
  14. package/dist/functions/mount/fetch-summary-data.spec.js +44 -0
  15. package/dist/functions/mount/index.js +346 -0
  16. package/dist/functions/mount/mount.spec.js +135 -0
  17. package/dist/functions/on.js +26 -18
  18. package/dist/functions/on.spec.js +45 -63
  19. package/dist/functions/purchase.js +41 -154
  20. package/dist/functions/purchase.spec.js +60 -76
  21. package/dist/functions/show.js +39 -43
  22. package/dist/functions/show.spec.js +57 -0
  23. package/dist/functions/update.js +60 -5
  24. package/dist/functions/update.spec.js +100 -0
  25. package/dist/i18n/en.json +19 -0
  26. package/dist/i18n/es.json +19 -0
  27. package/dist/i18n/i18n.spec.js +6 -23
  28. package/dist/i18n/index.js +44 -67
  29. package/dist/index.js +70 -71
  30. package/dist/index.spec.js +24 -44
  31. package/dist/loader/index.js +63 -62
  32. package/dist/loader/loader.spec.js +14 -11
  33. package/dist/storefront/index.js +28 -39
  34. package/dist/storefront/models/plan-model.js +37 -54
  35. package/dist/storefront/models/product-model.js +25 -36
  36. package/dist/storefront/models/ready-to-pay-model.js +38 -42
  37. package/dist/storefront/models/summary-model.js +72 -99
  38. package/dist/storefront/plans.js +37 -84
  39. package/dist/storefront/plans.spec.js +61 -151
  40. package/dist/storefront/products.js +35 -83
  41. package/dist/storefront/products.spec.js +60 -150
  42. package/dist/storefront/purchase.js +27 -64
  43. package/dist/storefront/purchase.spec.js +51 -87
  44. package/dist/storefront/ready-to-pay.js +45 -107
  45. package/dist/storefront/ready-to-pay.spec.js +72 -147
  46. package/dist/storefront/storefront.spec.js +6 -6
  47. package/dist/storefront/summary.js +37 -84
  48. package/dist/storefront/summary.spec.js +135 -240
  49. package/dist/style/base/__snapshots__/theme.spec.js.snap +52 -0
  50. package/dist/style/base/index.js +72 -0
  51. package/dist/style/base/theme.js +73 -0
  52. package/dist/style/base/theme.spec.js +30 -0
  53. package/dist/style/browserslist.js +8 -0
  54. package/dist/style/components/address.js +64 -0
  55. package/dist/style/components/button.js +61 -0
  56. package/dist/style/components/divider.js +48 -0
  57. package/dist/style/components/forms/checkbox.js +83 -0
  58. package/dist/style/components/forms/field.js +53 -0
  59. package/dist/style/components/forms/form.js +28 -0
  60. package/dist/style/components/forms/input.js +45 -0
  61. package/dist/style/components/forms/label.js +43 -0
  62. package/dist/style/components/forms/select.js +63 -0
  63. package/dist/style/components/forms/validation.js +34 -0
  64. package/dist/style/components/icons.js +22 -0
  65. package/dist/style/components/index.js +57 -0
  66. package/dist/style/components/loader.js +48 -0
  67. package/dist/style/components/methods.js +104 -0
  68. package/dist/style/components/overlay.js +33 -0
  69. package/dist/style/helpers/index.js +59 -0
  70. package/dist/style/index.js +48 -0
  71. package/dist/style/payment-instruments/content.js +17 -0
  72. package/dist/style/payment-instruments/index.js +20 -0
  73. package/dist/style/payment-instruments/payment-card.js +35 -0
  74. package/dist/style/utils/color-values.js +22 -0
  75. package/dist/style/vendor/framepay.js +34 -0
  76. package/dist/style/vendor/postmate.js +17 -0
  77. package/dist/style/views/confirmation.js +85 -0
  78. package/dist/style/views/index.js +29 -0
  79. package/dist/style/views/method-selector.js +20 -0
  80. package/dist/style/views/modal.js +93 -0
  81. package/dist/style/views/result.js +61 -0
  82. package/dist/style/views/summary.js +123 -0
  83. package/dist/utils/add-dom-element.js +12 -34
  84. package/dist/utils/format-currency.js +4 -4
  85. package/dist/utils/has-valid-css-selector.js +2 -2
  86. package/dist/utils/index.js +15 -31
  87. package/dist/utils/is-dom-element.js +1 -1
  88. package/dist/utils/process-property-as-dom-element.js +12 -17
  89. package/dist/utils/sleep.js +10 -0
  90. package/{src/components → dist/views}/__snapshots__/summary.spec.js.snap +7 -3
  91. package/dist/views/common/iframe/base-iframe.js +57 -0
  92. package/dist/views/common/iframe/event-listeners.js +50 -0
  93. package/dist/views/common/iframe/index.js +19 -0
  94. package/dist/views/common/iframe/method-iframe.js +33 -0
  95. package/dist/views/common/iframe/modal-iframe.js +38 -0
  96. package/dist/views/common/iframe/view-iframe.js +31 -0
  97. package/dist/views/common/render-utilities.js +11 -0
  98. package/dist/views/confirmation.js +82 -0
  99. package/dist/views/method-selector/__snapshots__/method-selector.spec.js.snap +3 -0
  100. package/dist/views/method-selector/express-methods/apple-pay.js +92 -0
  101. package/dist/views/method-selector/express-methods/google-pay.js +32 -0
  102. package/dist/views/method-selector/express-methods/paypal.js +19 -0
  103. package/dist/views/method-selector/generate-digital-wallet.js +59 -0
  104. package/dist/views/method-selector/generate-digital-wallet.spec.js +132 -0
  105. package/dist/views/method-selector/get-method-data.js +25 -0
  106. package/dist/views/method-selector/get-payment-methods.js +55 -0
  107. package/dist/views/method-selector/get-payment-methods.spec.js +44 -0
  108. package/dist/views/method-selector/index.js +133 -0
  109. package/dist/views/method-selector/method-selector.spec.js +139 -0
  110. package/dist/views/method-selector/mount-express-methods.js +69 -0
  111. package/dist/views/method-selector/mount-methods.js +78 -0
  112. package/dist/views/modal.js +83 -0
  113. package/dist/views/result.js +42 -0
  114. package/dist/views/summary.js +162 -0
  115. package/dist/views/summary.spec.js +148 -0
  116. package/package.json +12 -6
  117. package/src/events/base-event.js +35 -12
  118. package/src/events/events.spec.js +11 -0
  119. package/src/events/index.js +12 -6
  120. package/src/functions/destroy.js +22 -3
  121. package/src/functions/destroy.spec.js +63 -0
  122. package/src/functions/initialize.js +43 -20
  123. package/src/functions/initialize.spec.js +9 -7
  124. package/src/functions/mount/fetch-summary-data.js +29 -0
  125. package/src/functions/mount/fetch-summary-data.spec.js +41 -0
  126. package/src/functions/mount/index.js +312 -0
  127. package/src/functions/mount/mount.spec.js +171 -0
  128. package/src/functions/on.js +17 -14
  129. package/src/functions/on.spec.js +39 -29
  130. package/src/functions/purchase.js +24 -64
  131. package/src/functions/purchase.spec.js +19 -17
  132. package/src/functions/show.js +27 -7
  133. package/src/functions/show.spec.js +61 -0
  134. package/src/functions/update.js +50 -3
  135. package/src/functions/update.spec.js +107 -0
  136. package/src/i18n/i18n.spec.js +6 -4
  137. package/src/i18n/index.js +20 -12
  138. package/src/index.js +43 -49
  139. package/src/index.spec.js +11 -42
  140. package/src/loader/index.js +55 -39
  141. package/src/loader/loader.spec.js +30 -23
  142. package/src/storefront/index.js +9 -7
  143. package/src/storefront/models/plan-model.js +1 -1
  144. package/src/storefront/models/product-model.js +1 -1
  145. package/src/storefront/models/ready-to-pay-model.js +10 -4
  146. package/src/storefront/models/summary-model.js +8 -15
  147. package/src/storefront/plans.js +16 -12
  148. package/src/storefront/plans.spec.js +29 -37
  149. package/src/storefront/products.js +16 -12
  150. package/src/storefront/products.spec.js +28 -39
  151. package/src/storefront/purchase.js +8 -6
  152. package/src/storefront/purchase.spec.js +18 -17
  153. package/src/storefront/ready-to-pay.js +19 -13
  154. package/src/storefront/ready-to-pay.spec.js +41 -41
  155. package/src/storefront/storefront.spec.js +1 -1
  156. package/src/storefront/summary.js +14 -12
  157. package/src/storefront/summary.spec.js +37 -50
  158. package/src/style/base/__snapshots__/theme.spec.js.snap +52 -0
  159. package/src/style/base/index.js +63 -0
  160. package/src/style/base/theme.js +61 -0
  161. package/src/style/base/theme.spec.js +32 -0
  162. package/src/style/browserslist.js +1 -0
  163. package/src/style/components/address.js +55 -0
  164. package/src/style/components/button.js +54 -0
  165. package/src/style/components/divider.js +39 -0
  166. package/src/style/components/forms/checkbox.js +76 -0
  167. package/src/style/components/forms/field.js +44 -0
  168. package/src/style/components/forms/form.js +19 -0
  169. package/src/style/components/forms/input.js +36 -0
  170. package/src/style/components/forms/label.js +34 -0
  171. package/src/style/components/forms/select.js +54 -0
  172. package/src/style/components/forms/validation.js +25 -0
  173. package/src/style/components/icons.js +13 -0
  174. package/src/style/components/index.js +35 -0
  175. package/src/style/components/loader.js +41 -0
  176. package/src/style/components/methods.js +93 -0
  177. package/src/style/components/overlay.js +24 -0
  178. package/src/style/helpers/index.js +51 -0
  179. package/src/style/index.js +30 -0
  180. package/src/style/payment-instruments/content.js +8 -0
  181. package/src/style/payment-instruments/index.js +10 -0
  182. package/src/style/payment-instruments/payment-card.js +26 -0
  183. package/src/style/utils/color-values.js +9 -0
  184. package/src/style/vendor/framepay.js +25 -0
  185. package/src/style/vendor/postmate.js +8 -0
  186. package/src/style/views/confirmation.js +76 -0
  187. package/src/style/views/index.js +16 -0
  188. package/src/style/views/method-selector.js +11 -0
  189. package/src/style/views/modal.js +84 -0
  190. package/src/style/views/result.js +52 -0
  191. package/src/style/views/summary.js +114 -0
  192. package/src/utils/add-dom-element.js +12 -13
  193. package/src/utils/format-currency.js +4 -1
  194. package/src/utils/has-valid-css-selector.js +2 -2
  195. package/src/utils/index.js +2 -6
  196. package/src/utils/is-dom-element.js +1 -1
  197. package/src/utils/process-property-as-dom-element.js +27 -24
  198. package/src/utils/sleep.js +3 -0
  199. package/src/views/__snapshots__/summary.spec.js.snap +292 -0
  200. package/src/views/common/iframe/base-iframe.js +46 -0
  201. package/src/views/common/iframe/event-listeners.js +27 -0
  202. package/src/views/common/iframe/index.js +7 -0
  203. package/src/views/common/iframe/method-iframe.js +21 -0
  204. package/src/views/common/iframe/modal-iframe.js +27 -0
  205. package/src/views/common/iframe/view-iframe.js +18 -0
  206. package/src/views/common/render-utilities.js +4 -0
  207. package/src/views/confirmation.js +57 -0
  208. package/src/views/method-selector/__snapshots__/method-selector.spec.js.snap +3 -0
  209. package/src/views/method-selector/express-methods/apple-pay.js +78 -0
  210. package/src/views/method-selector/express-methods/google-pay.js +25 -0
  211. package/src/views/method-selector/express-methods/paypal.js +7 -0
  212. package/src/views/method-selector/generate-digital-wallet.js +44 -0
  213. package/src/views/method-selector/generate-digital-wallet.spec.js +131 -0
  214. package/src/{components/form → views/method-selector}/get-method-data.js +9 -5
  215. package/src/views/method-selector/get-payment-methods.js +40 -0
  216. package/src/views/method-selector/get-payment-methods.spec.js +40 -0
  217. package/src/views/method-selector/index.js +110 -0
  218. package/src/views/method-selector/method-selector.spec.js +146 -0
  219. package/src/views/method-selector/mount-express-methods.js +53 -0
  220. package/src/views/method-selector/mount-methods.js +71 -0
  221. package/src/views/modal.js +84 -0
  222. package/src/views/result.js +30 -0
  223. package/src/{components → views}/summary.js +90 -21
  224. package/src/views/summary.spec.js +170 -0
  225. package/tests/async-utilities.js +22 -0
  226. package/tests/mocks/rebilly-instruments-mock.js +105 -7
  227. package/dist/components/confirmation.js +0 -103
  228. package/dist/components/form/form.js +0 -110
  229. package/dist/components/form/form.spec.js +0 -135
  230. package/dist/components/form/get-method-data.js +0 -21
  231. package/dist/components/form/get-payment-methods.js +0 -42
  232. package/dist/components/form/method-selector.js +0 -61
  233. package/dist/components/form/mount-express-payment-methods.js +0 -102
  234. package/dist/components/form/process-digital-wallet-options.js +0 -20
  235. package/dist/components/form/zoid-helpers.js +0 -130
  236. package/dist/components/result.js +0 -66
  237. package/dist/components/summary.js +0 -60
  238. package/dist/components/summary.spec.js +0 -144
  239. package/dist/events/instrument-ready.js +0 -51
  240. package/dist/events/purchase-complete.js +0 -51
  241. package/dist/functions/mount.js +0 -311
  242. package/dist/functions/mount.spec.js +0 -203
  243. package/dist/styles/base-styles.js +0 -12
  244. package/dist/styles/flat-theme-object.js +0 -42
  245. package/dist/styles/framepay.js +0 -15
  246. package/dist/styles/main.js +0 -25
  247. package/dist/styles/payment-card.js +0 -12
  248. package/dist/styles/shade-tint-values-helper.js +0 -28
  249. package/dist/styles/style-variables.js +0 -43
  250. package/dist/utils/camel-case.js +0 -12
  251. package/dist/utils/kebab-case.js +0 -10
  252. package/dist/utils/un-kebab-case.js +0 -10
  253. package/src/components/confirmation.js +0 -77
  254. package/src/components/form/__snapshots__/form.spec.js.snap +0 -43
  255. package/src/components/form/form.js +0 -88
  256. package/src/components/form/form.spec.js +0 -109
  257. package/src/components/form/get-payment-methods.js +0 -32
  258. package/src/components/form/method-selector.js +0 -47
  259. package/src/components/form/mount-express-payment-methods.js +0 -84
  260. package/src/components/form/process-digital-wallet-options.js +0 -11
  261. package/src/components/form/zoid-helpers.js +0 -114
  262. package/src/components/result.js +0 -50
  263. package/src/components/summary.spec.js +0 -106
  264. package/src/events/instrument-ready.js +0 -11
  265. package/src/events/purchase-complete.js +0 -11
  266. package/src/functions/mount.js +0 -204
  267. package/src/functions/mount.spec.js +0 -172
  268. package/src/styles/base-styles.js +0 -741
  269. package/src/styles/flat-theme-object.js +0 -12
  270. package/src/styles/framepay.js +0 -30
  271. package/src/styles/main.js +0 -17
  272. package/src/styles/payment-card.js +0 -18
  273. package/src/styles/shade-tint-values-helper.js +0 -13
  274. package/src/styles/style-variables.js +0 -34
  275. package/src/utils/camel-case.js +0 -3
  276. package/src/utils/kebab-case.js +0 -3
  277. package/src/utils/un-kebab-case.js +0 -3
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.BASE_STYLE = void 0;
7
-
8
- var BASE_STYLE = function BASE_STYLE(STYLES_VARIABLES, primaryValues, textColorMuted) {
9
- return "\n /* Loader */\n .rebilly-instruments-loader {\n display: none;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n justify-content: center;\n align-items: center;\n background-color: ".concat(STYLES_VARIABLES.background, ";\n z-index: 9000;\n transition: all 200ms;\n }\n\n .rebilly-instruments-loader.active {\n display: flex;\n }\n\n .rebilly-instruments-loader-spinner {\n border: 4px solid ").concat(primaryValues.tint(80).hexString(), ";\n border-top: 4px solid ").concat(STYLES_VARIABLES.primary, ";\n border-radius: 50%;\n width: 40px;\n height: 40px;\n animation: spin 0.5s ease infinite;\n }\n\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n\n /* Helpers */\n .visually-hidden {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n }\n\n .mt-xxs { margin-top: ").concat(STYLES_VARIABLES.spaceXXS, "!important }\n .mt-xs { margin-top: ").concat(STYLES_VARIABLES.spaceXS, "!important }\n .mt-s { margin-top: ").concat(STYLES_VARIABLES.spaceS, "!important }\n .mt-m { margin-top: ").concat(STYLES_VARIABLES.spaceM, "!important }\n .mt-l { margin-top: ").concat(STYLES_VARIABLES.spaceL, "!important }\n .mt-xl { margin-top: ").concat(STYLES_VARIABLES.spaceXL, "!important }\n .mt-xxl { margin-top: ").concat(STYLES_VARIABLES.spaceXXL, "!important }\n .mt-0 { margin-top: 0!important }\n .mr-xxs { margin-right: ").concat(STYLES_VARIABLES.spaceXXS, "!important }\n .mr-xs { margin-right: ").concat(STYLES_VARIABLES.spaceXS, "!important }\n .mr-s { margin-right: ").concat(STYLES_VARIABLES.spaceS, "!important }\n .mr-m { margin-right: ").concat(STYLES_VARIABLES.spaceM, "!important }\n .mr-l { margin-right: ").concat(STYLES_VARIABLES.spaceL, "!important }\n .mr-xl { margin-right: ").concat(STYLES_VARIABLES.spaceXL, "!important }\n .mr-xxl { margin-right: ").concat(STYLES_VARIABLES.spaceXXL, "!important }\n .mr-0 { margin-right: 0!important }\n .mb-xxs { margin-bottom: ").concat(STYLES_VARIABLES.spaceXXS, "!important }\n .mb-xs { margin-bottom: ").concat(STYLES_VARIABLES.spaceXS, "!important }\n .mb-s { margin-bottom: ").concat(STYLES_VARIABLES.spaceS, "!important }\n .mb-m { margin-bottom: ").concat(STYLES_VARIABLES.spaceM, "!important }\n .mb-l { margin-bottom: ").concat(STYLES_VARIABLES.spaceL, "!important }\n .mb-xl { margin-bottom: ").concat(STYLES_VARIABLES.spaceXL, "!important }\n .mb-xxl { margin-bottom: ").concat(STYLES_VARIABLES.spaceXXL, "!important }\n .mb-0 { margin-bottom: 0!important }\n .ml-xxs { margin-left: ").concat(STYLES_VARIABLES.spaceXXS, "!important }\n .ml-xs { margin-left: ").concat(STYLES_VARIABLES.spaceXS, "!important }\n .ml-s { margin-left: ").concat(STYLES_VARIABLES.spaceS, "!important }\n .ml-m { margin-left: ").concat(STYLES_VARIABLES.spaceM, "!important }\n .ml-l { margin-left: ").concat(STYLES_VARIABLES.spaceL, "!important }\n .ml-xl { margin-left: ").concat(STYLES_VARIABLES.spaceXL, "!important }\n .ml-xxl { margin-left: ").concat(STYLES_VARIABLES.spaceXXL, "!important }\n .ml-0 { margin-left: 0!important }\n\n /* Icons */\n .rebilly-instruments-icon {\n width: ").concat(STYLES_VARIABLES.lineHeight, ";\n height: ").concat(STYLES_VARIABLES.lineHeight, ";\n fill: ").concat(STYLES_VARIABLES.text, ";\n }\n\n /* Form */\n .rebilly-instruments-form {\n color: ").concat(STYLES_VARIABLES.text, ";\n background: ").concat(STYLES_VARIABLES.background, ";\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n font-family: ").concat(STYLES_VARIABLES.fontFamily, ";\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n padding: 2px;\n }\n\n .rebilly-instruments-form.is-popup {\n padding: 20px;\n }\n\n .rebilly-instruments-form fieldset {\n border: none;\n margin: 0;\n padding: 0;\n }\n\n .rebilly-instruments-form h2 {\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n margin: 0 0 ").concat(STYLES_VARIABLES.spaceM, ";\n font-weight: 500;\n }\n\n .rebilly-instruments-form-express * + * {\n margin-top: ").concat(STYLES_VARIABLES.spaceS, ";\n }\n\n .rebilly-instruments-form-express.compact * + * {\n margin-top: 0;\n }\n\n .rebilly-instruments-form-express.compact {\n display: flex;\n justify-content: center;\n padding: calc(").concat(STYLES_VARIABLES.spaceXS, " + ").concat(STYLES_VARIABLES.spaceS, ") ").concat(STYLES_VARIABLES.spaceS, " ").concat(STYLES_VARIABLES.spaceS, ";\n border: 1px solid ").concat(textColorMuted[7].hexString(), ";\n border-radius: 4px;\n position: relative;\n flex-wrap: wrap;\n }\n\n @keyframes rebillyExpressShine {\n to {\n background-position-x: -200%;\n }\n }\n\n .rebilly-instruments-form-express.compact > * {\n flex: 1 1;\n margin: ").concat(STYLES_VARIABLES.spaceXS, " ").concat(STYLES_VARIABLES.spaceXS, ";\n max-width: 260px;\n min-height: 44px;\n background: linear-gradient(110deg, ").concat(textColorMuted[8].hexString(), " 0%, ").concat(textColorMuted[9].hexString(), " 25%, ").concat(textColorMuted[8].hexString(), " 50%);\n border-radius: 6px;\n background-size: 200% 100%;\n animation: 1.5s rebillyExpressShine linear infinite;\n }\n\n .rebilly-instruments-form-express:empty {\n display: none;\n }\n\n @media (max-width: 600px) {\n .rebilly-instruments-form-express.compact > * {\n flex: 1 1 auto;\n max-width: 100%;\n }\n }\n\n .rebilly-instruments-form-express.compact .rebilly-instruments-form-express-label {\n position: absolute;\n top: -12px;\n color: ").concat(STYLES_VARIABLES.text, ";\n padding: 0 ").concat(STYLES_VARIABLES.spaceS, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n background: ").concat(STYLES_VARIABLES.background, ";\n display: inline-block;\n font-weight: 500;\n min-height: auto;\n margin: 0;\n }\n\n .rebilly-instruments-methods {\n background-color: ").concat(STYLES_VARIABLES.background, ";\n }\n\n .rebilly-instruments-button {\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n font-family: ").concat(STYLES_VARIABLES.fontFamily, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n padding: ").concat(STYLES_VARIABLES.formElementPadding, ";\n box-sizing: border-box;\n background: ").concat(STYLES_VARIABLES.primary, ";\n color: ").concat(STYLES_VARIABLES.buttonText, ";\n border-radius: ").concat(STYLES_VARIABLES.borderRadius, ";\n margin: calc(").concat(STYLES_VARIABLES.spaceXXS, " + ").concat(STYLES_VARIABLES.spaceS, " / 2) 0;\n font-weight: 500;\n border: none;\n width: 100%;\n cursor: pointer;\n min-height: 44px;\n transition: all 0.2s ease;\n outline: none;\n }\n\n .rebilly-instruments-button.rebilly-instruments-button-secondary {\n background: ").concat(STYLES_VARIABLES.background, ";\n box-shadow: inset 0 0 0 1px ").concat(STYLES_VARIABLES.primary, ";\n color: ").concat(STYLES_VARIABLES.primary, ";\n }\n\n .rebilly-instruments-button:first-of-type {\n margin-top: 0;\n }\n\n .rebilly-instruments-button:last-of-type {\n margin-bottom: 0;\n }\n\n .rebilly-instruments-button:hover,\n .rebilly-instruments-button:active {\n background: ").concat(primaryValues.shade(20).hexString(), ";\n }\n\n .rebilly-instruments-button.rebilly-instruments-button-secondary:hover,\n .rebilly-instruments-button.rebilly-instruments-button-secondary:active {\n background: ").concat(STYLES_VARIABLES.background, ";\n }\n\n .rebilly-instruments-button:focus,\n .rebilly-instruments-button:focus-visible,\n .rebilly-instruments-button:focus-within {\n box-shadow: 0 0 0 2px ").concat(primaryValues.tint(60).hexString(), ";\n }\n\n .rebilly-instruments-button:disabled {\n opacity: 0.6;\n }\n\n .rebilly-instruments-button::first-letter {\n text-transform: uppercase;\n }\n\n .rebilly-instruments-select-field select {\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n padding: ").concat(STYLES_VARIABLES.formElementPadding, ";\n margin: 0;\n border: 1px solid ").concat(textColorMuted[5].hexString(), ";\n border-radius: ").concat(STYLES_VARIABLES.borderRadius, ";\n background: transparent;\n width: 100%;\n cursor: pointer;\n min-height: 44px;\n }\n\n .rebilly-instruments-input-field, \n .rebilly-instruments-select-field {\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n position: relative;\n margin: calc(").concat(STYLES_VARIABLES.spaceXXS, " + ").concat(STYLES_VARIABLES.spaceS, ") 0;\n }\n\n .rebilly-instruments-input-field label,\n .rebilly-instruments-select-field label {\n left: ").concat(STYLES_VARIABLES.formElementHorizontalPadding, ";\n color: ").concat(STYLES_VARIABLES.text, ";\n background: transparent;\n opacity: 0;\n position: absolute;\n top: 22px;\n transform: translateY(-50%);\n transition: all 200ms;\n cursor: text;\n pointer-events: none;\n }\n\n .rebilly-instruments-select-field label {\n opacity: 0.5;\n }\n\n .rebilly-instruments-input-field input {\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n padding: ").concat(STYLES_VARIABLES.formElementPadding, ";\n min-height: ").concat(STYLES_VARIABLES.formElementMinHeight, ";\n background: transparent;\n box-sizing: border-box;\n width: 100%;\n transition: all 200ms;\n border: 1px solid ").concat(textColorMuted[5].hexString(), ";\n border-radius: ").concat(STYLES_VARIABLES.borderRadius, ";\n }\n\n .rebilly-instruments-input-field input::placeholder {\n color: ").concat(STYLES_VARIABLES.text, ";\n opacity: 0.5;\n }\n\n .rebilly-instruments-select-field select {\n -webkit-appearance: none;\n -moz-appearance: none;\n }\n\n .rebilly-instruments-select-field select::-ms-expand {\n display: none;\n }\n\n .rebilly-instruments-input-field input:focus,\n .rebilly-instruments-input-field input:focus-visible,\n .rebilly-instruments-input-field input:focus-within,\n .rebilly-instruments-select-field select:focus,\n .rebilly-instruments-select-field select:focus-visible,\n .rebilly-instruments-select-field select:focus-within {\n outline: none;\n border: 1px solid ").concat(STYLES_VARIABLES.primary, ";\n box-shadow: 0 0 0 1px ").concat(STYLES_VARIABLES.primary, ";\n }\n\n .rebilly-instruments-input-field input:not(:placeholder-shown) + label,\n .rebilly-instruments-select-field select:focus + label,\n .rebilly-instruments-select-field label.active {\n padding: 0 ").concat(STYLES_VARIABLES.spaceXXS, ";\n left: calc(").concat(STYLES_VARIABLES.formElementHorizontalPadding, " - ").concat(STYLES_VARIABLES.spaceXXS, ");\n font-size: ").concat(STYLES_VARIABLES.fontSizeSmall, ";\n line-height: ").concat(STYLES_VARIABLES.fontSizeSmall, ";\n color: ").concat(STYLES_VARIABLES.text, ";\n background: ").concat(STYLES_VARIABLES.background, ";\n font-weight: 500;\n opacity: 1;\n top: 0;\n }\n\n .rebilly-instruments-select-field::before {\n content: '';\n position: absolute;\n width: 8px;\n height: 8px;\n border: solid ").concat(STYLES_VARIABLES.text, ";\n border-width: 0 2px 2px 0;\n transform: rotate(45deg);\n -webkit-transform: rotate(45deg);\n right: 16px;\n top: 16px;\n }\n\n .rebilly-instruments-checkbox-field {\n position: relative;\n padding-left: calc(").concat(STYLES_VARIABLES.spaceM, " + ").concat(STYLES_VARIABLES.spaceS, ");\n align-items: center;\n margin: calc(").concat(STYLES_VARIABLES.spaceM, " - ").concat(STYLES_VARIABLES.spaceXXS, ") 0;\n display: block;\n cursor: pointer;\n }\n\n .rebilly-instruments-checkbox-field > * {\n cursor: pointer;\n }\n\n .rebilly-instruments-checkbox-field input[type=\"checkbox\"] {\n position: absolute;\n opacity: 0;\n cursor: pointer;\n height: 0;\n width: 0;\n }\n\n .rebilly-instruments-checkbox-field .rebilly-instruments-checkbox-check {\n position: absolute;\n top: 0;\n left: 0;\n height: 24px;\n width: 24px;\n border-radius: 4px;\n box-shadow: inset 0 0 0 1px ").concat(textColorMuted[5].hexString(), ";\n background-color: transparent;\n transition: all 200ms;\n }\n\n .rebilly-instruments-checkbox-field .rebilly-instruments-checkbox-check:after {\n content: '';\n position: absolute;\n left: 9px;\n top: 4px;\n opacity: 0;\n width: 5px;\n height: 11px;\n border: solid ").concat(STYLES_VARIABLES.primary, ";\n border-width: 0 2px 2px 0;\n -webkit-transform: rotate(45deg);\n -ms-transform: rotate(45deg);\n transform: rotate(45deg);\n transition: all 200ms;\n }\n\n .rebilly-instruments-checkbox-field input[type=\"checkbox\"]:checked ~ .rebilly-instruments-checkbox-check {\n box-shadow: inset 0 0 0 2px ").concat(STYLES_VARIABLES.primary, ";\n }\n\n .rebilly-instruments-checkbox-field input[type=\"checkbox\"]:checked ~ .rebilly-instruments-checkbox-check:after {\n opacity: 1;\n }\n\n .rebilly-instruments-checkbox-field input[type=\"checkbox\"]:focus ~ .rebilly-instruments-checkbox-check {\n box-shadow: 0 0 0 2px ").concat(primaryValues.tint(80).hexString(), ", inset 0 0 0 1px ").concat(STYLES_VARIABLES.primary, ";\n }\n\n .rebilly-instruments-divider {\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n padding: ").concat(STYLES_VARIABLES.spaceM, " 0;\n margin: 0;\n position: relative;\n outline: 0;\n border: 0;\n text-align: center;\n }\n\n .rebilly-instruments-divider::before {\n background: ").concat(textColorMuted[7].hexString(), ";\n content: '';\n position: absolute;\n left: 0;\n top: 50%;\n width: 100%;\n height: 1px;\n }\n\n .rebilly-instruments-divider .rebilly-instruments-divider-label {\n color: ").concat(textColorMuted[2].hexString(), ";\n font-weight: 500;\n text-transform: uppercase;\n padding: 0 ").concat(STYLES_VARIABLES.spaceS, ";\n line-height: 14px;\n background-color: ").concat(STYLES_VARIABLES.background, ";\n font-size: 12px;\n position: relative;\n display: inline-block;\n }\n\n .rebilly-instruments-select-field-error select,\n .rebilly-instruments-input-field-error input {\n border-color: ").concat(STYLES_VARIABLES.errorText, ";\n color: ").concat(STYLES_VARIABLES.errorText, ";\n }\n\n .rebilly-instruments-validation-error-wrapper,\n .rebilly-instruments-errors {\n margin-top: ").concat(STYLES_VARIABLES.spaceXXS, ";\n margin-bottom: calc(").concat(STYLES_VARIABLES.spaceXXS, " + ").concat(STYLES_VARIABLES.spaceS, ");\n padding: 0;\n list-style: none;\n }\n\n .rebilly-instruments-validation-error-item,\n .rebilly-instruments-errors li {\n color: ").concat(STYLES_VARIABLES.errorText, ";\n padding: 0;\n }\n\n .rebilly-instruments-overlay {\n position: absolute;\n left: 0;\n right: 0;\n top: 0;\n bottom: 0;\n background: rgba(0,0,0,0.5);\n display: flex;\n justify-content: center;\n align-items: center;\n color: #ffffff;\n font-family: \"Helvetica Neue\";\n font-size: 18px;\n z-index: 9001\n }\n\n /* Summary */\n .rebilly-instruments-summary-container {\n color: ").concat(STYLES_VARIABLES.text, ";\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n font-family: ").concat(STYLES_VARIABLES.fontFamily, ";\n background: ").concat(STYLES_VARIABLES.background, ";\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n }\n\n .rebilly-instruments-summary-line-item {\n border-bottom: 1px solid ").concat(textColorMuted[7].hexString(), ";\n padding: ").concat(STYLES_VARIABLES.spaceS, " 0;\n display: flex;\n align-items: center;\n position: relative;\n }\n\n .rebilly-instruments-summary-line-item:first-child {\n padding-top: 0;\n }\n\n .rebilly-instruments-summary-line-item-figure {\n margin: 0 ").concat(STYLES_VARIABLES.spaceS, " 0 0;\n flex: 0 0 auto;\n width: 48px;\n height: 48px;\n border-radius: ").concat(STYLES_VARIABLES.borderRadius, ";\n box-shadow: 0 0 0 1px ").concat(textColorMuted[7].hexString(), ";\n overflow: hidden;\n }\n\n .rebilly-instruments-summary-line-item-figure img {\n width: 100%;\n }\n\n .rebilly-instruments-summary-line-item-synopsis {\n flex: 1 2 auto;\n }\n\n .rebilly-instruments-summary-line-item-synopsis-title {\n margin: 0;\n font-weight: 500;\n }\n\n .rebilly-instruments-summary-line-item-synopsis-description {\n color: ").concat(textColorMuted[2].hexString(), ";\n margin: 0;\n font-size: 14px;\n line-height: 14px;\n }\n\n .rebilly-instruments-summary-line-item-price-breakdown {\n display: flex;\n justify-content: center;\n align-items: center;\n color: ").concat(textColorMuted[2].hexString(), ";\n margin: 0 ").concat(STYLES_VARIABLES.spaceS, ";\n }\n\n .rebilly-instruments-summary-line-item-amount {\n font-weight: 500;\n }\n\n .rebilly-instruments-summary-breakdown table {\n width: 100%;\n margin: ").concat(STYLES_VARIABLES.spaceXS, " 0;\n }\n\n .rebilly-instruments-summary-breakdown table colgroup col:first-child {\n width: 85%;\n }\n\n .rebilly-instruments-summary-breakdown table colgroup col {\n width: 15%;\n }\n\n .rebilly-instruments-summary-breakdown table tr td {\n text-align: right;\n }\n\n .rebilly-instruments-summary-breakdown table tr td:first-child {\n padding-right: ").concat(STYLES_VARIABLES.spaceS, ";\n font-weight: 500;\n }\n\n .rebilly-instruments-summary-breakdown-total {\n padding-top: ").concat(STYLES_VARIABLES.spaceXS, ";\n display: flex;\n border-top: 1px solid ").concat(textColorMuted[7].hexString(), ";\n align-items: center;\n }\n\n .rebilly-instruments-summary-breakdown-total p {\n margin: ").concat(STYLES_VARIABLES.spaceS, " 0;\n }\n\n .rebilly-instruments-summary-breakdown-total-amount {\n flex: 1 2 80%;\n font-size: 24px;\n font-weight: 500;\n text-align: right;\n font-weight: bold;\n }\n\n .rebilly-instruments-summary-breakdown-total-amount-currency {\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n font-weight: normal;\n color: ").concat(textColorMuted[2].hexString(), ";\n margin-right: ").concat(STYLES_VARIABLES.spaceS, ";\n }\n\n /* Confirmation */\n .rebilly-instruments-confirmation {\n color: ").concat(STYLES_VARIABLES.text, ";\n background: ").concat(STYLES_VARIABLES.background, ";\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n font-family: ").concat(STYLES_VARIABLES.fontFamily, ";\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n padding: 2px;\n }\n\n .rebilly-instruments-confirmation a {\n color: ").concat(STYLES_VARIABLES.primary, ";\n cursor: pointer;\n }\n\n .rebilly-instruments-confirmation a:hover {\n text-decoration: none;\n }\n\n .rebilly-instruments-confirmation a svg {\n fill: ").concat(STYLES_VARIABLES.primary, ";\n }\n\n .rebilly-instruments-confirmation-go-back {\n display: inline-flex;\n margin-bottom: ").concat(STYLES_VARIABLES.spaceM, ";\n }\n\n .rebilly-instruments-confirmation h2 {\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n margin: 0 0 ").concat(STYLES_VARIABLES.spaceS, ";\n font-weight: 500;\n }\n\n .rebilly-instruments-confirmation-addresses-title {\n display: flex;\n justify-content: flex-start;\n }\n\n .rebilly-instruments-confirmation-addresses-title a {\n margin-left: ").concat(STYLES_VARIABLES.spaceS, ";\n font-weight: normal;\n }\n\n .rebilly-instruments-confirmation address {\n margin: 0 0 ").concat(STYLES_VARIABLES.spaceM, ";\n color: ").concat(textColorMuted[2].hexString(), ";\n font-style: normal;\n }\n\n .rebilly-instruments-confirmation-address-actions {\n display: flex;\n }\n\n .rebilly-instruments-confirmation-address-actions :first-child {\n margin: 0 ").concat(STYLES_VARIABLES.spaceXS, " 0 0;\n }\n\n .rebilly-instruments-confirmation-address-actions :last-child {\n margin: 0 0 0 ").concat(STYLES_VARIABLES.spaceXS, ";\n }\n\n .rebilly-instruments-confirm-payment-method {\n display: inline-flex;\n align-items: center;\n justify-content: space-between;\n height: 26px;\n margin: 0 0 ").concat(STYLES_VARIABLES.spaceL, ";\n }\n\n .rebilly-instruments-confirm-payment-method figure {\n margin: 0 ").concat(STYLES_VARIABLES.spaceXXS, " 0 0;\n height: 26px;\n padding: 0;\n }\n\n .rebilly-instruments-confirm-payment-method span {\n display: inline-block;\n margin: 0 0 0 ").concat(STYLES_VARIABLES.spaceS, ";\n }\n\n .rebilly-instruments-confirm-payment-method figure img {\n width: 42px;\n border-radius: ").concat(STYLES_VARIABLES.borderRadius, ";\n }\n\n .rebilly-instruments-confirm-payment-method-exp {\n color: ").concat(textColorMuted[2].hexString(), ";\n }\n\n /* Results */\n .rebilly-instruments-results {\n color: ").concat(STYLES_VARIABLES.text, ";\n background: ").concat(STYLES_VARIABLES.background, ";\n font-size: ").concat(STYLES_VARIABLES.fontSize, ";\n line-height: ").concat(STYLES_VARIABLES.lineHeight, ";\n font-family: ").concat(STYLES_VARIABLES.fontFamily, ";\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n text-align: left;\n transition: all 200ms;\n }\n\n .rebilly-instruments-results h1 {\n font-size: calc(").concat(STYLES_VARIABLES.fontSize, " * 1.5);\n line-height: calc(").concat(STYLES_VARIABLES.lineHeight, " * 1.5);\n text-align: center;\n margin: 0;\n font-weight: 500;\n }\n\n .rebilly-instruments-results-icon {\n width: 160px;\n margin: 0 auto ").concat(STYLES_VARIABLES.spaceM, " auto;\n display: block;\n }\n\n .rebilly-instruments-results-icon g {\n stroke: ").concat(STYLES_VARIABLES.primary, ";\n }\n\n .rebilly-instruments-results-icon.is-error g,\n .rebilly-instruments-results-icon.is-error g {\n stroke: ").concat(STYLES_VARIABLES.errorText, ";\n }\n\n .rebilly-instruments-results-icon path {\n stroke-linecap: round;\n stroke-linejoin: round;\n }\n\n .rebilly-instruments-results-icon path.circle {\n stroke-dasharray: 350;\n stroke-dashoffset: 0;\n animation: 0.6s cubic-bezier(1.0, 0.5, 0.8, 1.0) 1 rebillyDashResultIcon;\n }\n\n .rebilly-instruments-results-icon path.mark {\n stroke-dasharray: 350;\n stroke-dashoffset: 0;\n animation: 1s cubic-bezier(1.0, 0.5, 0.8, 1.0) 1 rebillyDashResultIcon;\n }\n\n @keyframes rebillyDashResultIcon {\n from {\n stroke-dashoffset: 350;\n }\n to {\n stroke-dashoffset: 0;\n }\n }\n");
10
- };
11
-
12
- exports.BASE_STYLE = BASE_STYLE;
@@ -1,42 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.flatThemeObject = flatThemeObject;
7
-
8
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
9
-
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
11
-
12
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
13
-
14
- function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
15
-
16
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
17
-
18
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
19
-
20
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
21
-
22
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
23
-
24
- function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
25
-
26
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
27
-
28
- function flatThemeObject(obj) {
29
- return Object.entries(obj).reduce(function (acc, _ref) {
30
- var _ref2 = _slicedToArray(_ref, 2),
31
- key = _ref2[0],
32
- val = _ref2[1];
33
-
34
- var isObject = _typeof(val) === 'object';
35
-
36
- if (isObject) {
37
- return _objectSpread(_objectSpread({}, acc), flatThemeObject(val));
38
- }
39
-
40
- return _objectSpread(_defineProperty({}, key, val), acc);
41
- }, {});
42
- }
@@ -1,15 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.FRAMEPAY_STYLE = void 0;
7
-
8
- var _shadeTintValuesHelper = require("./shade-tint-values-helper");
9
-
10
- var FRAMEPAY_STYLE = function FRAMEPAY_STYLE(STYLES_VARIABLES) {
11
- var textColorMuted = (0, _shadeTintValuesHelper.getMutedColor)(STYLES_VARIABLES.text, STYLES_VARIABLES.background);
12
- return "\n .rebilly-instruments-framepay-wrapper .rebilly-framepay {\n box-shadow: none; \n min-height: ".concat(STYLES_VARIABLES.formElementMinHeight, ";\n border: 1px solid ").concat(textColorMuted[5].hexString(), ";\n margin-bottom: 0;\n }\n\n .rebilly-instruments-framepay-wrapper .rebilly-framepay.rebilly-framepay-digital-wallet {\n min-height: auto;\n border: none;\n margin: 0;\n }\n\n .rebilly-instruments-framepay-wrapper .rebilly-framepay.rebilly-framepay-focus {\n border: 1px solid ").concat(STYLES_VARIABLES.primary, ";\n box-shadow: 0 0 0 1px ").concat(STYLES_VARIABLES.primary, ";\n }\n\n .rebilly-instruments-framepay-wrapper .rebilly-framepay.rebilly-framepay-invalid {\n border: 1px solid ").concat(STYLES_VARIABLES.errorText, ";\n box-shadow: none;\n }\n ");
13
- };
14
-
15
- exports.FRAMEPAY_STYLE = FRAMEPAY_STYLE;
@@ -1,25 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.MAIN_STYLE = void 0;
7
-
8
- var _styleVariables = require("./style-variables");
9
-
10
- var _baseStyles = require("./base-styles");
11
-
12
- var _paymentCard = require("./payment-card");
13
-
14
- var _framepay = require("./framepay");
15
-
16
- var _shadeTintValuesHelper = require("./shade-tint-values-helper");
17
-
18
- var MAIN_STYLE = function MAIN_STYLE(styleOverrides) {
19
- var STYLES = (0, _styleVariables.STYLES_VARIABLES)(styleOverrides);
20
- var primaryValues = (0, _shadeTintValuesHelper.colorValues)(STYLES.primary);
21
- var textColorMuted = (0, _shadeTintValuesHelper.getMutedColor)(STYLES.text, STYLES.background);
22
- return "\n ".concat((0, _baseStyles.BASE_STYLE)(STYLES, primaryValues, textColorMuted), "\n ").concat((0, _paymentCard.PAYMENT_CARD_STYLE)(STYLES), "\n ").concat((0, _framepay.FRAMEPAY_STYLE)(STYLES), "\n ");
23
- };
24
-
25
- exports.MAIN_STYLE = MAIN_STYLE;
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.PAYMENT_CARD_STYLE = void 0;
7
-
8
- var PAYMENT_CARD_STYLE = function PAYMENT_CARD_STYLE(STYLES_VARIABLES) {
9
- return "\n .rebilly-instruments-payment-card-brands {\n display: inline-flex;\n width: 100%;\n justify-content: flex-end;\n margin-top: ".concat(STYLES_VARIABLES.spaceS, " \n }\n\n .rebilly-instruments-payment-card-brands figure {\n margin: 0 0 0 ").concat(STYLES_VARIABLES.spaceXXS, ";\n padding: 0;\n }\n\n .rebilly-instruments-payment-card-brands figure img {\n width: 42px;\n border-radius: ").concat(STYLES_VARIABLES.borderRadius, ";\n }\n");
10
- };
11
-
12
- exports.PAYMENT_CARD_STYLE = PAYMENT_CARD_STYLE;
@@ -1,28 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.getMutedColor = getMutedColor;
7
- 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
- var colorValues = function colorValues(color) {
14
- return new _values["default"](color);
15
- };
16
-
17
- exports.colorValues = colorValues;
18
-
19
- function getMutedColor(color, background) {
20
- var backgroundBrightness = new _values["default"](background).getBrightness();
21
- var values = new _values["default"](color);
22
-
23
- if (backgroundBrightness > 30) {
24
- return values.tints();
25
- }
26
-
27
- return values.shades();
28
- }
@@ -1,43 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.STYLES_VARIABLES = void 0;
7
-
8
- var _lodash = require("lodash");
9
-
10
- var _flatThemeObject = require("./flat-theme-object");
11
-
12
- var STYLES_VARIABLES = function STYLES_VARIABLES() {
13
- var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
14
- var flatOverrides = (0, _flatThemeObject.flatThemeObject)(overrides);
15
- var VARIABLES = {
16
- // Base variables
17
- fontFamily: 'Avenir, Helvetica, Arial, sans-serif',
18
- background: '#ffffff',
19
- primary: '#0044d4',
20
- error: '#ffe4e1',
21
- buttonText: '#ffffff',
22
- errorText: '#cd5c5c',
23
- text: '#0D2B3E',
24
- fontSize: '16px',
25
- fontSizeSmall: '12px',
26
- lineHeight: '24px',
27
- borderRadius: '4px',
28
- formElementPadding: '8px 16px',
29
- formElementVerticalPadding: '8px',
30
- formElementHorizontalPadding: '16px',
31
- formElementMinHeight: '44px',
32
- spaceXXS: '4px',
33
- spaceXS: '6px',
34
- spaceS: '12px',
35
- spaceM: '24px',
36
- spaceL: '48px',
37
- spaceXL: '96px',
38
- spaceXXL: '112px'
39
- };
40
- return (0, _lodash.merge)(VARIABLES, flatOverrides);
41
- };
42
-
43
- exports.STYLES_VARIABLES = STYLES_VARIABLES;
@@ -1,12 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = camelCase;
7
-
8
- function camelCase(str) {
9
- return str.toLowerCase().replace(/[\s|\-|_]\w/g, function (t) {
10
- return t.toUpperCase().trim();
11
- });
12
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = kebabCase;
7
-
8
- function kebabCase(str) {
9
- return str.trim().toLowerCase().replace(/\s/g, '-');
10
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports["default"] = unKebabCase;
7
-
8
- function unKebabCase(particle) {
9
- return (particle || '').split('-').join(' ');
10
- }
@@ -1,77 +0,0 @@
1
- import zoid from 'zoid';
2
- import { MAIN_STYLE } from '../styles/main';
3
- import {dispatch, containerTemplate} from "./form/zoid-helpers"
4
-
5
- export const baseConfirmationHTML = `
6
- <div class="rebilly-instruments-confirmation"></div>
7
- `;
8
-
9
- function confirmPurchase(instrument) {
10
- this.purchase(instrument);
11
- }
12
-
13
- export function MountConfirmation({
14
- instrument,
15
- }) {
16
- this.form.innerHTML += baseConfirmationHTML;
17
- this.loader.startLoading({id: 'confirmation'});
18
- const CONFIRMATION_CONTAINER = document.querySelector('.rebilly-instruments-confirmation');
19
-
20
- this.form.querySelectorAll(`:not(.rebilly-instruments-confirmation)`).forEach(element => {
21
- if (!element.classList.contains('rebilly-instruments-loader')
22
- && !element.classList.contains('rebilly-instruments-loader-spinner')) {
23
- element.remove();
24
- }
25
- });
26
-
27
- const {paymentMethodsUrl} = this.options._computed;
28
- const zoidCreateConfig = {
29
- tag: 'rebilly-instruments-confirmation',
30
- url: `${paymentMethodsUrl}/confirmation`,
31
- defaultContext: 'iframe',
32
- dimensions: {
33
- width: '100%',
34
- height: '100%'
35
- },
36
- };
37
- const zoidMountConfig = {
38
- configs: this.configs,
39
- options: this.options,
40
- MAIN_STYLE: MAIN_STYLE(this.configs?.theme || {}),
41
- instrument,
42
- // eslint-disable-next-line no-shadow
43
- confirmPurchase: (instrument) => {
44
- confirmPurchase.call(this, instrument);
45
- },
46
- onFrameResize: (height) => {
47
- CONFIRMATION_CONTAINER.style.height = height;
48
- },
49
- onLoading: (id) => {
50
- setTimeout(() => {
51
- this.loader.stopLoading({id});
52
- }, 1);
53
- },
54
- back: () => {
55
- CONFIRMATION_CONTAINER.remove();
56
- this._mountForm(this.formOptions);
57
- },
58
- showBackDrop: ({ doc, uid, focus }) => {
59
- const container = containerTemplate.call(this, { doc, uid, focus });
60
- document.body.append(container);
61
- },
62
- dispatch
63
- };
64
-
65
- if(!this.zoidComponents.confirmation) {
66
- this.zoidComponents.confirmation = zoid.create(zoidCreateConfig);
67
- }
68
- this.zoidComponents.confirmation({
69
- RebillyInstruments: zoidMountConfig,
70
- onClose() {
71
- const backDropContainer = document.querySelector('.rebilly-instruments-overlay');
72
- if (backDropContainer) {
73
- backDropContainer.remove();
74
- }
75
- }
76
- }).render('.rebilly-instruments-confirmation');
77
- }
@@ -1,43 +0,0 @@
1
- // Jest Snapshot v1, https://goo.gl/fbAQLP
2
-
3
- exports[`Summary component should inject the proper HTML for express methods 1`] = `
4
- <form
5
- class="rebilly-instruments-form"
6
- >
7
-
8
-
9
- <div
10
- class="rebilly-instruments-form-express compact"
11
- >
12
-
13
-
14
- <span
15
- class="rebilly-instruments-form-express-label"
16
- data-rebilly-i18n="form.expressCheckout"
17
- >
18
- Express checkout
19
- </span>
20
-
21
-
22
- </div>
23
-
24
-
25
- <div
26
- class="rebilly-instruments-divider"
27
- style="display: block;"
28
- >
29
-
30
-
31
- <span
32
- class="rebilly-instruments-divider-label"
33
- data-rebilly-i18n="form.or"
34
- >
35
- Or
36
- </span>
37
-
38
-
39
- </div>
40
-
41
-
42
- </form>
43
- `;
@@ -1,88 +0,0 @@
1
- /* eslint-disable no-undef */
2
- import { getPaymentMethods } from './get-payment-methods';
3
- import { mountExpressPaymentMethods } from './mount-express-payment-methods';
4
- import { processDigitalWalletOptions } from './process-digital-wallet-options';
5
- import { MountMethodSelector } from './method-selector';
6
- import Events from '../../events';
7
-
8
- export const baseFormHTML = (compactExpressInstruments) => `
9
- <form class="rebilly-instruments-form">
10
- <div class="rebilly-instruments-form-express ${compactExpressInstruments ? 'compact' : ''}">
11
- <span data-rebilly-i18n="form.expressCheckout" class="rebilly-instruments-form-express-label">Express checkout</span>
12
- </div>
13
- <div class="rebilly-instruments-divider">
14
- <span class="rebilly-instruments-divider-label" data-rebilly-i18n="form.or">Or</span>
15
- </div>
16
- </form>
17
- `;
18
-
19
-
20
- export function MountForm({readyToPay, summary, plans, products} = {}) {
21
- const {EXPRESS_METHODS, METHODS} = getPaymentMethods.call(this, readyToPay);
22
- const EXPRESS_METHODS_CONTAINER = document.querySelector('.rebilly-instruments-form-express');
23
-
24
- this.form.innerHTML += baseFormHTML(this.options.paymentInstruments.compactExpressInstruments);
25
- const METHODS_DIVIDER = document.querySelector('.rebilly-instruments-divider');
26
-
27
- METHODS_DIVIDER.style.display = METHODS.length && EXPRESS_METHODS.length ? 'block' : 'none';
28
-
29
- const digitalWallet = {
30
- transactionData: {
31
- amount: summary.total,
32
- currency: summary.currency,
33
- countryCode: this.options.intent.countryCode,
34
- label: this.configs.websiteId
35
- },
36
- ...processDigitalWalletOptions(this.options)
37
- }
38
-
39
- this.configs = {
40
- ...this.configs,
41
- digitalWallet
42
- };
43
-
44
- function initializeFramepay() {
45
- if (Rebilly.initialized) {
46
- mountExpressPaymentMethods.call(this, {
47
- EXPRESS_METHODS,
48
- EXPRESS_METHODS_CONTAINER,
49
- });
50
- } else {
51
- Rebilly.initialize({
52
- publishableKey: this.configs.publishableKey,
53
- organizationId: this.configs.organizationId,
54
- digitalWallet,
55
- });
56
-
57
- Rebilly.on('ready', () => {
58
- mountExpressPaymentMethods.call(this, {
59
- EXPRESS_METHODS,
60
- EXPRESS_METHODS_CONTAINER,
61
- })
62
- });
63
-
64
- Rebilly.on('token-ready', (data) => {
65
- Events.instrumentReady.dispatch(data);
66
- });
67
- }
68
- }
69
-
70
- if (METHODS.length) {
71
- this.form.innerHTML += `<div class="rebilly-instruments-methods"></div>`;
72
- const METHODS_CONTAINER = document.querySelector('.rebilly-instruments-methods');
73
- MountMethodSelector.call(this, {
74
- METHODS_CONTAINER,
75
- METHODS,
76
- plans,
77
- products
78
- });
79
- }
80
-
81
- if (window.Rebilly && EXPRESS_METHODS.length) {
82
- initializeFramepay.call(this);
83
- }
84
-
85
- this.translate.translateItems();
86
-
87
- this.loader.stopLoading({id: 'initForm'});
88
- };
@@ -1,109 +0,0 @@
1
- import SummaryModel from '@/storefront/models/summary-model';
2
- import ReadyToPayModel from '@/storefront/models/ready-to-pay-model';
3
- import { Loader } from '../../loader';
4
- import { Translate } from '../../i18n';
5
- import { MountForm } from './form';
6
-
7
- describe('Summary component', () => {
8
- let formElement;
9
- beforeEach(() => {
10
- formElement = document.createElement('div');
11
- document.body.append(formElement);
12
- })
13
-
14
- class TestMountFormInstance {
15
- constructor({
16
- configs = {},
17
- options = {},
18
- form = formElement,
19
- loader = new Loader(),
20
- translate = new Translate(),
21
- zoidComponents = {},
22
- } = {}) {
23
- this.configs = configs;
24
- this.options = options;
25
- this.form = form;
26
- this.loader = loader;
27
- this.translate = translate;
28
- this.zoidComponents = zoidComponents;
29
- }
30
-
31
- mountForm(readyToPayAndSummary, ...args) {
32
- this.loader.DOM.form = this.form;
33
- return MountForm.apply(this, args.concat(readyToPayAndSummary));
34
- }
35
- }
36
-
37
- const options = {
38
- intent: {
39
- countryCode: 'US',
40
- items: [
41
- {
42
- planId: 'my-awesome-product',
43
- quantity: 1,
44
- thumbnail: '',
45
- },
46
- {
47
- planId: 'awesome-t-shirt',
48
- quantity: 2,
49
- thumbnail: '',
50
- }
51
- ]
52
- },
53
- paymentInstruments: {
54
- compactExpressInstruments: true
55
- },
56
- };
57
-
58
- const summaryData = new SummaryModel({
59
- currency: "USD",
60
- lineItems: [{
61
- type: "debit",
62
- description: "My Awesome Product",
63
- unitPrice: 30,
64
- quantity: 1,
65
- price: 30,
66
- productId: "my-awesome-product",
67
- planId: "my-awesome-product"
68
- }, {
69
- type: "debit",
70
- description: "Awesome T-Shirt",
71
- unitPrice: 20,
72
- quantity: 2,
73
- price: 40,
74
- productId: "my-app",
75
- planId: "awesome-t-shirt"
76
- }],
77
- subtotalAmount: 70,
78
- taxAmount: 0,
79
- shippingAmount: 0,
80
- discountsAmount: 0,
81
- total: 70
82
- });
83
-
84
- const readyToPayData = [
85
- new ReadyToPayModel(),
86
- new ReadyToPayModel(
87
- {
88
- method: 'payment-card',
89
- feature: {
90
- name: 'Google Pay'
91
- },
92
- brands: ['Visa'],
93
- filters: []
94
- }
95
- )
96
- ];
97
-
98
- const configs = {
99
- websiteId: 'test-website-id'
100
- };
101
-
102
- it('should inject the proper HTML for express methods', () => {
103
- const mountSummaryInstance = new TestMountFormInstance({configs, options});
104
- mountSummaryInstance.mountForm({summary: summaryData, readyToPay: readyToPayData});
105
-
106
- const form = document.querySelector('.rebilly-instruments-form');
107
- expect(form).toMatchSnapshot();
108
- });
109
- })
@@ -1,32 +0,0 @@
1
- /* eslint-disable no-unused-expressions, arrow-body-style */
2
- const SUPPORTED_EXPRESS_METHODS = [
3
- 'Google Pay',
4
- 'Apple Pay',
5
- 'paypal'
6
- ];
7
-
8
- const isExpressMethod = ({method, feature}) => {
9
- return SUPPORTED_EXPRESS_METHODS.includes(method)
10
- || SUPPORTED_EXPRESS_METHODS.includes(feature?.name);
11
- }
12
-
13
- export function getPaymentMethods (methods) {
14
- const result = {
15
- EXPRESS_METHODS: [],
16
- METHODS: [],
17
- };
18
-
19
- methods.forEach(method => {
20
- if (isExpressMethod(method)) {
21
- // Add loader entry per express method
22
- this.loader.startLoading({id: `${method.method}-express`});
23
- result.EXPRESS_METHODS.push(method)
24
- } else {
25
- // Add loader entry per method
26
- this.loader.startLoading({id: method.method});
27
- result.METHODS.push(method);
28
- }
29
- })
30
-
31
- return result;
32
- }