@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
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base = void 0;
7
+
8
+ const base = theme => `
9
+ /* Base, Typography
10
+ ------------------------------------------------------------ */
11
+ /* Base setup for top level elements */
12
+ .rebilly-instruments-content,
13
+ .rebilly-instruments-method-content,
14
+ .rebilly-instruments-confirmation,
15
+ .rebilly-instruments-results {
16
+ color: ${theme.color.text};
17
+ background: ${theme.color.background};
18
+ font-size: ${theme.typography.fontSize};
19
+ line-height: ${theme.typography.lineHeight};
20
+ font-family: ${theme.typography.fontFamily};
21
+ -webkit-font-smoothing: antialiased;
22
+ -moz-osx-font-smoothing: grayscale;
23
+ text-align: left;
24
+ transition: all 200ms;
25
+ }
26
+
27
+ .rebilly-instruments-link {
28
+ color: ${theme.color.primary};
29
+ cursor: pointer;
30
+ }
31
+
32
+ .rebilly-instruments-link:hover {
33
+ text-decoration: none;
34
+ }
35
+
36
+ .rebilly-instruments-link .rebilly-instruments-icon {
37
+ fill: ${theme.color.primary};
38
+ }
39
+
40
+ .rebilly-instruments-link.has-icon-left,
41
+ .rebilly-instruments-link.has-icon-right {
42
+ display: inline-flex;
43
+ }
44
+
45
+ .rebilly-instruments-link.has-icon-left .rebilly-instruments-icon {
46
+ margin-right: ${theme.space.xs};
47
+ }
48
+
49
+ .rebilly-instruments-link.has-icon-right .rebilly-instruments-icon {
50
+ margin-left: ${theme.space.xs};
51
+ }
52
+
53
+ /* Typography */
54
+ .rebilly-instruments-h1,
55
+ .rebilly-instruments-h2 {
56
+ font-weight: 500;
57
+ }
58
+
59
+ .rebilly-instruments-h1 {
60
+ font-size: calc(${theme.typography.fontSize} * 1.5);
61
+ line-height: calc(${theme.typography.lineHeight} * 1.5);
62
+ margin: 0 0 calc(${theme.space.m} * 1.5) 0;
63
+ }
64
+
65
+ .rebilly-instruments-h2 {
66
+ font-size: calc(${theme.typography.fontSize} * 1.12);
67
+ line-height: ${theme.typography.lineHeight};
68
+ margin: 0 0 ${theme.space.m} 0;
69
+ }
70
+ `;
71
+
72
+ exports.base = base;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.Theme = void 0;
7
+
8
+ var _lodash = _interopRequireDefault(require("lodash.merge"));
9
+
10
+ var _colorValues = require("../utils/color-values");
11
+
12
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
+
14
+ class Theme {
15
+ constructor(overrides = {}) {
16
+ this.overrides = overrides;
17
+ this.theme = {
18
+ color: {
19
+ primary: '#0044d4',
20
+ errorText: '#cd5c5c',
21
+ text: '#0D2B3E',
22
+ buttonText: '#ffffff',
23
+ background: '#ffffff'
24
+ },
25
+ typography: {
26
+ fontFamily: 'Avenir, Helvetica, Arial, sans-serif',
27
+ fontSize: '16px',
28
+ lineHeight: '24px',
29
+ captionFontSize: '12px',
30
+ captionLineHeight: '12px'
31
+ },
32
+ space: {
33
+ xxs: '4px',
34
+ xs: '6px',
35
+ s: '12px',
36
+ m: '24px',
37
+ l: '48px',
38
+ xl: '96px',
39
+ xxl: '112px',
40
+ form: {
41
+ padding: '8px 16px',
42
+ verticalPadding: '8px',
43
+ horizontalPadding: '16px',
44
+ minHeight: '44px'
45
+ }
46
+ },
47
+ borderRadius: '4px'
48
+ };
49
+ }
50
+
51
+ get getComputed() {
52
+ return this.computed();
53
+ }
54
+
55
+ computed() {
56
+ return {
57
+ color: {
58
+ primaryValues: (0, _colorValues.colorValues)(this.theme.color.primary),
59
+ mutedText: (0, _colorValues.alphaColor)(this.theme.color.text, 0.6),
60
+ mutedBorder: (0, _colorValues.alphaColor)(this.theme.color.text, 0.25)
61
+ }
62
+ };
63
+ }
64
+
65
+ build() {
66
+ return { ...(0, _lodash.default)(this.theme, this.overrides),
67
+ getComputed: this.getComputed
68
+ };
69
+ }
70
+
71
+ }
72
+
73
+ exports.Theme = Theme;
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ var _theme = require("./theme");
4
+
5
+ var _values = _interopRequireDefault(require("values.js"));
6
+
7
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
8
+
9
+ describe('RebillyInstruments theme', () => {
10
+ it('builds the theme object', () => {
11
+ const theme = new _theme.Theme().build();
12
+ expect(theme).toMatchSnapshot();
13
+ });
14
+ it('properly overrides the default properties', () => {
15
+ const overrides = {
16
+ color: {
17
+ primary: 'purple',
18
+ text: 'gray'
19
+ }
20
+ };
21
+ const theme = new _theme.Theme(overrides).build();
22
+ expect(theme.color.primary).toEqual('purple');
23
+ expect(theme.color.text).toEqual('gray');
24
+ });
25
+ it('computes new styles from theme properties', () => {
26
+ const theme = new _theme.Theme().build();
27
+ expect(theme.getComputed.color.primaryValues instanceof _values.default).toEqual(true);
28
+ expect(theme.getComputed.color.mutedText).toEqual('rgba(13, 43, 62, 0.6)');
29
+ });
30
+ });
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.browserslist = void 0;
7
+ const browserslist = ['> 1%', 'last 2 versions'];
8
+ exports.browserslist = browserslist;
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.address = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the address component.
10
+ // -----------------------------------------------------------------------------
11
+ const address = theme => `
12
+ /**
13
+ * Address
14
+ */
15
+ .rebilly-instruments-address {
16
+ margin: 0 0 ${theme.space.m};
17
+ color: ${theme.getComputed.color.mutedText};
18
+ font-style: normal;
19
+ }
20
+
21
+ /**
22
+ * Address Name: Default
23
+ */
24
+ .rebilly-instruments-address-name-default {
25
+ /* No style changes */
26
+ }
27
+
28
+ /**
29
+ * Address Name: Combined
30
+ */
31
+ .rebilly-instruments-address-name-combined {
32
+ /* No style changes */
33
+ }
34
+
35
+ /**
36
+ * Address Name: Stacked
37
+ */
38
+ .rebilly-instruments-address-name-stacked {
39
+ /* No style changes */
40
+ }
41
+
42
+ /**
43
+ * Address Region: Default
44
+ */
45
+ .rebilly-instruments-address-region-default {
46
+ /* No style changes */
47
+ }
48
+
49
+ /**
50
+ * Address Region: Split
51
+ */
52
+ .rebilly-instruments-address-region-split {
53
+ /* No style changes */
54
+ }
55
+
56
+ /**
57
+ * Address Name: Stacked
58
+ */
59
+ .rebilly-instruments-address-region-stacked {
60
+ /* No style changes */
61
+ }
62
+ `;
63
+
64
+ exports.address = address;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.button = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the button component.
10
+ // -----------------------------------------------------------------------------
11
+ const button = theme => `
12
+ /**
13
+ * Buttons
14
+ */
15
+ .rebilly-instruments-button {
16
+ font-size: ${theme.typography.fontSize};
17
+ font-family: ${theme.typography.fontFamily};
18
+ line-height: ${theme.typography.lineHeight};
19
+ padding: ${theme.space.form.padding};
20
+ box-sizing: border-box;
21
+ background: ${theme.color.primary};
22
+ color: ${theme.color.buttonText};
23
+ border-radius: ${theme.borderRadius};
24
+ margin: calc(${theme.space.xxs} + ${theme.space.s} / 2) 0;
25
+ font-weight: 500;
26
+ border: none;
27
+ width: 100%;
28
+ cursor: pointer;
29
+ min-height: 44px;
30
+ transition: all 0.2s ease;
31
+ outline: none;
32
+ }
33
+
34
+ .rebilly-instruments-button:hover,
35
+ .rebilly-instruments-button:active {
36
+ background: ${theme.getComputed.color.primaryValues.shade(20).hexString()};
37
+ }
38
+
39
+ .rebilly-instruments-button.rebilly-instruments-button-secondary {
40
+ background: ${theme.color.background};
41
+ box-shadow: inset 0 0 0 1px ${theme.color.primary};
42
+ color: ${theme.color.primary};
43
+ }
44
+
45
+ .rebilly-instruments-button.rebilly-instruments-button-secondary:hover,
46
+ .rebilly-instruments-button.rebilly-instruments-button-secondary:active {
47
+ background: ${theme.color.background};
48
+ }
49
+
50
+ .rebilly-instruments-button:focus { box-shadow: 0 0 0 2px ${theme.getComputed.color.primaryValues.tint(60).hexString()}; }
51
+
52
+ .rebilly-instruments-button:disabled { opacity: 0.6; }
53
+
54
+ .rebilly-instruments-button::first-letter { text-transform: uppercase; }
55
+
56
+ .rebilly-instruments-button:first-of-type { margin-top: 0; }
57
+
58
+ .rebilly-instruments-button:last-of-type { margin-bottom: 0; }
59
+ `;
60
+
61
+ exports.button = button;
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.divider = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the divider component.
10
+ // -----------------------------------------------------------------------------
11
+ const divider = theme => `
12
+ /**
13
+ * Divider
14
+ */
15
+ .rebilly-instruments-divider {
16
+ line-height: ${theme.typography.lineHeight};
17
+ padding: ${theme.space.m} 0;
18
+ margin: 0;
19
+ position: relative;
20
+ outline: 0;
21
+ border: 0;
22
+ text-align: center;
23
+ }
24
+
25
+ .rebilly-instruments-divider::before {
26
+ background: ${theme.getComputed.color.mutedBorder};
27
+ content: '';
28
+ position: absolute;
29
+ left: 0;
30
+ top: 50%;
31
+ width: 100%;
32
+ height: 1px;
33
+ }
34
+
35
+ .rebilly-instruments-divider .rebilly-instruments-divider-label {
36
+ color: ${theme.getComputed.color.mutedText};
37
+ font-weight: 500;
38
+ text-transform: uppercase;
39
+ padding: 0 ${theme.space.s};
40
+ line-height: 14px;
41
+ background-color: ${theme.color.background};
42
+ font-size: 12px;
43
+ position: relative;
44
+ display: inline-block;
45
+ }
46
+ `;
47
+
48
+ exports.divider = divider;
@@ -0,0 +1,83 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.checkbox = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the checkbox component.
10
+ // -----------------------------------------------------------------------------
11
+ const checkbox = theme => `
12
+ /**
13
+ * Checkbox
14
+ */
15
+ .rebilly-instruments-form-field-checkbox {
16
+ position: relative;
17
+ opacity: 1;
18
+ padding-left: calc(${theme.space.m} + ${theme.space.s});
19
+ align-items: center;
20
+ display: inline-block;
21
+ cursor: pointer;
22
+ transform: none;
23
+ }
24
+
25
+ .rebilly-instruments-form-field-checkbox > * {
26
+ cursor: pointer;
27
+ }
28
+
29
+ .rebilly-instruments-form-field-checkbox input[type="checkbox"] {
30
+ position: absolute;
31
+ opacity: 0;
32
+ cursor: pointer;
33
+ height: 0;
34
+ width: 0;
35
+ }
36
+
37
+ .rebilly-instruments-form-field-checkbox span {
38
+ position: absolute;
39
+ top: 0;
40
+ left: 0;
41
+ height: 24px;
42
+ width: 24px;
43
+ border-radius: ${theme.borderRadius};
44
+ box-shadow: inset 0 0 0 1px ${theme.getComputed.color.mutedBorder};
45
+ background-color: transparent;
46
+ transition: all 200ms;
47
+ }
48
+
49
+ .rebilly-instruments-form-field-checkbox span:after {
50
+ content: '';
51
+ position: absolute;
52
+ left: 9px;
53
+ top: 4px;
54
+ opacity: 0;
55
+ width: 5px;
56
+ height: 11px;
57
+ border: solid ${theme.color.primary};
58
+ border-width: 0 2px 2px 0;
59
+ -webkit-transform: rotate(45deg);
60
+ -ms-transform: rotate(45deg);
61
+ transform: rotate(45deg);
62
+ transition: all 200ms;
63
+ }
64
+
65
+ .rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span {
66
+ box-shadow: inset 0 0 0 2px ${theme.color.primary};
67
+ }
68
+
69
+ .rebilly-instruments-form-field-checkbox input[type="checkbox"]:checked ~ span:after {
70
+ opacity: 1;
71
+ }
72
+
73
+ .rebilly-instruments-form-field-checkbox input[type="checkbox"]:focus ~ span {
74
+ box-shadow: 0 0 0 2px ${theme.getComputed.color.primaryValues.tint(80).hexString()},
75
+ inset 0 0 0 1px ${theme.color.primary};
76
+ }
77
+
78
+ .rebilly-instruments-form-field-checkbox input[type="checkbox"]:disabled ~ span {
79
+ opacity: 0.6;
80
+ }
81
+ `;
82
+
83
+ exports.checkbox = checkbox;
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.field = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the field component.
10
+ // -----------------------------------------------------------------------------
11
+ const field = theme => `
12
+ /**
13
+ * Field
14
+ */
15
+ .rebilly-instruments-form-field {
16
+ margin: calc(${theme.space.xxs} + ${theme.space.s}) 0;
17
+ position: relative;
18
+ }
19
+
20
+ /* Field group */
21
+ .rebilly-instruments-form-field-group {
22
+ margin: calc(-${theme.space.xxs} - ${theme.space.s}) 0;
23
+ display: flex;
24
+ }
25
+
26
+ .rebilly-instruments-form-field-group > * {
27
+ flex: 1 0;
28
+ margin-left: ${theme.space.xs};
29
+ margin-right: ${theme.space.xs}
30
+ }
31
+
32
+ .rebilly-instruments-form-field-group > *:first-child {
33
+ margin-left: 0;
34
+ }
35
+
36
+ .rebilly-instruments-form-field-group > *:last-child {
37
+ margin-right: 0;
38
+ }
39
+
40
+ @media (max-width: 480px) {
41
+ .rebilly-instruments-form-field-group {
42
+ display: block;
43
+ margin: calc(${theme.space.xxs} + ${theme.space.s}) 0;
44
+ }
45
+
46
+ .rebilly-instruments-form-field-group > * {
47
+ margin-left: 0;
48
+ margin-right: 0;
49
+ }
50
+ }
51
+ `;
52
+
53
+ exports.field = field;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.form = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the form component.
10
+ // -----------------------------------------------------------------------------
11
+ const form = theme => `
12
+ /**
13
+ * Form
14
+ */
15
+ /* Chrome autocomplete styles */
16
+ .rebilly-instruments-form input:-webkit-autofill,
17
+ .rebilly-instruments-form input:-webkit-autofill:hover,
18
+ .rebilly-instruments-form input:-webkit-autofill:focus,
19
+ .rebilly-instruments-form select:-webkit-autofill,
20
+ .rebilly-instruments-form select:-webkit-autofill:hover,
21
+ .rebilly-instruments-form select:-webkit-autofill:focus {
22
+ -webkit-text-fill-color: ${theme.color.text};
23
+ -webkit-box-shadow: 0 0 0px 1000px transparent inset;
24
+ transition: background-color 5000s ease-in-out 0s;
25
+ }
26
+ `;
27
+
28
+ exports.form = form;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.input = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the input component.
10
+ // -----------------------------------------------------------------------------
11
+ const input = theme => `
12
+ /**
13
+ * Input
14
+ */
15
+ .rebilly-instruments-form-field-input {
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;
24
+ box-sizing: border-box;
25
+ width: 100%;
26
+ transition: all 200ms;
27
+ }
28
+
29
+ .rebilly-instruments-form-field-input:focus {
30
+ outline: none;
31
+ border: 1px solid ${theme.color.primary};
32
+ box-shadow: 0 0 0 1px ${theme.color.primary};
33
+ }
34
+
35
+ .rebilly-instruments-form-field-input::placeholder {
36
+ color: ${theme.color.text};
37
+ opacity: 0.5;
38
+ }
39
+
40
+ .rebilly-instruments-form-field-input:disabled {
41
+ opacity: 0.6;
42
+ }
43
+ `;
44
+
45
+ exports.input = input;
@@ -0,0 +1,43 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.label = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the label component.
10
+ // -----------------------------------------------------------------------------
11
+ const label = theme => `
12
+ /**
13
+ * Label
14
+ */
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);
19
+ background: transparent;
20
+ opacity: 0;
21
+ position: absolute;
22
+ transform: translateY(-50%);
23
+ transition: all 200ms;
24
+ cursor: text;
25
+ pointer-events: none;
26
+ }
27
+
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;
38
+ opacity: 1;
39
+ top: 0;
40
+ }
41
+ `;
42
+
43
+ exports.label = label;
@@ -0,0 +1,63 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.select = void 0;
7
+
8
+ // -----------------------------------------------------------------------------
9
+ // This file contains all styles related to the select component.
10
+ // -----------------------------------------------------------------------------
11
+ const select = theme => `
12
+ /**
13
+ * Select
14
+ */
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;
24
+ box-sizing: border-box;
25
+ width: 100%;
26
+ transition: all 200ms;
27
+ }
28
+
29
+ .rebilly-instruments-form-field-select:focus {
30
+ outline: none;
31
+ border: 1px solid ${theme.color.primary};
32
+ box-shadow: 0 0 0 1px ${theme.color.primary};
33
+ }
34
+
35
+ .rebilly-instruments-form-field-select:disabled {
36
+ opacity: 0.6;
37
+ }
38
+
39
+ .rebilly-instruments-form-field-select {
40
+ -webkit-appearance: none;
41
+ -moz-appearance: none;
42
+ }
43
+
44
+ .rebilly-instruments-form-field-select + .rebilly-instruments-form-field-label {
45
+ font-size: ${theme.typography.fontSize};
46
+ opacity: 0.5;
47
+ }
48
+
49
+ .rebilly-instruments-form-field-select::-ms-expand { display: none; }
50
+
51
+ .rebilly-instruments-form-field-select-arrow {
52
+ border: solid ${theme.color.text};
53
+ position: absolute;
54
+ width: 8px;
55
+ height: 8px;
56
+ border-width: 0 2px 2px 0;
57
+ transform: rotate(45deg);
58
+ right: 16px;
59
+ top: 16px;
60
+ }
61
+ `;
62
+
63
+ exports.select = select;