@paynext/sdk 0.0.2 → 0.0.3
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/dist/assets/index.css +1 -1
- package/dist/index.es.js +43 -42
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +6 -6
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
package/dist/assets/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._button_159xd_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;gap:.5rem;overflow:hidden;white-space:nowrap;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_159xd_1{transition-property:none}}._button_159xd_1>svg{max-width:2rem}._primary_159xd_11{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}._success_159xd_15{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}._loading_159xd_19,._button_159xd_1:hover{opacity:.7}._press_159xd_24{transform:scale(.95)}._card_1woqz_1{display:grid;gap:.75rem;padding-top:1rem}._title_1woqz_5{font-size:.875rem;line-height:1.25rem;font-weight:600}._error_1woqz_9{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_1woqz_13{display:flex;width:100%;justify-content:space-between}._label_1woqz_13 span{text-wrap:nowrap;text-overflow:ellipsis;overflow:hidden}._cardDataContainer_1woqz_23{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}._iconContainer_1woqz_27{margin:0 1px}._payButton_1woqz_31{display:flex;align-items:center;justify-content:center}._spinner_1woqz_35{width:24px;height:24px}._inputContainer_1eto7_1{background-color:transparent;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;padding-right:.75rem}._inputContainer_1eto7_1::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1eto7_1::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1eto7_1{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){._inputContainer_1eto7_1{font-size:.875rem;line-height:1.25rem}}._inputFocus_1eto7_6,._inputContainer_1eto7_1:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._input_1eto7_1{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_1eto7_16{display:flex}._errorInput_1eto7_20{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_1eto7_20:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_1eto7_20:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_1eto7_20{margin-top:.25rem;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_1eto7_28{margin-bottom:2px;display:flex;align-items:center;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_1eto7_32{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._cvcIcon_1yx89_1{width:100%;height:100%}._iconContainer_1nckj_1{margin:0 1px}.
|
|
1
|
+
._button_159xd_1{transition-property:transform,color,background,background-color,border-color,text-decoration-color,fill,stroke,opacity;transition-timing-function:ease;transition-duration:.25s;position:relative;z-index:0;box-sizing:border-box;display:inline-flex;height:2.5rem;width:100%;min-width:5rem;transform:translate3d(var(--tw-translate-x),var(--tw-translate-y),0) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));-webkit-user-select:none;-moz-user-select:none;user-select:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;align-items:center;justify-content:center;gap:.5rem;overflow:hidden;white-space:nowrap;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1));padding-left:1rem;padding-right:1rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1));-webkit-font-smoothing:auto;-moz-osx-font-smoothing:auto;outline:2px solid transparent;outline-offset:2px}@media (prefers-reduced-motion: reduce){._button_159xd_1{transition-property:none}}._button_159xd_1>svg{max-width:2rem}._primary_159xd_11{--tw-bg-opacity: 1;background-color:rgb(59 130 246 / var(--tw-bg-opacity, 1))}._success_159xd_15{--tw-bg-opacity: 1;background-color:rgb(22 163 74 / var(--tw-bg-opacity, 1))}._loading_159xd_19,._button_159xd_1:hover{opacity:.7}._press_159xd_24{transform:scale(.95)}._card_1woqz_1{display:grid;gap:.75rem;padding-top:1rem}._title_1woqz_5{font-size:.875rem;line-height:1.25rem;font-weight:600}._error_1woqz_9{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_1woqz_13{display:flex;width:100%;justify-content:space-between}._label_1woqz_13 span{text-wrap:nowrap;text-overflow:ellipsis;overflow:hidden}._cardDataContainer_1woqz_23{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.5rem}._iconContainer_1woqz_27{margin:0 1px}._payButton_1woqz_31{display:flex;align-items:center;justify-content:center}._spinner_1woqz_35{width:24px;height:24px}._inputContainer_1eto7_1{background-color:transparent;display:flex;height:40px;width:100%;cursor:text;align-items:center;justify-content:space-between;border-radius:.75rem;border-width:1px;--tw-border-opacity: 1;border-color:rgb(209 213 219 / var(--tw-border-opacity, 1));padding-left:.75rem;padding-right:.75rem}._inputContainer_1eto7_1::-moz-placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1eto7_1::placeholder{--tw-placeholder-opacity: 1;color:rgb(156 163 175 / var(--tw-placeholder-opacity, 1))}._inputContainer_1eto7_1{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}@media (min-width: 640px){._inputContainer_1eto7_1{font-size:.875rem;line-height:1.25rem}}._inputFocus_1eto7_6,._inputContainer_1eto7_1:hover{--tw-border-opacity: 1;border-color:rgb(107 114 128 / var(--tw-border-opacity, 1))}._input_1eto7_1{background-color:transparent;display:block;height:100%;width:100%;border-style:none;font-size:1rem;font-weight:400;outline:2px solid transparent;outline-offset:2px}._endContent_1eto7_16{display:flex}._errorInput_1eto7_20{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._errorInput_1eto7_20:hover{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._errorInput_1eto7_20:focus{--tw-border-opacity: 1;border-color:rgb(220 38 38 / var(--tw-border-opacity, 1));--tw-ring-opacity: 1;--tw-ring-color: rgb(220 38 38 / var(--tw-ring-opacity, 1))}._error_1eto7_20{margin-top:.25rem;padding-left:.25rem;font-size:.75rem;line-height:1rem;font-weight:400;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._label_1eto7_28{margin-bottom:2px;display:flex;align-items:center;justify-content:space-between;padding-left:1px;padding-right:.5rem;font-size:.75rem;line-height:1rem;font-weight:400}._labelError_1eto7_32{font-size:.6875rem;--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}._cvcIcon_1yx89_1{width:100%;height:100%}._iconContainer_1nckj_1{margin:0 1px}._container_1ari8_1{display:flex;width:100%;flex-grow:1;flex-direction:row;align-items:center;justify-content:flex-start;-moz-column-gap:.25rem;column-gap:.25rem;border-radius:.375rem;--tw-bg-opacity: 1;background-color:rgb(254 231 239 / var(--tw-bg-opacity, 1));padding:.75rem 1rem}._container_1ari8_1:is(._dark_1ari8_1 *){background-color:#fee7ef80;--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}._iconContainer_1ari8_5{width:16px;height:16px}._icon_1ari8_5{width:100%;height:100%}._title_1ari8_15{padding-left:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:300}._svg_1kkac_1{height:100%;width:100%}@keyframes _spin_1kkac_1{to{transform:rotate(360deg)}}._svg_1kkac_1{animation:_spin_1kkac_1 1s linear infinite;fill:#9ca3af;--tw-text-opacity: 1;color:rgb(229 231 235 / var(--tw-text-opacity, 1))}._svg_1kkac_1:is(._dark_1kkac_1 *){--tw-text-opacity: 1;color:rgb(75 85 99 / var(--tw-text-opacity, 1))}._sr_1kkac_5{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}._googlePay_1a960_1{border-radius:12px;height:40px;overflow:hidden;background-color:transparent}._googlePay_1a960_1 iframe{width:calc(100% + 12px)!important;height:44px!important;border:none;display:block;transform:translateY(-2px);margin:0 -6px}._hidden_1a960_17{display:none}._applePay_2b2iv_1{border-radius:12px;height:40px;overflow:hidden;background-color:transparent}._applePay_2b2iv_1 iframe{width:calc(100% + 12px)!important;height:44px!important;border:none;display:block;transform:translateY(-2px);margin:0 -6px}._hidden_2b2iv_17{display:none}._container_a64yo_1{position:relative;height:auto;min-height:40px;width:100%;max-width:640px}._backBtn_a64yo_5{cursor:pointer}._cardBtn_a64yo_9{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}._btnContainer_a64yo_13{display:grid;gap:.5rem}._spinner_a64yo_17{height:40px;width:40px}._spinnerContainer_a64yo_21{position:absolute;z-index:50;display:flex;height:auto;width:100%;align-items:center;justify-content:center;border-radius:.375rem}._paypalBtn_2m8yd_1{overflow:hidden;border-radius:12px;height:40px}._container_ipway_1{display:flex;width:100%;flex-direction:column;align-items:center;justify-content:center}._icon_ipway_5{position:absolute;top:50%;left:50%;width:1.5rem;--tw-translate-x: -50%;--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));fill:#16a34a}._iconContainer_ipway_9{position:relative;display:grid;height:2.25rem;width:2.25rem;flex:none;place-items:center;border-radius:9999px;--tw-bg-opacity: 1;background-color:rgb(232 250 240 / var(--tw-bg-opacity, 1))}._iconContainer_ipway_9:is(._dark_ipway_1 *){--tw-bg-opacity: 1;background-color:rgb(209 244 224 / var(--tw-bg-opacity, 1))}._title_ipway_13{margin-top:.5rem;font-weight:300}
|
package/dist/index.es.js
CHANGED
|
@@ -326,12 +326,12 @@ const Po = async (e) => {
|
|
|
326
326
|
async (d) => {
|
|
327
327
|
try {
|
|
328
328
|
s(!1), o(!1), r(!0);
|
|
329
|
-
const {
|
|
330
|
-
if (p)
|
|
329
|
+
const { error: p } = await Po(d);
|
|
330
|
+
if (!p)
|
|
331
331
|
s(!0), e?.();
|
|
332
332
|
else {
|
|
333
|
-
const
|
|
334
|
-
o(!0), t?.(
|
|
333
|
+
const f = new Error(p || "Unknown error");
|
|
334
|
+
o(!0), t?.(f);
|
|
335
335
|
}
|
|
336
336
|
} catch (p) {
|
|
337
337
|
console.error(p), o(!0), t?.(new Error("Unknown error"));
|
|
@@ -7427,34 +7427,35 @@ const kh = (e, t) => Ar(e) ? new wh(t) : new Ch(t, {
|
|
|
7427
7427
|
}, nn = ({
|
|
7428
7428
|
label: e,
|
|
7429
7429
|
error: t,
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
|
|
7430
|
+
disabled: n,
|
|
7431
|
+
labelError: r,
|
|
7432
|
+
endContent: i,
|
|
7433
|
+
styles: s,
|
|
7434
|
+
onFocus: a,
|
|
7435
|
+
onBlur: o,
|
|
7436
|
+
...l
|
|
7436
7437
|
}) => {
|
|
7437
|
-
const
|
|
7438
|
-
(
|
|
7439
|
-
|
|
7440
|
-
},
|
|
7441
|
-
[s]
|
|
7442
|
-
), m = D(
|
|
7443
|
-
(v) => {
|
|
7444
|
-
c(!1), a?.(v);
|
|
7438
|
+
const u = se(null), [c, d] = j(!1), p = t || r, f = D(() => u.current?.focus(), []), m = D(
|
|
7439
|
+
(y) => {
|
|
7440
|
+
d(!0), a?.(y);
|
|
7445
7441
|
},
|
|
7446
7442
|
[a]
|
|
7447
|
-
), g =
|
|
7443
|
+
), g = D(
|
|
7444
|
+
(y) => {
|
|
7445
|
+
d(!1), o?.(y);
|
|
7446
|
+
},
|
|
7447
|
+
[o]
|
|
7448
|
+
), v = !p && !n && c && (s?.container?.focus || me.inputFocus);
|
|
7448
7449
|
return /* @__PURE__ */ h.jsxs("div", { children: [
|
|
7449
7450
|
e && /* @__PURE__ */ h.jsxs(
|
|
7450
7451
|
"label",
|
|
7451
7452
|
{
|
|
7452
|
-
htmlFor:
|
|
7453
|
-
className: ke(me.label,
|
|
7454
|
-
style:
|
|
7453
|
+
htmlFor: l.id,
|
|
7454
|
+
className: ke(me.label, s?.label?.className),
|
|
7455
|
+
style: s?.label?.styles,
|
|
7455
7456
|
children: [
|
|
7456
7457
|
/* @__PURE__ */ h.jsx("span", { className: me.label, children: e }, e),
|
|
7457
|
-
/* @__PURE__ */ h.jsx(hi, { mode: "wait", children: n && /* @__PURE__ */ h.jsx(
|
|
7458
|
+
/* @__PURE__ */ h.jsx(hi, { mode: "wait", children: r && !n && /* @__PURE__ */ h.jsx(
|
|
7458
7459
|
mt.span,
|
|
7459
7460
|
{
|
|
7460
7461
|
initial: Ot.initial,
|
|
@@ -7462,7 +7463,7 @@ const kh = (e, t) => Ar(e) ? new wh(t) : new Ch(t, {
|
|
|
7462
7463
|
exit: Ot.exit,
|
|
7463
7464
|
transition: Ot.transition,
|
|
7464
7465
|
className: me.labelError,
|
|
7465
|
-
children:
|
|
7466
|
+
children: r
|
|
7466
7467
|
},
|
|
7467
7468
|
t
|
|
7468
7469
|
) })
|
|
@@ -7474,37 +7475,37 @@ const kh = (e, t) => Ar(e) ? new wh(t) : new Ch(t, {
|
|
|
7474
7475
|
{
|
|
7475
7476
|
className: ke(
|
|
7476
7477
|
me.inputContainer,
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7478
|
+
p && me.errorInput,
|
|
7479
|
+
v,
|
|
7480
|
+
s?.container?.className
|
|
7480
7481
|
),
|
|
7481
|
-
style:
|
|
7482
|
-
onClick:
|
|
7482
|
+
style: s?.container?.styles,
|
|
7483
|
+
onClick: f,
|
|
7483
7484
|
children: [
|
|
7484
7485
|
/* @__PURE__ */ h.jsx(
|
|
7485
7486
|
"input",
|
|
7486
7487
|
{
|
|
7487
|
-
...
|
|
7488
|
-
ref:
|
|
7489
|
-
onFocus:
|
|
7490
|
-
onBlur:
|
|
7491
|
-
style:
|
|
7492
|
-
className: ke(me.input,
|
|
7488
|
+
...l,
|
|
7489
|
+
ref: u,
|
|
7490
|
+
onFocus: m,
|
|
7491
|
+
onBlur: g,
|
|
7492
|
+
style: s?.field?.styles,
|
|
7493
|
+
className: ke(me.input, l.className, s?.field?.className)
|
|
7493
7494
|
}
|
|
7494
7495
|
),
|
|
7495
|
-
|
|
7496
|
+
i && /* @__PURE__ */ h.jsx("div", { className: me.endContent, children: i })
|
|
7496
7497
|
]
|
|
7497
7498
|
}
|
|
7498
7499
|
),
|
|
7499
|
-
/* @__PURE__ */ h.jsx(hi, { mode: "wait", children: t && /* @__PURE__ */ h.jsx(
|
|
7500
|
+
/* @__PURE__ */ h.jsx(hi, { mode: "wait", children: t && !n && /* @__PURE__ */ h.jsx(
|
|
7500
7501
|
mt.div,
|
|
7501
7502
|
{
|
|
7502
7503
|
initial: Nt.initial,
|
|
7503
7504
|
animate: Nt.animate,
|
|
7504
7505
|
exit: Nt.exit,
|
|
7505
7506
|
transition: Nt.transition,
|
|
7506
|
-
className: ke(me.error,
|
|
7507
|
-
style:
|
|
7507
|
+
className: ke(me.error, s?.error?.className),
|
|
7508
|
+
style: s?.error?.styles,
|
|
7508
7509
|
children: t
|
|
7509
7510
|
}
|
|
7510
7511
|
) })
|
|
@@ -8116,7 +8117,7 @@ const Vr = [
|
|
|
8116
8117
|
}, y1 = ({
|
|
8117
8118
|
cardTypes: e,
|
|
8118
8119
|
supportedCardTypes: t
|
|
8119
|
-
}) => e.filter((n) => t.includes(n)).slice(0,
|
|
8120
|
+
}) => e.filter((n) => t.includes(n)).slice(0, 3).map((n) => {
|
|
8120
8121
|
switch (n) {
|
|
8121
8122
|
case Z.Visa:
|
|
8122
8123
|
return /* @__PURE__ */ h.jsx("span", { className: Te.iconContainer, children: /* @__PURE__ */ h.jsx(Nh, {}) }, n);
|
|
@@ -8174,7 +8175,7 @@ const Vr = [
|
|
|
8174
8175
|
endContent: x ? /* @__PURE__ */ h.jsx(r1, {}) : /* @__PURE__ */ h.jsx(y1, { cardTypes: l, supportedCardTypes: i || [] })
|
|
8175
8176
|
}
|
|
8176
8177
|
);
|
|
8177
|
-
}, b1 = "
|
|
8178
|
+
}, b1 = "_container_1ari8_1", x1 = "_iconContainer_1ari8_5", C1 = "_icon_1ari8_5", T1 = "_title_1ari8_15", Bt = {
|
|
8178
8179
|
container: b1,
|
|
8179
8180
|
iconContainer: x1,
|
|
8180
8181
|
icon: C1,
|
|
@@ -8966,7 +8967,7 @@ const gp = "_paypalBtn_2m8yd_1", yp = {
|
|
|
8966
8967
|
d(!0);
|
|
8967
8968
|
}, []), k = D(async () => {
|
|
8968
8969
|
const V = await Ao(r);
|
|
8969
|
-
if (
|
|
8970
|
+
if (V.error) {
|
|
8970
8971
|
const U = V.error || "Paypal request failed";
|
|
8971
8972
|
throw e(U), U;
|
|
8972
8973
|
}
|