@justifi/webcomponents 0.2.0 → 0.2.1

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 (50) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/dist/cjs/{index-3947d225.js → index-ca2cd154.js} +391 -96
  3. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +1 -1
  4. package/dist/cjs/justifi-billing-form.cjs.entry.js +1 -1
  5. package/dist/cjs/justifi-card-form.cjs.entry.js +1 -1
  6. package/dist/cjs/justifi-payment-form.cjs.entry.js +17 -0
  7. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +84 -2
  8. package/dist/cjs/justifi-payments-list.cjs.entry.js +1 -1
  9. package/dist/cjs/loader.cjs.js +3 -4
  10. package/dist/cjs/select-input_2.cjs.entry.js +1 -1
  11. package/dist/cjs/webcomponents.cjs.js +3 -7
  12. package/dist/collection/collection-manifest.json +3 -2
  13. package/dist/collection/components/card-form/card-form.stories.js +132 -0
  14. package/dist/collection/components/payment-form/payment-form.js +31 -0
  15. package/dist/collection/components/payment-method-form/payment-method-form.js +3 -1
  16. package/dist/components/index.d.ts +1 -9
  17. package/dist/components/index.js +2 -1
  18. package/dist/components/justifi-payment-form.d.ts +11 -0
  19. package/dist/components/justifi-payment-form.js +32 -0
  20. package/dist/components/payment-method-form.js +83 -1
  21. package/dist/esm/{index-0bcf33c4.js → index-05706eb5.js} +392 -96
  22. package/dist/esm/justifi-bank-account-form.entry.js +1 -1
  23. package/dist/esm/justifi-billing-form.entry.js +1 -1
  24. package/dist/esm/justifi-card-form.entry.js +1 -1
  25. package/dist/esm/justifi-payment-form.entry.js +13 -0
  26. package/dist/esm/justifi-payment-method-form.entry.js +84 -2
  27. package/dist/esm/justifi-payments-list.entry.js +1 -1
  28. package/dist/esm/loader.js +3 -4
  29. package/dist/esm/polyfills/css-shim.js +1 -1
  30. package/dist/esm/select-input_2.entry.js +1 -1
  31. package/dist/esm/webcomponents.js +3 -4
  32. package/dist/types/api/Api.d.ts +1 -1
  33. package/dist/types/api/Payment.d.ts +1 -1
  34. package/dist/types/components/card-form/card-form.stories.d.ts +14 -0
  35. package/dist/types/components/payment-form/payment-form.d.ts +4 -0
  36. package/dist/types/components.d.ts +15 -0
  37. package/dist/types/stencil-public-runtime.d.ts +3 -59
  38. package/dist/webcomponents/{p-0cddfd4f.entry.js → p-3809130a.entry.js} +1 -1
  39. package/dist/webcomponents/{p-17badb93.entry.js → p-67be9585.entry.js} +1 -1
  40. package/dist/webcomponents/{p-d3dc4e0a.entry.js → p-787671b9.entry.js} +1 -1
  41. package/dist/webcomponents/{p-864e32fd.entry.js → p-87654bf4.entry.js} +1 -1
  42. package/dist/webcomponents/p-8ee06fd1.js +2 -0
  43. package/dist/webcomponents/p-94ef2d0e.entry.js +1 -0
  44. package/dist/webcomponents/p-c07191dc.entry.js +1 -0
  45. package/dist/webcomponents/{p-7fd07095.entry.js → p-e5b0f047.entry.js} +1 -1
  46. package/dist/webcomponents/webcomponents.esm.js +1 -1
  47. package/loader/index.d.ts +0 -9
  48. package/package.json +16 -3
  49. package/dist/webcomponents/p-cecf0fe8.entry.js +0 -1
  50. package/dist/webcomponents/p-e82c9746.js +0 -2
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3947d225.js');
5
+ const index = require('./index-ca2cd154.js');
6
6
 
7
7
  const BankAccountForm = class {
8
8
  constructor(hostRef) {
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3947d225.js');
5
+ const index = require('./index-ca2cd154.js');
6
6
 
7
7
  /**
8
8
  * Based on Kendo UI Core expression code <https://github.com/telerik/kendo-ui-core#license-information>
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3947d225.js');
5
+ const index = require('./index-ca2cd154.js');
6
6
 
7
7
  const CardForm = class {
8
8
  constructor(hostRef) {
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ const index = require('./index-ca2cd154.js');
6
+
7
+ const PaymentForm = class {
8
+ constructor(hostRef) {
9
+ index.registerInstance(this, hostRef);
10
+ this.validationStrategy = undefined;
11
+ }
12
+ render() {
13
+ return (index.h(index.Host, null, index.h("form", null, index.h("slot", null))));
14
+ }
15
+ };
16
+
17
+ exports.justifi_payment_form = PaymentForm;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3947d225.js');
5
+ const index = require('./index-ca2cd154.js');
6
6
 
7
7
  const MessageEventType = {
8
8
  card: {
@@ -21,6 +21,87 @@ const MessageEventType = {
21
21
  }
22
22
  };
23
23
 
24
+ const name = "@justifi/webcomponents";
25
+ const version = "0.2.1";
26
+ const description = "JustiFi Web Components";
27
+ const main = "dist/index.cjs.js";
28
+ const module$1 = "dist/index.js";
29
+ const es2015 = "dist/esm/index.mjs";
30
+ const es2017 = "dist/esm/index.mjs";
31
+ const types = "dist/types/index.d.ts";
32
+ const collection = "dist/collection/collection-manifest.json";
33
+ const unpkg = "dist/stencil-webcomponents/stencil-webcomponents.esm.js";
34
+ const repository = {
35
+ type: "git",
36
+ url: "git+https://github.com/justifi-tech/web-component-library.git"
37
+ };
38
+ const publishConfig = {
39
+ registry: "https://registry.npmjs.org"
40
+ };
41
+ const files = [
42
+ "dist/",
43
+ "loader/"
44
+ ];
45
+ const scripts = {
46
+ "auto-changelog": "auto-changelog",
47
+ release: "release-it --no-npm",
48
+ build: "stencil build --docs",
49
+ start: "concurrently -c \"bgBlue.bold,bgMagenta.bold,bgGreen.bold\" \"yarn run start-stencil\" \"yarn run storybook\"",
50
+ "start-stencil": "stencil build --watch --serve --no-open",
51
+ test: "stencil test --spec --e2e",
52
+ "test:watch": "stencil test --spec --e2e --watchAll",
53
+ generate: "stencil generate",
54
+ storybook: "start-storybook -p 6006",
55
+ "build-storybook": "build-storybook"
56
+ };
57
+ const dependencies = {
58
+ "@stencil/core": "^2.13.0",
59
+ "@stencil/react-output-target": "^0.3.1",
60
+ "date-fns": "^2.29.3",
61
+ "dinero.js": "^1.9.1",
62
+ uuid: "^9.0.0",
63
+ yup: "^1.0.0"
64
+ };
65
+ const devDependencies = {
66
+ "@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
67
+ "@storybook/addon-actions": "^6.5.16",
68
+ "@storybook/addon-essentials": "^6.5.16",
69
+ "@storybook/addon-interactions": "^6.5.16",
70
+ "@storybook/addon-links": "^6.5.16",
71
+ "@storybook/builder-webpack4": "^6.5.16",
72
+ "@storybook/html": "^6.5.16",
73
+ "@storybook/manager-webpack4": "^6.5.16",
74
+ "@storybook/testing-library": "^0.0.13",
75
+ "@types/jest": "^27.0.3",
76
+ "auto-changelog": "^2.4.0",
77
+ concurrently: "^7.6.0",
78
+ jest: "^27.4.5",
79
+ "jest-cli": "^27.4.5",
80
+ puppeteer: "^10.0.0",
81
+ "release-it": "^15.6.0"
82
+ };
83
+ const license = "MIT";
84
+ const packageJson = {
85
+ name: name,
86
+ version: version,
87
+ description: description,
88
+ main: main,
89
+ module: module$1,
90
+ es2015: es2015,
91
+ es2017: es2017,
92
+ types: types,
93
+ collection: collection,
94
+ "collection:main": "dist/collection/index.js",
95
+ unpkg: unpkg,
96
+ repository: repository,
97
+ publishConfig: publishConfig,
98
+ files: files,
99
+ scripts: scripts,
100
+ dependencies: dependencies,
101
+ devDependencies: devDependencies,
102
+ license: license
103
+ };
104
+
24
105
  const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";
25
106
 
26
107
  const PaymentMethodForm = class {
@@ -80,8 +161,9 @@ const PaymentMethodForm = class {
80
161
  const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
81
162
  const payload = {
82
163
  clientId: clientId,
164
+ componentVersion: packageJson.version,
83
165
  paymentMethodMetadata: paymentMethodMetadata,
84
- account: account
166
+ account: account,
85
167
  };
86
168
  return this.postMessageWithResponseListener(eventType, payload);
87
169
  }
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3947d225.js');
5
+ const index = require('./index-ca2cd154.js');
6
6
 
7
7
  // Unique ID creation requires a high quality random # generator. In the browser we therefore
8
8
  // require the crypto API and do not support built-in fallback to lower quality random number
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3947d225.js');
5
+ const index = require('./index-ca2cd154.js');
6
6
 
7
7
  /*
8
- Stencil Client Patch Esm v2.22.3 | MIT Licensed | https://stenciljs.com
8
+ Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
9
9
  */
10
10
  const patchEsm = () => {
11
11
  return index.promiseResolve();
@@ -14,9 +14,8 @@ const patchEsm = () => {
14
14
  const defineCustomElements = (win, options) => {
15
15
  if (typeof window === 'undefined') return Promise.resolve();
16
16
  return patchEsm().then(() => {
17
- return index.bootstrapLazy([["justifi-billing-form.cjs",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-payment-method-form.cjs",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]],["justifi-bank-account-form.cjs",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form.cjs",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payments-list.cjs",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2.cjs",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]]], options);
17
+ return index.bootstrapLazy([["justifi-billing-form.cjs",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-bank-account-form.cjs",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form.cjs",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payment-form.cjs",[[4,"justifi-payment-form",{"validationStrategy":[1,"validation-strategy"]}]]],["justifi-payments-list.cjs",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2.cjs",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]],["justifi-payment-method-form.cjs",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
18
18
  });
19
19
  };
20
20
 
21
- exports.setNonce = index.setNonce;
22
21
  exports.defineCustomElements = defineCustomElements;
@@ -2,7 +2,7 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- const index = require('./index-3947d225.js');
5
+ const index = require('./index-ca2cd154.js');
6
6
 
7
7
  const selectInputCss = ":host{display:block}label{display:block}";
8
8
 
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- const index = require('./index-3947d225.js');
3
+ const index = require('./index-ca2cd154.js');
6
4
 
7
5
  /*
8
- Stencil Client Patch Browser v2.22.3 | MIT Licensed | https://stenciljs.com
6
+ Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
9
7
  */
10
8
  const patchBrowser = () => {
11
9
  const importMeta = (typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('webcomponents.cjs.js', document.baseURI).href));
@@ -17,7 +15,5 @@ const patchBrowser = () => {
17
15
  };
18
16
 
19
17
  patchBrowser().then(options => {
20
- return index.bootstrapLazy([["justifi-billing-form.cjs",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-payment-method-form.cjs",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]],["justifi-bank-account-form.cjs",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form.cjs",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payments-list.cjs",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2.cjs",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]]], options);
18
+ return index.bootstrapLazy([["justifi-billing-form.cjs",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-bank-account-form.cjs",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form.cjs",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payment-form.cjs",[[4,"justifi-payment-form",{"validationStrategy":[1,"validation-strategy"]}]]],["justifi-payments-list.cjs",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2.cjs",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]],["justifi-payment-method-form.cjs",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
21
19
  });
22
-
23
- exports.setNonce = index.setNonce;
@@ -3,6 +3,7 @@
3
3
  "./components/bank-account-form/bank-account-form.js",
4
4
  "./components/billing-form/billing-form.js",
5
5
  "./components/card-form/card-form.js",
6
+ "./components/payment-form/payment-form.js",
6
7
  "./components/payment-method-form/payment-method-form.js",
7
8
  "./components/payments-list/payments-list.js",
8
9
  "./components/select-input/select-input.js",
@@ -10,8 +11,8 @@
10
11
  ],
11
12
  "compiler": {
12
13
  "name": "@stencil/core",
13
- "version": "2.22.3",
14
- "typescriptVersion": "4.9.4"
14
+ "version": "2.20.0",
15
+ "typescriptVersion": "4.8.4"
15
16
  },
16
17
  "collections": [],
17
18
  "bundles": []
@@ -0,0 +1,132 @@
1
+ export default {
2
+ title: 'Components/CardForm',
3
+ component: 'justifi-card-form',
4
+ parameters: {
5
+ actions: {
6
+ handles: [
7
+ 'cardFormReady',
8
+ 'cardFormValidate',
9
+ 'cardFormTokenize'
10
+ ],
11
+ },
12
+ },
13
+ decorators: [
14
+ (story) => `
15
+ ${story()}
16
+ <script>${addEvents()}</script>
17
+ `,
18
+ ],
19
+ };
20
+ const paymentMethodData = {
21
+ name: 'John Doe',
22
+ };
23
+ // IMPORTANT:
24
+ // Only use named functions when binding to event handlers. Otherwise, they will be bound multiple times
25
+ // Going forward, we could create a decorator that binds events
26
+ const handleValidateClick = () => {
27
+ const cardForm = document.querySelector('justifi-card-form');
28
+ cardForm.validate();
29
+ console.log('validate');
30
+ };
31
+ const handleTokenizeClick = async () => {
32
+ const cardForm = document.querySelector('justifi-card-form');
33
+ const tokenizeResponse = await cardForm.tokenize('CLIENT_ID', paymentMethodData);
34
+ console.log(tokenizeResponse);
35
+ };
36
+ const handleReadyClick = () => {
37
+ const validateBtn = document.querySelector('#validate-btn');
38
+ const tokenizeBtn = document.querySelector('#tokenize-btn');
39
+ validateBtn === null || validateBtn === void 0 ? void 0 : validateBtn.addEventListener('click', handleValidateClick);
40
+ tokenizeBtn === null || tokenizeBtn === void 0 ? void 0 : tokenizeBtn.addEventListener('click', handleTokenizeClick);
41
+ };
42
+ const addEvents = () => {
43
+ addEventListener('cardFormReady', handleReadyClick);
44
+ };
45
+ // This should be abstracted away, included as a decorator and styled properly
46
+ const buttons = `
47
+ <style>
48
+ .button-bar {
49
+ display: flex;
50
+ aligin-items: center;
51
+ padding: 10px;
52
+ }
53
+ .button-bar button {
54
+ margin-right: 10px;
55
+ }
56
+ </style>
57
+ <div class="button-bar">
58
+ <button id="validate-btn">Validate</button>
59
+ <button id="tokenize-btn">Tokenize</button>
60
+ </div>
61
+ `;
62
+ const storyStyleOverrides = {
63
+ "layout": {
64
+ "padding": "100px",
65
+ "formControlSpacingHorizontal": ".5rem",
66
+ "formControlSpacingVertical": "1rem"
67
+ },
68
+ "formLabel": {
69
+ "fontWeight": "700",
70
+ "fontFamily": "sans-serif",
71
+ "margin": "0 0 .5rem 0"
72
+ },
73
+ "formControl": {
74
+ "backgroundColor": "#00F4F6",
75
+ "backgroundColorHover": "#EEEEF5",
76
+ "borderColor": "rgba(0, 0, 0, 0.42)",
77
+ "borderColorHover": "rgba(0, 0, 0, 0.62)",
78
+ "borderColorFocus": "#fccc32",
79
+ "borderColorError": "#C12727",
80
+ "borderWidth": "0px",
81
+ "borderBottomWidth": "1px",
82
+ "borderRadius": "40px 4px 0 0",
83
+ "borderStyle": "solid",
84
+ "boxShadowErrorFocus": "none",
85
+ "boxShadowFocus": "none",
86
+ "color": "#212529",
87
+ "fontSize": "1rem",
88
+ "fontWeight": "400",
89
+ "lineHeight": "2",
90
+ "margin": "0",
91
+ "padding": ".5rem .875rem"
92
+ },
93
+ "errorMessage": {
94
+ "color": "#C12727",
95
+ "margin": ".25rem 0 0 0",
96
+ "fontSize": ".875rem"
97
+ }
98
+ };
99
+ const Template = ({ includeButtons, styleOverrides }) => {
100
+ const parsedStyleOverrides = styleOverrides ? JSON.stringify(styleOverrides) : null;
101
+ // The <div> here should be replaced by a `display` property in the cardForm potentially
102
+ return (`
103
+ <div>
104
+ <justifi-card-form style-overrides='${parsedStyleOverrides || ''}' />
105
+ </div>
106
+ ${includeButtons ? buttons : ''}
107
+ `);
108
+ };
109
+ export const Basic = Template.bind({});
110
+ Basic.args = {
111
+ includeButtons: true
112
+ };
113
+ export const Embedded = Template.bind({});
114
+ Embedded.args = {
115
+ includeButtons: true
116
+ };
117
+ Embedded.decorators = [
118
+ (story) => `
119
+ <style>
120
+ #wrapper {
121
+ background-color: #aaaaaa;
122
+ }
123
+ </style>
124
+ <div id="wrapper" style="width: 50%;">
125
+ ${story()}
126
+ </div>
127
+ `,
128
+ ];
129
+ export const Styled = Template.bind({});
130
+ Styled.args = {
131
+ styleOverrides: storyStyleOverrides
132
+ };
@@ -0,0 +1,31 @@
1
+ import { h, Host } from '@stencil/core';
2
+ export class PaymentForm {
3
+ constructor() {
4
+ this.validationStrategy = undefined;
5
+ }
6
+ render() {
7
+ return (h(Host, null, h("form", null, h("slot", null))));
8
+ }
9
+ static get is() { return "justifi-payment-form"; }
10
+ static get properties() {
11
+ return {
12
+ "validationStrategy": {
13
+ "type": "string",
14
+ "mutable": false,
15
+ "complexType": {
16
+ "original": "'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all'",
17
+ "resolved": "\"all\" | \"onBlur\" | \"onChange\" | \"onSubmit\" | \"onTouched\"",
18
+ "references": {}
19
+ },
20
+ "required": false,
21
+ "optional": false,
22
+ "docs": {
23
+ "tags": [],
24
+ "text": ""
25
+ },
26
+ "attribute": "validation-strategy",
27
+ "reflect": false
28
+ }
29
+ };
30
+ }
31
+ }
@@ -1,5 +1,6 @@
1
1
  import { Host, h } from '@stencil/core';
2
2
  import { MessageEventType } from './message-event-types';
3
+ import packageJson from '../../../package.json';
3
4
  export class PaymentMethodForm {
4
5
  constructor() {
5
6
  this.paymentMethodFormType = undefined;
@@ -54,8 +55,9 @@ export class PaymentMethodForm {
54
55
  const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
55
56
  const payload = {
56
57
  clientId: clientId,
58
+ componentVersion: packageJson.version,
57
59
  paymentMethodMetadata: paymentMethodMetadata,
58
- account: account
60
+ account: account,
59
61
  };
60
62
  return this.postMessageWithResponseListener(eventType, payload);
61
63
  }
@@ -2,6 +2,7 @@
2
2
  export { BankAccountForm as JustifiBankAccountForm } from '../types/components/bank-account-form/bank-account-form';
3
3
  export { BillingForm as JustifiBillingForm } from '../types/components/billing-form/billing-form';
4
4
  export { CardForm as JustifiCardForm } from '../types/components/card-form/card-form';
5
+ export { PaymentForm as JustifiPaymentForm } from '../types/components/payment-form/payment-form';
5
6
  export { PaymentMethodForm as JustifiPaymentMethodForm } from '../types/components/payment-method-form/payment-method-form';
6
7
  export { PaymentsList as JustifiPaymentsList } from '../types/components/payments-list/payments-list';
7
8
  export { SelectInput as SelectInput } from '../types/components/select-input/select-input';
@@ -19,15 +20,6 @@ export { TextInput as TextInput } from '../types/components/text-input/text-inpu
19
20
  */
20
21
  export declare const setAssetPath: (path: string) => void;
21
22
 
22
- /**
23
- * Used to specify a nonce value that corresponds with an application's CSP.
24
- * When set, the nonce will be added to all dynamically created script and style tags at runtime.
25
- * Alternatively, the nonce value can be set on a meta tag in the DOM head
26
- * (<meta name="csp-nonce" content="{ nonce value here }" />) which
27
- * will result in the same behavior.
28
- */
29
- export declare const setNonce: (nonce: string) => void
30
-
31
23
  export interface SetPlatformOptions {
32
24
  raf?: (c: FrameRequestCallback) => number;
33
25
  ael?: (el: EventTarget, eventName: string, listener: EventListenerOrEventListenerObject, options: boolean | AddEventListenerOptions) => void;
@@ -1,7 +1,8 @@
1
- export { setAssetPath, setNonce, setPlatformOptions } from '@stencil/core/internal/client';
1
+ export { setAssetPath, setPlatformOptions } from '@stencil/core/internal/client';
2
2
  export { JustifiBankAccountForm, defineCustomElement as defineCustomElementJustifiBankAccountForm } from './justifi-bank-account-form.js';
3
3
  export { JustifiBillingForm, defineCustomElement as defineCustomElementJustifiBillingForm } from './justifi-billing-form.js';
4
4
  export { JustifiCardForm, defineCustomElement as defineCustomElementJustifiCardForm } from './justifi-card-form.js';
5
+ export { JustifiPaymentForm, defineCustomElement as defineCustomElementJustifiPaymentForm } from './justifi-payment-form.js';
5
6
  export { JustifiPaymentMethodForm, defineCustomElement as defineCustomElementJustifiPaymentMethodForm } from './justifi-payment-method-form.js';
6
7
  export { JustifiPaymentsList, defineCustomElement as defineCustomElementJustifiPaymentsList } from './justifi-payments-list.js';
7
8
  export { SelectInput, defineCustomElement as defineCustomElementSelectInput } from './select-input.js';
@@ -0,0 +1,11 @@
1
+ import type { Components, JSX } from "../types/components";
2
+
3
+ interface JustifiPaymentForm extends Components.JustifiPaymentForm, HTMLElement {}
4
+ export const JustifiPaymentForm: {
5
+ prototype: JustifiPaymentForm;
6
+ new (): JustifiPaymentForm;
7
+ };
8
+ /**
9
+ * Used to define this component and all nested components recursively.
10
+ */
11
+ export const defineCustomElement: () => void;
@@ -0,0 +1,32 @@
1
+ import { proxyCustomElement, HTMLElement, h, Host } from '@stencil/core/internal/client';
2
+
3
+ const PaymentForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
4
+ constructor() {
5
+ super();
6
+ this.__registerHost();
7
+ this.validationStrategy = undefined;
8
+ }
9
+ render() {
10
+ return (h(Host, null, h("form", null, h("slot", null))));
11
+ }
12
+ }, [4, "justifi-payment-form", {
13
+ "validationStrategy": [1, "validation-strategy"]
14
+ }]);
15
+ function defineCustomElement$1() {
16
+ if (typeof customElements === "undefined") {
17
+ return;
18
+ }
19
+ const components = ["justifi-payment-form"];
20
+ components.forEach(tagName => { switch (tagName) {
21
+ case "justifi-payment-form":
22
+ if (!customElements.get(tagName)) {
23
+ customElements.define(tagName, PaymentForm);
24
+ }
25
+ break;
26
+ } });
27
+ }
28
+
29
+ const JustifiPaymentForm = PaymentForm;
30
+ const defineCustomElement = defineCustomElement$1;
31
+
32
+ export { JustifiPaymentForm, defineCustomElement };
@@ -17,6 +17,87 @@ const MessageEventType = {
17
17
  }
18
18
  };
19
19
 
20
+ const name = "@justifi/webcomponents";
21
+ const version = "0.2.1";
22
+ const description = "JustiFi Web Components";
23
+ const main = "dist/index.cjs.js";
24
+ const module = "dist/index.js";
25
+ const es2015 = "dist/esm/index.mjs";
26
+ const es2017 = "dist/esm/index.mjs";
27
+ const types = "dist/types/index.d.ts";
28
+ const collection = "dist/collection/collection-manifest.json";
29
+ const unpkg = "dist/stencil-webcomponents/stencil-webcomponents.esm.js";
30
+ const repository = {
31
+ type: "git",
32
+ url: "git+https://github.com/justifi-tech/web-component-library.git"
33
+ };
34
+ const publishConfig = {
35
+ registry: "https://registry.npmjs.org"
36
+ };
37
+ const files = [
38
+ "dist/",
39
+ "loader/"
40
+ ];
41
+ const scripts = {
42
+ "auto-changelog": "auto-changelog",
43
+ release: "release-it --no-npm",
44
+ build: "stencil build --docs",
45
+ start: "concurrently -c \"bgBlue.bold,bgMagenta.bold,bgGreen.bold\" \"yarn run start-stencil\" \"yarn run storybook\"",
46
+ "start-stencil": "stencil build --watch --serve --no-open",
47
+ test: "stencil test --spec --e2e",
48
+ "test:watch": "stencil test --spec --e2e --watchAll",
49
+ generate: "stencil generate",
50
+ storybook: "start-storybook -p 6006",
51
+ "build-storybook": "build-storybook"
52
+ };
53
+ const dependencies = {
54
+ "@stencil/core": "^2.13.0",
55
+ "@stencil/react-output-target": "^0.3.1",
56
+ "date-fns": "^2.29.3",
57
+ "dinero.js": "^1.9.1",
58
+ uuid: "^9.0.0",
59
+ yup: "^1.0.0"
60
+ };
61
+ const devDependencies = {
62
+ "@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
63
+ "@storybook/addon-actions": "^6.5.16",
64
+ "@storybook/addon-essentials": "^6.5.16",
65
+ "@storybook/addon-interactions": "^6.5.16",
66
+ "@storybook/addon-links": "^6.5.16",
67
+ "@storybook/builder-webpack4": "^6.5.16",
68
+ "@storybook/html": "^6.5.16",
69
+ "@storybook/manager-webpack4": "^6.5.16",
70
+ "@storybook/testing-library": "^0.0.13",
71
+ "@types/jest": "^27.0.3",
72
+ "auto-changelog": "^2.4.0",
73
+ concurrently: "^7.6.0",
74
+ jest: "^27.4.5",
75
+ "jest-cli": "^27.4.5",
76
+ puppeteer: "^10.0.0",
77
+ "release-it": "^15.6.0"
78
+ };
79
+ const license = "MIT";
80
+ const packageJson = {
81
+ name: name,
82
+ version: version,
83
+ description: description,
84
+ main: main,
85
+ module: module,
86
+ es2015: es2015,
87
+ es2017: es2017,
88
+ types: types,
89
+ collection: collection,
90
+ "collection:main": "dist/collection/index.js",
91
+ unpkg: unpkg,
92
+ repository: repository,
93
+ publishConfig: publishConfig,
94
+ files: files,
95
+ scripts: scripts,
96
+ dependencies: dependencies,
97
+ devDependencies: devDependencies,
98
+ license: license
99
+ };
100
+
20
101
  const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";
21
102
 
22
103
  const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLElement {
@@ -77,8 +158,9 @@ const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
77
158
  const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
78
159
  const payload = {
79
160
  clientId: clientId,
161
+ componentVersion: packageJson.version,
80
162
  paymentMethodMetadata: paymentMethodMetadata,
81
- account: account
163
+ account: account,
82
164
  };
83
165
  return this.postMessageWithResponseListener(eventType, payload);
84
166
  }