@justifi/webcomponents 4.0.2 → 4.0.6
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.
- package/CHANGELOG.md +7 -0
- package/dist/cjs/Api-11362403.js +111 -0
- package/dist/cjs/Api-11362403.js.map +1 -0
- package/dist/cjs/Payment-ac4dea02.js +2 -0
- package/dist/cjs/Payment-ac4dea02.js.map +1 -0
- package/dist/cjs/{index-051b6dd0.js → index-34312a38.js} +185 -21
- package/dist/cjs/index-34312a38.js.map +1 -0
- package/dist/cjs/index.cjs.js +2 -0
- package/dist/cjs/index.cjs.js.map +1 -0
- package/dist/cjs/{index.esm-8df4906e.js → index.esm-bcf90c56.js} +2 -244
- package/dist/cjs/index.esm-bcf90c56.js.map +1 -0
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js +8 -5
- package/dist/cjs/justifi-billing-form_2.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-business-address.cjs.entry.js +7 -4
- package/dist/cjs/justifi-business-address.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-business-info.cjs.entry.js +174 -0
- package/dist/cjs/justifi-business-info.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-card-form.cjs.entry.js +3 -1
- package/dist/cjs/justifi-card-form.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payment-form.cjs.entry.js +10 -4
- package/dist/cjs/justifi-payment-form.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js +12 -7
- package/dist/cjs/justifi-payment-method-form.cjs.entry.js.map +1 -0
- package/dist/cjs/justifi-payments-list.cjs.entry.js +5 -108
- package/dist/cjs/justifi-payments-list.cjs.entry.js.map +1 -0
- package/dist/cjs/loader.cjs.js +6 -3
- package/dist/cjs/loader.cjs.js.map +1 -0
- package/dist/cjs/select-input_2.cjs.entry.js +5 -3
- package/dist/cjs/select-input_2.cjs.entry.js.map +1 -0
- package/dist/cjs/state-options-efeaa587.js +248 -0
- package/dist/cjs/state-options-efeaa587.js.map +1 -0
- package/dist/cjs/webcomponents.cjs.js +12 -3
- package/dist/cjs/webcomponents.cjs.js.map +1 -0
- package/dist/collection/api/Api.js +2 -1
- package/dist/collection/api/Api.js.map +1 -0
- package/dist/collection/api/Pagination.js +1 -0
- package/dist/collection/api/Pagination.js.map +1 -0
- package/dist/collection/api/Payment.js +1 -0
- package/dist/collection/api/Payment.js.map +1 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/api/index.js.map +1 -0
- package/dist/collection/api/mockData/MockPayments.js +1 -0
- package/dist/collection/api/mockData/MockPayments.js.map +1 -0
- package/dist/collection/collection-manifest.json +4 -3
- package/dist/collection/components/bank-account-form/bank-account-form.js +1 -0
- package/dist/collection/components/bank-account-form/bank-account-form.js.map +1 -0
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js +1 -0
- package/dist/collection/components/bank-account-form/bank-account-form.stories.js.map +1 -0
- package/dist/collection/components/bank-account-form/test/bank-account-form.e2e.js +14 -0
- package/dist/collection/components/bank-account-form/test/bank-account-form.e2e.js.map +1 -0
- package/dist/collection/components/bank-account-form/test/bank-account-form.spec.js +48 -0
- package/dist/collection/components/bank-account-form/test/bank-account-form.spec.js.map +1 -0
- package/dist/collection/components/billing-form/billing-form-schema.js +1 -0
- package/dist/collection/components/billing-form/billing-form-schema.js.map +1 -0
- package/dist/collection/components/billing-form/billing-form.css +337 -0
- package/dist/collection/components/billing-form/billing-form.js +1 -0
- package/dist/collection/components/billing-form/billing-form.js.map +1 -0
- package/dist/collection/components/billing-form/billing-form.stories.js +1 -0
- package/dist/collection/components/billing-form/billing-form.stories.js.map +1 -0
- package/dist/collection/components/billing-form/state-options.js +1 -0
- package/dist/collection/components/billing-form/state-options.js.map +1 -0
- package/dist/collection/components/billing-form/test/billing-form.spec.js +31 -0
- package/dist/collection/components/billing-form/test/billing-form.spec.js.map +1 -0
- package/dist/collection/components/business-address/business-address-schema.js +1 -0
- package/dist/collection/components/business-address/business-address-schema.js.map +1 -0
- package/dist/collection/components/business-address/business-address.css +337 -0
- package/dist/collection/components/business-address/business-address.js +1 -0
- package/dist/collection/components/business-address/business-address.js.map +1 -0
- package/dist/collection/components/business-address/test/business-address.e2e.js +10 -0
- package/dist/collection/components/business-address/test/business-address.e2e.js.map +1 -0
- package/dist/collection/components/business-address/test/business-address.spec.js +18 -0
- package/dist/collection/components/business-address/test/business-address.spec.js.map +1 -0
- package/dist/collection/components/business-info/business-info-schema.js +94 -0
- package/dist/collection/components/business-info/business-info-schema.js.map +1 -0
- package/dist/collection/components/business-info/business-info.css +2274 -0
- package/dist/collection/components/business-info/business-info.js +168 -0
- package/dist/collection/components/business-info/business-info.js.map +1 -0
- package/dist/collection/components/card-form/card-form.js +1 -0
- package/dist/collection/components/card-form/card-form.js.map +1 -0
- package/dist/collection/components/card-form/card-form.stories.js +1 -0
- package/dist/collection/components/card-form/card-form.stories.js.map +1 -0
- package/dist/collection/components/card-form/test/card-form.e2e.js +14 -0
- package/dist/collection/components/card-form/test/card-form.e2e.js.map +1 -0
- package/dist/collection/components/card-form/test/card-form.spec.js +56 -0
- package/dist/collection/components/card-form/test/card-form.spec.js.map +1 -0
- package/dist/collection/components/payment-form/payment-form.css +412 -0
- package/dist/collection/components/payment-form/payment-form.js +8 -2
- package/dist/collection/components/payment-form/payment-form.js.map +1 -0
- package/dist/collection/components/payment-form/payment-form.stories.js +1 -0
- package/dist/collection/components/payment-form/payment-form.stories.js.map +1 -0
- package/dist/collection/components/payment-form/payment-method-selector.css +337 -0
- package/dist/collection/components/payment-form/payment-method-selector.js +1 -0
- package/dist/collection/components/payment-form/payment-method-selector.js.map +1 -0
- package/dist/collection/components/payment-form/test/payment-form.e2e.js +23 -0
- package/dist/collection/components/payment-form/test/payment-form.e2e.js.map +1 -0
- package/dist/collection/components/payment-form/test/payment-form.spec.js +182 -0
- package/dist/collection/components/payment-form/test/payment-form.spec.js.map +1 -0
- package/dist/collection/components/payment-form/tokenize.js +1 -0
- package/dist/collection/components/payment-form/tokenize.js.map +1 -0
- package/dist/collection/components/payment-method-form/get-computed-theme.js +1 -0
- package/dist/collection/components/payment-method-form/get-computed-theme.js.map +1 -0
- package/dist/collection/components/payment-method-form/message-event-types.js +1 -0
- package/dist/collection/components/payment-method-form/message-event-types.js.map +1 -0
- package/dist/collection/components/payment-method-form/payment-method-form.js +2 -2
- package/dist/collection/components/payment-method-form/payment-method-form.js.map +1 -0
- package/dist/collection/components/payment-method-form/payment-method-responses.js +1 -0
- package/dist/collection/components/payment-method-form/payment-method-responses.js.map +1 -0
- package/dist/collection/components/payment-method-form/test/payment-method-form.e2e.js +22 -0
- package/dist/collection/components/payment-method-form/test/payment-method-form.e2e.js.map +1 -0
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js +83 -0
- package/dist/collection/components/payment-method-form/test/payment-method-form.spec.js.map +1 -0
- package/dist/collection/components/payment-method-form/theme.js +1 -0
- package/dist/collection/components/payment-method-form/theme.js.map +1 -0
- package/dist/collection/components/payments-list/payments-list.js +1 -0
- package/dist/collection/components/payments-list/payments-list.js.map +1 -0
- package/dist/collection/components/payments-list/test/payments-list.spec.js +21 -0
- package/dist/collection/components/payments-list/test/payments-list.spec.js.map +1 -0
- package/dist/collection/components/select-input/select-input.css +337 -0
- package/dist/collection/components/select-input/select-input.js +1 -0
- package/dist/collection/components/select-input/select-input.js.map +1 -0
- package/dist/collection/components/select-input/test/select-input.spec.js +36 -0
- package/dist/collection/components/select-input/test/select-input.spec.js.map +1 -0
- package/dist/collection/components/text-input/test/text-input.spec.js +19 -0
- package/dist/collection/components/text-input/test/text-input.spec.js.map +1 -0
- package/dist/collection/components/text-input/text-input.css +337 -0
- package/dist/collection/components/text-input/text-input.js +1 -0
- package/dist/collection/components/text-input/text-input.js.map +1 -0
- package/dist/collection/index.js +1 -0
- package/dist/collection/index.js.map +1 -0
- package/dist/collection/utils/utils.js +1 -0
- package/dist/collection/utils/utils.js.map +1 -0
- package/dist/components/Api.js +109 -0
- package/dist/components/Api.js.map +1 -0
- package/dist/components/Payment.js +2 -0
- package/dist/components/Payment.js.map +1 -0
- package/dist/components/billing-form.js +6 -3
- package/dist/components/billing-form.js.map +1 -0
- package/dist/components/index.d.ts +9 -13
- package/dist/{esm/index.esm-c6a89005.js → components/index.esm.js} +3 -244
- package/dist/components/index.esm.js.map +1 -0
- package/dist/components/index.js +3 -11
- package/dist/components/index.js.map +1 -0
- package/dist/components/justifi-bank-account-form.js +3 -1
- package/dist/components/justifi-bank-account-form.js.map +1 -0
- package/dist/components/justifi-billing-form.js +2 -0
- package/dist/components/justifi-billing-form.js.map +1 -0
- package/dist/components/justifi-business-address.js +6 -3
- package/dist/components/justifi-business-address.js.map +1 -0
- package/dist/components/justifi-business-info.d.ts +11 -0
- package/dist/components/justifi-business-info.js +207 -0
- package/dist/components/justifi-business-info.js.map +1 -0
- package/dist/components/justifi-card-form.js +3 -1
- package/dist/components/justifi-card-form.js.map +1 -0
- package/dist/components/justifi-payment-form.js +11 -4
- package/dist/components/justifi-payment-form.js.map +1 -0
- package/dist/components/justifi-payment-method-form.js +2 -0
- package/dist/components/justifi-payment-method-form.js.map +1 -0
- package/dist/components/justifi-payment-method-selector.js +2 -0
- package/dist/components/justifi-payment-method-selector.js.map +1 -0
- package/dist/components/justifi-payments-list.js +4 -107
- package/dist/components/justifi-payments-list.js.map +1 -0
- package/dist/components/payment-method-form.js +12 -7
- package/dist/components/payment-method-form.js.map +1 -0
- package/dist/components/payment-method-selector.js +4 -2
- package/dist/components/payment-method-selector.js.map +1 -0
- package/dist/components/select-input.js +2 -0
- package/dist/components/select-input.js.map +1 -0
- package/dist/components/select-input2.js +4 -2
- package/dist/components/select-input2.js.map +1 -0
- package/dist/components/state-options.js +3 -1845
- package/dist/components/state-options.js.map +1 -0
- package/dist/components/text-input.js +2 -0
- package/dist/components/text-input.js.map +1 -0
- package/dist/components/text-input2.js +4 -2
- package/dist/components/text-input2.js.map +1 -0
- package/dist/esm/Api-a07f0057.js +109 -0
- package/dist/esm/Api-a07f0057.js.map +1 -0
- package/dist/esm/Payment-c86e1e84.js +2 -0
- package/dist/esm/Payment-c86e1e84.js.map +1 -0
- package/dist/esm/{index-605b421a.js → index-044f93fc.js} +185 -22
- package/dist/esm/index-044f93fc.js.map +1 -0
- package/dist/esm/index.esm-5624a5ed.js +1847 -0
- package/dist/esm/index.esm-5624a5ed.js.map +1 -0
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -0
- package/dist/esm/justifi-bank-account-form.entry.js +3 -1
- package/dist/esm/justifi-bank-account-form.entry.js.map +1 -0
- package/dist/esm/justifi-billing-form_2.entry.js +7 -4
- package/dist/esm/justifi-billing-form_2.entry.js.map +1 -0
- package/dist/esm/justifi-business-address.entry.js +6 -3
- package/dist/esm/justifi-business-address.entry.js.map +1 -0
- package/dist/esm/justifi-business-info.entry.js +170 -0
- package/dist/esm/justifi-business-info.entry.js.map +1 -0
- package/dist/esm/justifi-card-form.entry.js +3 -1
- package/dist/esm/justifi-card-form.entry.js.map +1 -0
- package/dist/esm/justifi-payment-form.entry.js +10 -4
- package/dist/esm/justifi-payment-form.entry.js.map +1 -0
- package/dist/esm/justifi-payment-method-form.entry.js +12 -7
- package/dist/esm/justifi-payment-method-form.entry.js.map +1 -0
- package/dist/esm/justifi-payments-list.entry.js +4 -107
- package/dist/esm/justifi-payments-list.entry.js.map +1 -0
- package/dist/esm/loader.js +6 -3
- package/dist/esm/loader.js.map +1 -0
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/select-input_2.entry.js +5 -3
- package/dist/esm/select-input_2.entry.js.map +1 -0
- package/dist/esm/state-options-188acc34.js +246 -0
- package/dist/esm/state-options-188acc34.js.map +1 -0
- package/dist/esm/webcomponents.js +9 -3
- package/dist/esm/webcomponents.js.map +1 -0
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Payment.d.ts +1 -1
- package/dist/types/components/business-info/business-info-schema.d.ts +42 -0
- package/dist/types/components/business-info/business-info.d.ts +20 -0
- package/dist/types/components/payment-form/payment-form.d.ts +1 -0
- package/dist/types/components/payment-method-form/payment-method-responses.d.ts +1 -1
- package/dist/types/components.d.ts +63 -0
- package/dist/types/stencil-public-runtime.d.ts +72 -15
- package/dist/webcomponents/index.esm.js +2 -0
- package/dist/webcomponents/index.esm.js.map +1 -0
- package/dist/webcomponents/p-0ea23153.js +2 -0
- package/dist/webcomponents/p-0ea23153.js.map +1 -0
- package/dist/webcomponents/p-16b4e90a.entry.js +2 -0
- package/dist/webcomponents/p-16b4e90a.entry.js.map +1 -0
- package/dist/webcomponents/p-1ca0646b.js +2 -1
- package/dist/webcomponents/p-1ca0646b.js.map +1 -0
- package/dist/webcomponents/p-1f151d49.js +2 -0
- package/dist/webcomponents/p-1f151d49.js.map +1 -0
- package/dist/webcomponents/p-1f23b391.entry.js +2 -0
- package/dist/webcomponents/p-1f23b391.entry.js.map +1 -0
- package/dist/webcomponents/p-255b1284.entry.js +2 -0
- package/dist/webcomponents/p-255b1284.entry.js.map +1 -0
- package/dist/webcomponents/p-3aa91155.js +3 -0
- package/dist/webcomponents/p-3aa91155.js.map +1 -0
- package/dist/webcomponents/p-90c0d9e1.entry.js +2 -0
- package/dist/webcomponents/p-90c0d9e1.entry.js.map +1 -0
- package/dist/webcomponents/p-c903cc5a.entry.js +2 -0
- package/dist/webcomponents/p-c903cc5a.entry.js.map +1 -0
- package/dist/webcomponents/p-d87b0711.entry.js +2 -0
- package/dist/webcomponents/p-d87b0711.entry.js.map +1 -0
- package/dist/webcomponents/p-dbf7100f.entry.js +2 -0
- package/dist/webcomponents/p-dbf7100f.entry.js.map +1 -0
- package/dist/webcomponents/p-e0054bc3.js +2 -0
- package/dist/webcomponents/p-e0054bc3.js.map +1 -0
- package/dist/webcomponents/p-f30d1567.entry.js +2 -0
- package/dist/webcomponents/p-f30d1567.entry.js.map +1 -0
- package/dist/webcomponents/p-f66f024e.entry.js +2 -0
- package/dist/webcomponents/p-f66f024e.entry.js.map +1 -0
- package/dist/webcomponents/webcomponents.css +1 -1
- package/dist/webcomponents/webcomponents.esm.js +2 -1
- package/dist/webcomponents/webcomponents.esm.js.map +1 -0
- package/loader/index.d.ts +9 -0
- package/package.json +8 -4
- package/dist/webcomponents/p-039e3540.entry.js +0 -1
- package/dist/webcomponents/p-11e5bef9.entry.js +0 -1
- package/dist/webcomponents/p-20732337.js +0 -1
- package/dist/webcomponents/p-24409e8e.entry.js +0 -1
- package/dist/webcomponents/p-4a406704.js +0 -2
- package/dist/webcomponents/p-5774e36e.entry.js +0 -1
- package/dist/webcomponents/p-5b5e8351.entry.js +0 -1
- package/dist/webcomponents/p-7747c086.entry.js +0 -1
- package/dist/webcomponents/p-b061da77.entry.js +0 -1
- package/dist/webcomponents/p-bc35e124.entry.js +0 -1
|
@@ -67,6 +67,343 @@
|
|
|
67
67
|
--bs-highlight-bg: #fff3cd;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
+
.spinner-grow,
|
|
71
|
+
.spinner-border {
|
|
72
|
+
display: inline-block;
|
|
73
|
+
width: var(--bs-spinner-width);
|
|
74
|
+
height: var(--bs-spinner-height);
|
|
75
|
+
vertical-align: var(--bs-spinner-vertical-align);
|
|
76
|
+
border-radius: 50%;
|
|
77
|
+
animation: var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
@keyframes spinner-border {
|
|
81
|
+
to {
|
|
82
|
+
transform: rotate(360deg) /* rtl:ignore */;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
.spinner-border {
|
|
86
|
+
--bs-spinner-width: 2rem;
|
|
87
|
+
--bs-spinner-height: 2rem;
|
|
88
|
+
--bs-spinner-vertical-align: -0.125em;
|
|
89
|
+
--bs-spinner-border-width: 0.25em;
|
|
90
|
+
--bs-spinner-animation-speed: 0.75s;
|
|
91
|
+
--bs-spinner-animation-name: spinner-border;
|
|
92
|
+
border: var(--bs-spinner-border-width) solid currentcolor;
|
|
93
|
+
border-right-color: transparent;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.spinner-border-sm {
|
|
97
|
+
--bs-spinner-width: 1rem;
|
|
98
|
+
--bs-spinner-height: 1rem;
|
|
99
|
+
--bs-spinner-border-width: 0.2em;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
@keyframes spinner-grow {
|
|
103
|
+
0% {
|
|
104
|
+
transform: scale(0);
|
|
105
|
+
}
|
|
106
|
+
50% {
|
|
107
|
+
opacity: 1;
|
|
108
|
+
transform: none;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
.spinner-grow {
|
|
112
|
+
--bs-spinner-width: 2rem;
|
|
113
|
+
--bs-spinner-height: 2rem;
|
|
114
|
+
--bs-spinner-vertical-align: -0.125em;
|
|
115
|
+
--bs-spinner-animation-speed: 0.75s;
|
|
116
|
+
--bs-spinner-animation-name: spinner-grow;
|
|
117
|
+
background-color: currentcolor;
|
|
118
|
+
opacity: 0;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.spinner-grow-sm {
|
|
122
|
+
--bs-spinner-width: 1rem;
|
|
123
|
+
--bs-spinner-height: 1rem;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
@media (prefers-reduced-motion: reduce) {
|
|
127
|
+
.spinner-border,
|
|
128
|
+
.spinner-grow {
|
|
129
|
+
--bs-spinner-animation-speed: 1.5s;
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
.clearfix::after {
|
|
133
|
+
display: block;
|
|
134
|
+
clear: both;
|
|
135
|
+
content: "";
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
.text-bg-primary {
|
|
139
|
+
color: #fff !important;
|
|
140
|
+
background-color: RGBA(13, 110, 253, var(--bs-bg-opacity, 1)) !important;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.text-bg-secondary {
|
|
144
|
+
color: #fff !important;
|
|
145
|
+
background-color: RGBA(108, 117, 125, var(--bs-bg-opacity, 1)) !important;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.text-bg-success {
|
|
149
|
+
color: #fff !important;
|
|
150
|
+
background-color: RGBA(25, 135, 84, var(--bs-bg-opacity, 1)) !important;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.text-bg-info {
|
|
154
|
+
color: #000 !important;
|
|
155
|
+
background-color: RGBA(13, 202, 240, var(--bs-bg-opacity, 1)) !important;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.text-bg-warning {
|
|
159
|
+
color: #000 !important;
|
|
160
|
+
background-color: RGBA(255, 193, 7, var(--bs-bg-opacity, 1)) !important;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.text-bg-danger {
|
|
164
|
+
color: #fff !important;
|
|
165
|
+
background-color: RGBA(220, 53, 69, var(--bs-bg-opacity, 1)) !important;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.text-bg-light {
|
|
169
|
+
color: #000 !important;
|
|
170
|
+
background-color: RGBA(248, 249, 250, var(--bs-bg-opacity, 1)) !important;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.text-bg-dark {
|
|
174
|
+
color: #fff !important;
|
|
175
|
+
background-color: RGBA(33, 37, 41, var(--bs-bg-opacity, 1)) !important;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.link-primary {
|
|
179
|
+
color: #0d6efd !important;
|
|
180
|
+
}
|
|
181
|
+
.link-primary:hover, .link-primary:focus {
|
|
182
|
+
color: #0a58ca !important;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.link-secondary {
|
|
186
|
+
color: #6c757d !important;
|
|
187
|
+
}
|
|
188
|
+
.link-secondary:hover, .link-secondary:focus {
|
|
189
|
+
color: #565e64 !important;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.link-success {
|
|
193
|
+
color: #198754 !important;
|
|
194
|
+
}
|
|
195
|
+
.link-success:hover, .link-success:focus {
|
|
196
|
+
color: #146c43 !important;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.link-info {
|
|
200
|
+
color: #0dcaf0 !important;
|
|
201
|
+
}
|
|
202
|
+
.link-info:hover, .link-info:focus {
|
|
203
|
+
color: #3dd5f3 !important;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
.link-warning {
|
|
207
|
+
color: #ffc107 !important;
|
|
208
|
+
}
|
|
209
|
+
.link-warning:hover, .link-warning:focus {
|
|
210
|
+
color: #ffcd39 !important;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.link-danger {
|
|
214
|
+
color: #dc3545 !important;
|
|
215
|
+
}
|
|
216
|
+
.link-danger:hover, .link-danger:focus {
|
|
217
|
+
color: #b02a37 !important;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
.link-light {
|
|
221
|
+
color: #f8f9fa !important;
|
|
222
|
+
}
|
|
223
|
+
.link-light:hover, .link-light:focus {
|
|
224
|
+
color: #f9fafb !important;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.link-dark {
|
|
228
|
+
color: #212529 !important;
|
|
229
|
+
}
|
|
230
|
+
.link-dark:hover, .link-dark:focus {
|
|
231
|
+
color: #1a1e21 !important;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.ratio {
|
|
235
|
+
position: relative;
|
|
236
|
+
width: 100%;
|
|
237
|
+
}
|
|
238
|
+
.ratio::before {
|
|
239
|
+
display: block;
|
|
240
|
+
padding-top: var(--bs-aspect-ratio);
|
|
241
|
+
content: "";
|
|
242
|
+
}
|
|
243
|
+
.ratio > * {
|
|
244
|
+
position: absolute;
|
|
245
|
+
top: 0;
|
|
246
|
+
left: 0;
|
|
247
|
+
width: 100%;
|
|
248
|
+
height: 100%;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.ratio-1x1 {
|
|
252
|
+
--bs-aspect-ratio: 100%;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.ratio-4x3 {
|
|
256
|
+
--bs-aspect-ratio: 75%;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.ratio-16x9 {
|
|
260
|
+
--bs-aspect-ratio: 56.25%;
|
|
261
|
+
}
|
|
262
|
+
|
|
263
|
+
.ratio-21x9 {
|
|
264
|
+
--bs-aspect-ratio: 42.8571428571%;
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
.fixed-top {
|
|
268
|
+
position: fixed;
|
|
269
|
+
top: 0;
|
|
270
|
+
right: 0;
|
|
271
|
+
left: 0;
|
|
272
|
+
z-index: 1030;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.fixed-bottom {
|
|
276
|
+
position: fixed;
|
|
277
|
+
right: 0;
|
|
278
|
+
bottom: 0;
|
|
279
|
+
left: 0;
|
|
280
|
+
z-index: 1030;
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
.sticky-top {
|
|
284
|
+
position: sticky;
|
|
285
|
+
top: 0;
|
|
286
|
+
z-index: 1020;
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.sticky-bottom {
|
|
290
|
+
position: sticky;
|
|
291
|
+
bottom: 0;
|
|
292
|
+
z-index: 1020;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@media (min-width: 576px) {
|
|
296
|
+
.sticky-sm-top {
|
|
297
|
+
position: sticky;
|
|
298
|
+
top: 0;
|
|
299
|
+
z-index: 1020;
|
|
300
|
+
}
|
|
301
|
+
.sticky-sm-bottom {
|
|
302
|
+
position: sticky;
|
|
303
|
+
bottom: 0;
|
|
304
|
+
z-index: 1020;
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
@media (min-width: 768px) {
|
|
308
|
+
.sticky-md-top {
|
|
309
|
+
position: sticky;
|
|
310
|
+
top: 0;
|
|
311
|
+
z-index: 1020;
|
|
312
|
+
}
|
|
313
|
+
.sticky-md-bottom {
|
|
314
|
+
position: sticky;
|
|
315
|
+
bottom: 0;
|
|
316
|
+
z-index: 1020;
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
@media (min-width: 992px) {
|
|
320
|
+
.sticky-lg-top {
|
|
321
|
+
position: sticky;
|
|
322
|
+
top: 0;
|
|
323
|
+
z-index: 1020;
|
|
324
|
+
}
|
|
325
|
+
.sticky-lg-bottom {
|
|
326
|
+
position: sticky;
|
|
327
|
+
bottom: 0;
|
|
328
|
+
z-index: 1020;
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
@media (min-width: 1200px) {
|
|
332
|
+
.sticky-xl-top {
|
|
333
|
+
position: sticky;
|
|
334
|
+
top: 0;
|
|
335
|
+
z-index: 1020;
|
|
336
|
+
}
|
|
337
|
+
.sticky-xl-bottom {
|
|
338
|
+
position: sticky;
|
|
339
|
+
bottom: 0;
|
|
340
|
+
z-index: 1020;
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
@media (min-width: 1400px) {
|
|
344
|
+
.sticky-xxl-top {
|
|
345
|
+
position: sticky;
|
|
346
|
+
top: 0;
|
|
347
|
+
z-index: 1020;
|
|
348
|
+
}
|
|
349
|
+
.sticky-xxl-bottom {
|
|
350
|
+
position: sticky;
|
|
351
|
+
bottom: 0;
|
|
352
|
+
z-index: 1020;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
.hstack {
|
|
356
|
+
display: flex;
|
|
357
|
+
flex-direction: row;
|
|
358
|
+
align-items: center;
|
|
359
|
+
align-self: stretch;
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
.vstack {
|
|
363
|
+
display: flex;
|
|
364
|
+
flex: 1 1 auto;
|
|
365
|
+
flex-direction: column;
|
|
366
|
+
align-self: stretch;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
.visually-hidden,
|
|
370
|
+
.visually-hidden-focusable:not(:focus):not(:focus-within) {
|
|
371
|
+
position: absolute !important;
|
|
372
|
+
width: 1px !important;
|
|
373
|
+
height: 1px !important;
|
|
374
|
+
padding: 0 !important;
|
|
375
|
+
margin: -1px !important;
|
|
376
|
+
overflow: hidden !important;
|
|
377
|
+
clip: rect(0, 0, 0, 0) !important;
|
|
378
|
+
white-space: nowrap !important;
|
|
379
|
+
border: 0 !important;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
.stretched-link::after {
|
|
383
|
+
position: absolute;
|
|
384
|
+
top: 0;
|
|
385
|
+
right: 0;
|
|
386
|
+
bottom: 0;
|
|
387
|
+
left: 0;
|
|
388
|
+
z-index: 1;
|
|
389
|
+
content: "";
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
.text-truncate {
|
|
393
|
+
overflow: hidden;
|
|
394
|
+
text-overflow: ellipsis;
|
|
395
|
+
white-space: nowrap;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.vr {
|
|
399
|
+
display: inline-block;
|
|
400
|
+
align-self: stretch;
|
|
401
|
+
width: 1px;
|
|
402
|
+
min-height: 1em;
|
|
403
|
+
background-color: currentcolor;
|
|
404
|
+
opacity: 0.25;
|
|
405
|
+
}
|
|
406
|
+
|
|
70
407
|
*,
|
|
71
408
|
*::before,
|
|
72
409
|
*::after {
|
|
@@ -1927,6 +2264,68 @@ progress {
|
|
|
1927
2264
|
--bs-btn-border-radius: 0.25rem;
|
|
1928
2265
|
}
|
|
1929
2266
|
|
|
2267
|
+
.spinner-grow,
|
|
2268
|
+
.spinner-border {
|
|
2269
|
+
display: inline-block;
|
|
2270
|
+
width: var(--bs-spinner-width);
|
|
2271
|
+
height: var(--bs-spinner-height);
|
|
2272
|
+
vertical-align: var(--bs-spinner-vertical-align);
|
|
2273
|
+
border-radius: 50%;
|
|
2274
|
+
animation: var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name);
|
|
2275
|
+
}
|
|
2276
|
+
|
|
2277
|
+
@keyframes spinner-border {
|
|
2278
|
+
to {
|
|
2279
|
+
transform: rotate(360deg) /* rtl:ignore */;
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
.spinner-border {
|
|
2283
|
+
--bs-spinner-width: 2rem;
|
|
2284
|
+
--bs-spinner-height: 2rem;
|
|
2285
|
+
--bs-spinner-vertical-align: -0.125em;
|
|
2286
|
+
--bs-spinner-border-width: 0.25em;
|
|
2287
|
+
--bs-spinner-animation-speed: 0.75s;
|
|
2288
|
+
--bs-spinner-animation-name: spinner-border;
|
|
2289
|
+
border: var(--bs-spinner-border-width) solid currentcolor;
|
|
2290
|
+
border-right-color: transparent;
|
|
2291
|
+
}
|
|
2292
|
+
|
|
2293
|
+
.spinner-border-sm {
|
|
2294
|
+
--bs-spinner-width: 1rem;
|
|
2295
|
+
--bs-spinner-height: 1rem;
|
|
2296
|
+
--bs-spinner-border-width: 0.2em;
|
|
2297
|
+
}
|
|
2298
|
+
|
|
2299
|
+
@keyframes spinner-grow {
|
|
2300
|
+
0% {
|
|
2301
|
+
transform: scale(0);
|
|
2302
|
+
}
|
|
2303
|
+
50% {
|
|
2304
|
+
opacity: 1;
|
|
2305
|
+
transform: none;
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
.spinner-grow {
|
|
2309
|
+
--bs-spinner-width: 2rem;
|
|
2310
|
+
--bs-spinner-height: 2rem;
|
|
2311
|
+
--bs-spinner-vertical-align: -0.125em;
|
|
2312
|
+
--bs-spinner-animation-speed: 0.75s;
|
|
2313
|
+
--bs-spinner-animation-name: spinner-grow;
|
|
2314
|
+
background-color: currentcolor;
|
|
2315
|
+
opacity: 0;
|
|
2316
|
+
}
|
|
2317
|
+
|
|
2318
|
+
.spinner-grow-sm {
|
|
2319
|
+
--bs-spinner-width: 1rem;
|
|
2320
|
+
--bs-spinner-height: 1rem;
|
|
2321
|
+
}
|
|
2322
|
+
|
|
2323
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2324
|
+
.spinner-border,
|
|
2325
|
+
.spinner-grow {
|
|
2326
|
+
--bs-spinner-animation-speed: 1.5s;
|
|
2327
|
+
}
|
|
2328
|
+
}
|
|
1930
2329
|
:host {
|
|
1931
2330
|
font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
|
1932
2331
|
font-size: 1rem;
|
|
@@ -2010,4 +2409,17 @@ justifi-payment-method-form {
|
|
|
2010
2409
|
color: var(--jfi-submit-button-color-active);
|
|
2011
2410
|
background-color: var(--jfi-submit-button-background-color-active);
|
|
2012
2411
|
border-color: var(--jfi-submit-button-border-color-active);
|
|
2412
|
+
}
|
|
2413
|
+
|
|
2414
|
+
.btn.jfi-submit-button-loading {
|
|
2415
|
+
min-width: 75px;
|
|
2416
|
+
color: var(--jfi-submit-button-color-loading);
|
|
2417
|
+
background-color: var(--jfi-submit-button-background-color-loading);
|
|
2418
|
+
border-color: var(--jfi-submit-button-border-color-loading);
|
|
2419
|
+
}
|
|
2420
|
+
|
|
2421
|
+
.btn.jfi-submit-button-loading .spinner-border {
|
|
2422
|
+
border-top-color: var(--jfi-submit-button-color-loading);
|
|
2423
|
+
border-bottom-color: var(--jfi-submit-button-color-loading);
|
|
2424
|
+
border-left-color: var(--jfi-submit-button-color-loading);
|
|
2013
2425
|
}
|
|
@@ -10,6 +10,7 @@ export class PaymentForm {
|
|
|
10
10
|
this.accountId = undefined;
|
|
11
11
|
this.submitButtonText = undefined;
|
|
12
12
|
this.submitButtonEnabled = true;
|
|
13
|
+
this.isLoading = false;
|
|
13
14
|
this.selectedPaymentMethodType = undefined;
|
|
14
15
|
this.allowedPaymentMethodTypes = [];
|
|
15
16
|
}
|
|
@@ -43,11 +44,12 @@ export class PaymentForm {
|
|
|
43
44
|
const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();
|
|
44
45
|
if (!billingFormValidation.isValid || !paymentMethodFormValidation.isValid)
|
|
45
46
|
return;
|
|
46
|
-
this.
|
|
47
|
+
this.isLoading = true;
|
|
47
48
|
const billingFormFieldValues = await this.billingFormRef.getValues();
|
|
48
49
|
const paymentMethodData = Object.assign({ email: this.email }, billingFormFieldValues);
|
|
49
50
|
const tokenizeResponse = await this.paymentMethodFormRef.tokenize(this.clientId, paymentMethodData, this.accountId);
|
|
50
51
|
this.submitted.emit(tokenizeResponse);
|
|
52
|
+
this.isLoading = false;
|
|
51
53
|
}
|
|
52
54
|
render() {
|
|
53
55
|
return (h(Host, null, h("form", { class: "row gy-3" }, this.allowedPaymentMethodTypes.length > 1 && (h("div", { class: "col-12" }, h("justifi-payment-method-selector", { paymentMethodTypes: this.allowedPaymentMethodTypes, selectedPaymentMethodType: this.selectedPaymentMethodType }))), h("div", { class: "col-12" }, h("justifi-payment-method-form", { "payment-method-form-type": this.selectedPaymentMethodType, "iframe-origin": this.iframeOrigin, ref: el => {
|
|
@@ -58,7 +60,9 @@ export class PaymentForm {
|
|
|
58
60
|
if (el) {
|
|
59
61
|
this.billingFormRef = el;
|
|
60
62
|
}
|
|
61
|
-
} })), h("div", { class: "col-12" }, h("button", { onClick: event => this.submit(event), disabled: !this.submitButtonEnabled
|
|
63
|
+
} })), h("div", { class: "col-12" }, h("button", { type: "submit", onClick: event => this.submit(event), disabled: !this.submitButtonEnabled || this.isLoading, class: `btn btn-primary jfi-submit-button${this.isLoading ? ' jfi-submit-button-loading' : ''}` }, this.isLoading ?
|
|
64
|
+
h("div", { class: "spinner-border spinner-border-sm", role: "status" }, h("span", { class: "visually-hidden" }, "Loading...")) :
|
|
65
|
+
this.submitButtonText || 'Submit')))));
|
|
62
66
|
}
|
|
63
67
|
static get is() { return "justifi-payment-form"; }
|
|
64
68
|
static get encapsulation() { return "shadow"; }
|
|
@@ -198,6 +202,7 @@ export class PaymentForm {
|
|
|
198
202
|
static get states() {
|
|
199
203
|
return {
|
|
200
204
|
"submitButtonEnabled": {},
|
|
205
|
+
"isLoading": {},
|
|
201
206
|
"selectedPaymentMethodType": {},
|
|
202
207
|
"allowedPaymentMethodTypes": {}
|
|
203
208
|
};
|
|
@@ -278,3 +283,4 @@ export class PaymentForm {
|
|
|
278
283
|
}];
|
|
279
284
|
}
|
|
280
285
|
}
|
|
286
|
+
//# sourceMappingURL=payment-form.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-form.js","sourceRoot":"","sources":["../../../../src/components/payment-form/payment-form.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAgB,MAAM,eAAe,CAAC;AACrG,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAS/C,MAAM,OAAO,WAAW;;;;;;;;;+BASkB,IAAI;qBACd,KAAK;;qCAEwB,EAAE;;EAK7D,iBAAiB;IACf,IAAI,IAAI,CAAC,IAAI,EAAE;MACb,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAC9D;IACD,IAAI,IAAI,CAAC,WAAW,EAAE;MACpB,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,CAAC;KACrE;IACD,IAAI,CAAC,IAAI,CAAC,yBAAyB,CAAC,MAAM,EAAE;MAC1C,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;KAC9D;IACD,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,yBAAyB,CAAC,CAAC,CAAC,CAAC;EACrE,CAAC;EAGD,4BAA4B,CAAC,KAAkB;IAC7C,MAAM,iBAAiB,GAAuB,KAAK,CAAC,MAAM,CAAC;IAC3D,IAAI,CAAC,yBAAyB,GAAG,iBAAiB,CAAC;EACrD,CAAC;EAGD,KAAK,CAAC,eAAe,CAAC,MAAyB;IAC7C,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,MAAM,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listen, Method, Event, EventEmitter } from '@stencil/core';\nimport { PaymentMethodTypes } from '../../api';\nimport { BillingFormFields } from '../billing-form/billing-form-schema';\nimport { CreatePaymentMethodResponse } from '../payment-method-form/payment-method-responses';\n\n@Component({\n tag: 'justifi-payment-form',\n styleUrl: 'payment-form.scss',\n shadow: true,\n})\nexport class PaymentForm {\n @Prop() bankAccount?: boolean;\n @Prop() card?: boolean;\n @Prop() email?: string;\n @Prop() iframeOrigin?: string;\n @Prop() clientId: string;\n @Prop() accountId?: string;\n @Prop() submitButtonText?: string;\n @Event() submitted: EventEmitter<CreatePaymentMethodResponse>;\n @State() submitButtonEnabled: boolean = true;\n @State() isLoading: boolean = false;\n @State() selectedPaymentMethodType: PaymentMethodTypes;\n @State() allowedPaymentMethodTypes: PaymentMethodTypes[] = [];\n\n private paymentMethodFormRef?: HTMLJustifiPaymentMethodFormElement;\n private billingFormRef?: HTMLJustifiBillingFormElement;\n\n connectedCallback() {\n if (this.card) {\n this.allowedPaymentMethodTypes.push(PaymentMethodTypes.card);\n }\n if (this.bankAccount) {\n this.allowedPaymentMethodTypes.push(PaymentMethodTypes.bankAccount);\n }\n if (!this.allowedPaymentMethodTypes.length) {\n this.allowedPaymentMethodTypes.push(PaymentMethodTypes.card);\n }\n this.selectedPaymentMethodType = this.allowedPaymentMethodTypes[0];\n }\n\n @Listen('paymentMethodSelected')\n paymentMethodSelectedHandler(event: CustomEvent) {\n const paymentMethodType: PaymentMethodTypes = event.detail;\n this.selectedPaymentMethodType = paymentMethodType;\n }\n\n @Method()\n async fillBillingForm(fields: BillingFormFields) {\n this.billingFormRef.fill(fields);\n }\n\n @Method()\n async enableSubmitButton() {\n this.submitButtonEnabled = true;\n }\n\n async submit(event) {\n event.preventDefault();\n if (!this.paymentMethodFormRef || !this.billingFormRef) return;\n\n const billingFormValidation = await this.billingFormRef.validate();\n const paymentMethodFormValidation = await this.paymentMethodFormRef.validate();\n\n if (!billingFormValidation.isValid || !paymentMethodFormValidation.isValid) return;\n\n this.isLoading = true;\n\n const billingFormFieldValues = await this.billingFormRef.getValues();\n const paymentMethodData = { email: this.email, ...billingFormFieldValues };\n const tokenizeResponse = await this.paymentMethodFormRef.tokenize(this.clientId, paymentMethodData, this.accountId);\n\n this.submitted.emit(tokenizeResponse);\n this.isLoading = false;\n }\n\n render() {\n return (\n <Host>\n <form class=\"row gy-3\">\n {this.allowedPaymentMethodTypes.length > 1 && (\n <div class=\"col-12\">\n <justifi-payment-method-selector paymentMethodTypes={this.allowedPaymentMethodTypes} selectedPaymentMethodType={this.selectedPaymentMethodType} />\n </div>\n )}\n <div class=\"col-12\">\n <justifi-payment-method-form\n payment-method-form-type={this.selectedPaymentMethodType}\n iframe-origin={this.iframeOrigin}\n ref={el => {\n if (el) {\n this.paymentMethodFormRef = el;\n }\n }}\n />\n </div>\n <div class=\"col-12\">\n <justifi-billing-form\n legend=\"Billing Info\"\n ref={el => {\n if (el) {\n this.billingFormRef = el;\n }\n }}\n />\n </div>\n <div class=\"col-12\">\n <button\n type=\"submit\"\n onClick={event => this.submit(event)}\n disabled={!this.submitButtonEnabled || this.isLoading}\n class={`btn btn-primary jfi-submit-button${this.isLoading ? ' jfi-submit-button-loading' : ''}`}\n >\n {\n this.isLoading ?\n <div class=\"spinner-border spinner-border-sm\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div> :\n this.submitButtonText || 'Submit'\n }\n </button>\n </div>\n </form>\n </Host>\n );\n }\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"payment-form.stories.js","sourceRoot":"","sources":["../../../../src/components/payment-form/payment-form.stories.ts"],"names":[],"mappings":"AAAA,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,aAAa,CAAC;AAYrD,eAAe;EACb,KAAK,EAAE,wBAAwB;EAC/B,SAAS,EAAE,sBAAsB;EACjC,QAAQ,EAAE;IACR,eAAe,EAAE;MACf,OAAO,EAAE,MAAM;MACf,KAAK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Args {\n 'bank-account': boolean;\n 'card': boolean;\n 'email': string;\n 'client-id': string;\n 'account-id': string;\n 'submit-button-text': string;\n 'cssVariables': string;\n}\n\nexport default {\n title: 'Components/PaymentForm',\n component: 'justifi-payment-form',\n argTypes: {\n 'iframe-origin': {\n control: 'text',\n table: {\n disable: isDev ? false : true,\n category: 'props',\n },\n },\n },\n};\n\nconst Template = (args: PaymentFormStoryArgs) => {\n // The <div> here should be replaced by a `display` property in the cardForm potentially\n return `\n <div>\n <justifi-payment-form\n card=${args.card}\n bank-account='${args['bank-account']}'\n email='${args.email}'\n client-id='${args['client-id']}'\n account-id='${args['account-id']}'\n submit-button-text='${args['submit-button-text']}'\n iframe-origin='${args['iframe-origin']}'\n />\n </div>\n <style>\n :root {\n ${args.cssVariables}\n }\n </style>\n <script>\n (async () => {\n await customElements.whenDefined('justifi-payment-form');\n const paymentForm = document.querySelector('justifi-payment-form');\n paymentForm.addEventListener('submitted', async (event) => {\n // here is where you would submit a payment with the token\n console.log(event.detail);\n // after the payment succeeds or fails, the form submit button can be enabled again\n await paymentForm.enableSubmitButton();\n });\n })()\n </script>\n `;\n};\n\nexport const Basic = Template.bind({});\nBasic.args = {\n 'bank-account': true,\n 'card': true,\n 'email': '',\n 'client-id': '',\n 'account-id': '',\n 'submit-button-text': '',\n 'iframe-origin': '',\n};\n\nexport const Styled = Template.bind({});\nStyled.args = {\n 'bank-account': true,\n 'card': true,\n 'email': '',\n 'client-id': '',\n 'account-id': '',\n 'submit-button-text': '',\n 'iframe-origin': '',\n 'cssVariables': `\n --jfi-primary-color: #212529;\n\n --jfi-layout-padding: 0;\n --jfi-layout-form-control-spacing-x: .5rem;\n --jfi-layout-form-control-spacing-y: 1rem;\n --jfi-form-label-font-weight: 700;\n --jfi-form-label-font-family: sans-serif;\n --jfi-form-label-margin: 0 0 .5rem 0;\n --jfi-form-control-background-color: #F4F4F6;\n --jfi-form-control-background-color-hover: #EEEEF5;\n --jfi-form-control-border-color: rgba(0, 0, 0, 0.42);\n --jfi-form-control-border-color-hover: rgba(0, 0, 0, 0.62);\n --jfi-form-control-border-color-focus: #fccc32;\n --jfi-form-control-border-color-error: #C12727;\n --jfi-form-control-border-top-width: 0;\n --jfi-form-control-border-left-width: 0;\n --jfi-form-control-border-bottom-width: 1px;\n --jfi-form-control-border-right-width: 0;\n --jfi-form-control-border-radius: 4px 4px 0 0;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-box-shadow-focus: none;\n --jfi-form-control-box-shadow-error-focus: none;\n --jfi-form-control-border-style: solid;\n --jfi-form-control-color: #212529;\n --jfi-form-control-font-size: 1rem;\n --jfi-form-control-font-weight: 400;\n --jfi-form-control-line-height: 2;\n --jfi-form-control-margin: 0;\n --jfi-form-control-padding: .5rem .875rem;\n --jfi-error-message-color: #C12727;\n --jfi-error-message-margin: .25rem 0 0 0;\n --jfi-error-message-font-size: .875rem;\n\n --jfi-submit-button-color: white;\n --jfi-submit-button-background-color: #3F3F47;\n --jfi-submit-button-border-color: var(--jfi-primary-color);\n --jfi-submit-button-padding: 0.375rem 0.75rem;\n --jfi-submit-button-font-size: 1rem;\n --jfi-submit-button-border-radius: 1px;\n --jfi-submit-button-color-hover: white;\n --jfi-submit-button-background-color-hover: var(--jfi-primary-color);\n --jfi-submit-button-border-color-hover: var(--jfi-primary-color);\n --jfi-submit-button-color-focus: white;\n --jfi-submit-button-background-color-focus: var(--jfi-primary-color);\n --jfi-submit-button-border-color-focus: var(--jfi-primary-color);\n --jfi-submit-button-color-active: white;\n --jfi-submit-button-background-color-active: var(--jfi-primary-color);\n --jfi-submit-button-border-color-active: var(--jfi-primary-color);\n --jfi-submit-button-width: 100%;\n --jfi-submit-button-box-shadow: rgba(0, 0, 0, 0.2) 0px 3px 1px -2px, rgba(0, 0, 0, 0.14) 0px 2px 2px 0px, rgba(0, 0, 0, 0.12) 0px 1px 5px 0px;\n\n --jfi-radio-button-color: var(--jfi-primary-color);\n --jfi-radio-button-background-color: transparent;\n --jfi-radio-button-color-selected: white;\n --jfi-radio-button-background-color-selected: var(--jfi-primary-color);\n --jfi-radio-button-border-color: var(--jfi-primary-color);\n --jfi-radio-button-border-color-selected: var(--jfi-primary-color);\n --jfi-radio-button-padding: 0.375rem 0.75rem;\n --jfi-radio-button-font-size: 1rem;\n --jfi-radio-button-color-hover: var(--jfi-primary-color);\n --jfi-radio-button-color-selected-hover: white;\n --jfi-radio-button-background-color-hover: transparent;\n --jfi-radio-button-background-color-selected-hover: var(--jfi-primary-color);\n --jfi-radio-button-border-color-selected-hover: var(--jfi-primary-color);\n --jfi-radio-button-border-color-hover: var(--jfi-primary-color);\n --jfi-radio-button-group-width: 100%;\n `,\n};\n"]}
|