@burdenoff/microfe-kadaikodi 2026.719.2 → 2026.719.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/kadaikodi/hooks/useKadaikodiApi.d.ts +36 -0
- package/dist/kadaikodi/hooks/useKadaikodiApi.d.ts.map +1 -1
- package/dist/kadaikodi/hooks/useKadaikodiApi.js +130 -18
- package/dist/kadaikodi/hooks/useKadaikodiApi.js.map +1 -1
- package/dist/kadaikodi/pages/customer/CheckoutPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/CheckoutPage.js +235 -219
- package/dist/kadaikodi/pages/customer/CheckoutPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.d.ts +4 -0
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js +209 -192
- package/dist/kadaikodi/pages/customer/PaymentMethodsPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.d.ts +3 -1
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js +195 -173
- package/dist/kadaikodi/pages/customer/SavedAddressesPage.js.map +1 -1
- package/dist/kadaikodi/pages/customer/shared.d.ts +1 -2
- package/dist/kadaikodi/pages/customer/shared.d.ts.map +1 -1
- package/dist/kadaikodi/pages/customer/shared.js +15 -37
- package/dist/kadaikodi/pages/customer/shared.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,263 +1,280 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { useState as
|
|
6
|
-
import { Banknote as
|
|
7
|
-
import { jsx as
|
|
8
|
-
import { EmphasisPanel as
|
|
1
|
+
import { cn as e } from "../../utils/cn.js";
|
|
2
|
+
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
+
import { EmptyState as n } from "../../components/EmptyState.js";
|
|
4
|
+
import { useAddPaymentMethod as r, useMyPaymentMethods as i, useRemovePaymentMethod as a, useSetDefaultPaymentMethod as o } from "../../hooks/useKadaikodiApi.js";
|
|
5
|
+
import { useState as s } from "react";
|
|
6
|
+
import { Banknote as c, CheckCircle2 as l, CreditCard as u, Loader2 as d, Plus as f, Shield as p, ShoppingCart as m, Smartphone as h, Trash2 as g, Wallet as _, X as v } from "lucide-react";
|
|
7
|
+
import { jsx as y, jsxs as b } from "react/jsx-runtime";
|
|
8
|
+
import { EmphasisPanel as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
|
|
9
9
|
//#region src/kadaikodi/pages/customer/PaymentMethodsPage.tsx
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
var C = {
|
|
11
|
+
UPI: h,
|
|
12
|
+
CARD: u,
|
|
13
|
+
WALLET: _
|
|
14
|
+
};
|
|
15
|
+
function w({ method: t, onRemove: n, onSetDefault: r }) {
|
|
16
|
+
let i = C[t.type];
|
|
17
|
+
return /* @__PURE__ */ b("div", {
|
|
18
|
+
className: e("flex items-center gap-4 rounded-lg border p-4", t.isDefault ? "border-foreground/30 bg-accent/50" : "border-border-subtle bg-bg-surface"),
|
|
14
19
|
children: [
|
|
15
|
-
/* @__PURE__ */
|
|
20
|
+
/* @__PURE__ */ y("div", {
|
|
16
21
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
|
|
17
|
-
children: /* @__PURE__ */
|
|
22
|
+
children: /* @__PURE__ */ y(i, { className: "h-5 w-5 text-text-secondary" })
|
|
18
23
|
}),
|
|
19
|
-
/* @__PURE__ */
|
|
24
|
+
/* @__PURE__ */ b("div", {
|
|
20
25
|
className: "flex-1 min-w-0",
|
|
21
|
-
children: [/* @__PURE__ */
|
|
26
|
+
children: [/* @__PURE__ */ b("div", {
|
|
22
27
|
className: "flex items-center gap-2",
|
|
23
|
-
children: [/* @__PURE__ */
|
|
28
|
+
children: [/* @__PURE__ */ y("p", {
|
|
24
29
|
className: "text-sm font-medium text-text-primary",
|
|
25
|
-
children:
|
|
26
|
-
}),
|
|
30
|
+
children: t.label
|
|
31
|
+
}), t.isDefault && /* @__PURE__ */ b("span", {
|
|
27
32
|
className: "inline-flex items-center gap-1 rounded-full bg-status-success-bg-subtle px-2 py-0.5 text-[10px] font-medium text-status-success-text",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
33
|
+
children: [/* @__PURE__ */ y(l, { className: "h-3 w-3" }), "Default"]
|
|
29
34
|
})]
|
|
30
|
-
}), /* @__PURE__ */
|
|
35
|
+
}), /* @__PURE__ */ y("p", {
|
|
31
36
|
className: "mt-0.5 text-xs text-text-secondary font-mono",
|
|
32
|
-
children:
|
|
37
|
+
children: t.detail
|
|
33
38
|
})]
|
|
34
39
|
}),
|
|
35
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ b("div", {
|
|
36
41
|
className: "flex items-center gap-1",
|
|
37
|
-
children: [!
|
|
42
|
+
children: [!t.isDefault && /* @__PURE__ */ y("button", {
|
|
38
43
|
type: "button",
|
|
39
|
-
onClick: () => r(
|
|
44
|
+
onClick: () => r(t.id),
|
|
40
45
|
title: "Set as default",
|
|
41
46
|
className: "rounded-md px-2 py-1 text-xs text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
|
|
42
47
|
children: "Set Default"
|
|
43
|
-
}), /* @__PURE__ */
|
|
48
|
+
}), /* @__PURE__ */ y("button", {
|
|
44
49
|
type: "button",
|
|
45
|
-
onClick: () => n(
|
|
50
|
+
onClick: () => n(t.id),
|
|
46
51
|
title: "Remove payment method",
|
|
47
52
|
className: "rounded-md p-2 text-text-secondary hover:bg-status-error-bg/10 hover:text-status-error-text transition-colors",
|
|
48
|
-
children: /* @__PURE__ */
|
|
53
|
+
children: /* @__PURE__ */ y(g, { className: "h-4 w-4" })
|
|
49
54
|
})]
|
|
50
55
|
})
|
|
51
56
|
]
|
|
52
57
|
});
|
|
53
58
|
}
|
|
54
|
-
function
|
|
55
|
-
let {
|
|
59
|
+
function T() {
|
|
60
|
+
let { data: g = [], isLoading: C } = i(), T = r(), E = a(), D = o(), [O, k] = s(!1), [A, j] = s("card"), [M, N] = s(null), [P, F] = s({
|
|
56
61
|
cardNumber: "",
|
|
57
62
|
expiry: "",
|
|
58
63
|
cvv: "",
|
|
59
64
|
nameOnCard: ""
|
|
60
|
-
}), [
|
|
65
|
+
}), [I, L] = s({ upiId: "" }), [R, z] = s({
|
|
61
66
|
walletProvider: "Paytm",
|
|
62
67
|
mobile: ""
|
|
63
|
-
}),
|
|
64
|
-
|
|
65
|
-
},
|
|
66
|
-
|
|
68
|
+
}), B = (e) => {
|
|
69
|
+
N(e), setTimeout(() => N(null), 3e3);
|
|
70
|
+
}, V = () => {
|
|
71
|
+
F({
|
|
67
72
|
cardNumber: "",
|
|
68
73
|
expiry: "",
|
|
69
74
|
cvv: "",
|
|
70
75
|
nameOnCard: ""
|
|
71
|
-
}),
|
|
76
|
+
}), L({ upiId: "" }), z({
|
|
72
77
|
walletProvider: "Paytm",
|
|
73
78
|
mobile: ""
|
|
74
|
-
}),
|
|
75
|
-
},
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
79
|
+
}), j("card");
|
|
80
|
+
}, H = async (e) => {
|
|
81
|
+
try {
|
|
82
|
+
await E.mutateAsync(e), B("Payment method removed");
|
|
83
|
+
} catch {
|
|
84
|
+
alert("Failed to remove payment method. Please try again.");
|
|
85
|
+
}
|
|
86
|
+
}, U = async (e) => {
|
|
87
|
+
try {
|
|
88
|
+
await D.mutateAsync(e), B("Default payment method updated");
|
|
89
|
+
} catch {
|
|
90
|
+
alert("Failed to set default payment method. Please try again.");
|
|
91
|
+
}
|
|
92
|
+
}, W = async () => {
|
|
93
|
+
let e = "", t = "", n = "CARD";
|
|
94
|
+
if (A === "card") {
|
|
95
|
+
if (!P.cardNumber.trim() || !P.expiry.trim() || !P.cvv.trim() || !P.nameOnCard.trim()) {
|
|
86
96
|
alert("Please fill in all card fields.");
|
|
87
97
|
return;
|
|
88
98
|
}
|
|
89
|
-
e = `${
|
|
90
|
-
} else if (
|
|
91
|
-
if (!
|
|
99
|
+
e = `${P.nameOnCard}'s Card`, t = `**** **** **** ${P.cardNumber.slice(-4)}`, n = "CARD";
|
|
100
|
+
} else if (A === "upi") {
|
|
101
|
+
if (!I.upiId.trim()) {
|
|
92
102
|
alert("Please enter a UPI ID.");
|
|
93
103
|
return;
|
|
94
104
|
}
|
|
95
|
-
e = "UPI", t =
|
|
105
|
+
e = "UPI", t = I.upiId, n = "UPI";
|
|
96
106
|
} else {
|
|
97
|
-
if (!
|
|
107
|
+
if (!R.mobile.trim()) {
|
|
98
108
|
alert("Please enter mobile number.");
|
|
99
109
|
return;
|
|
100
110
|
}
|
|
101
|
-
e =
|
|
111
|
+
e = R.walletProvider, t = `Mobile: ${R.mobile}`, n = "WALLET";
|
|
112
|
+
}
|
|
113
|
+
try {
|
|
114
|
+
await T.mutateAsync({
|
|
115
|
+
type: n,
|
|
116
|
+
label: e,
|
|
117
|
+
detail: t
|
|
118
|
+
}), V(), k(!1), B("Payment method added successfully");
|
|
119
|
+
} catch {
|
|
120
|
+
alert("Failed to save payment method. Please try again.");
|
|
102
121
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
detail: t,
|
|
108
|
-
icon: n,
|
|
109
|
-
isDefault: !1
|
|
110
|
-
};
|
|
111
|
-
x((e) => [...e, r]), F(), C(!1), P("Payment method added successfully");
|
|
112
|
-
}, z = {
|
|
113
|
-
upi: b.filter((e) => e.type === "upi"),
|
|
114
|
-
card: b.filter((e) => e.type === "card"),
|
|
115
|
-
wallet: b.filter((e) => e.type === "wallet")
|
|
122
|
+
}, G = {
|
|
123
|
+
upi: g.filter((e) => e.type === "UPI"),
|
|
124
|
+
card: g.filter((e) => e.type === "CARD"),
|
|
125
|
+
wallet: g.filter((e) => e.type === "WALLET")
|
|
116
126
|
};
|
|
117
|
-
return /* @__PURE__ */
|
|
127
|
+
return C ? /* @__PURE__ */ y(t, {
|
|
128
|
+
title: "Payment Methods",
|
|
129
|
+
description: "Manage your saved payment options",
|
|
130
|
+
children: /* @__PURE__ */ y("div", {
|
|
131
|
+
className: "flex h-40 items-center justify-center",
|
|
132
|
+
children: /* @__PURE__ */ y(d, { className: "h-6 w-6 animate-spin text-text-secondary" })
|
|
133
|
+
})
|
|
134
|
+
}) : /* @__PURE__ */ b(t, {
|
|
118
135
|
title: "Payment Methods",
|
|
119
136
|
description: "Manage your saved payment options",
|
|
120
|
-
actions: /* @__PURE__ */
|
|
137
|
+
actions: /* @__PURE__ */ b("button", {
|
|
121
138
|
type: "button",
|
|
122
|
-
onClick: () =>
|
|
123
|
-
className:
|
|
124
|
-
children: [/* @__PURE__ */
|
|
139
|
+
onClick: () => k(!0),
|
|
140
|
+
className: e("flex items-center gap-2 rounded-lg px-4 py-2 text-sm font-medium transition-opacity", "bg-foreground text-background hover:opacity-90"),
|
|
141
|
+
children: [/* @__PURE__ */ y(f, { className: "h-4 w-4" }), "Add Method"]
|
|
125
142
|
}),
|
|
126
143
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
144
|
+
/* @__PURE__ */ y(S, {
|
|
128
145
|
className: "mb-6",
|
|
129
146
|
children: "Keep your cards and UPI handles ready so paying at checkout is instant and secure. Set a default method to skip a step every time you order — you can add or remove options here whenever you like."
|
|
130
147
|
}),
|
|
131
|
-
|
|
148
|
+
g.length > 0 && /* @__PURE__ */ y(x, {
|
|
132
149
|
className: "mb-6",
|
|
133
|
-
children: /* @__PURE__ */
|
|
150
|
+
children: /* @__PURE__ */ b("div", {
|
|
134
151
|
className: "flex items-center gap-2 text-sm text-text-secondary",
|
|
135
|
-
children: [/* @__PURE__ */
|
|
136
|
-
|
|
152
|
+
children: [/* @__PURE__ */ y(u, { className: "h-4 w-4" }), /* @__PURE__ */ b("span", { children: [
|
|
153
|
+
g.length,
|
|
137
154
|
" saved ",
|
|
138
|
-
|
|
139
|
-
|
|
155
|
+
g.length === 1 ? "method" : "methods",
|
|
156
|
+
g.some((e) => e.isDefault) ? " · a default is set for one-tap checkout" : " · set a default for faster checkout"
|
|
140
157
|
] })]
|
|
141
158
|
})
|
|
142
159
|
}),
|
|
143
|
-
|
|
160
|
+
M && /* @__PURE__ */ b("div", {
|
|
144
161
|
className: "mb-4 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle p-3 flex items-center gap-2",
|
|
145
|
-
children: [/* @__PURE__ */
|
|
162
|
+
children: [/* @__PURE__ */ y(l, { className: "h-4 w-4 text-status-success-text shrink-0" }), /* @__PURE__ */ y("p", {
|
|
146
163
|
className: "text-sm text-status-success-text",
|
|
147
|
-
children:
|
|
164
|
+
children: M
|
|
148
165
|
})]
|
|
149
166
|
}),
|
|
150
|
-
|
|
167
|
+
g.length > 0 ? /* @__PURE__ */ b("div", {
|
|
151
168
|
className: "space-y-6",
|
|
152
169
|
children: [
|
|
153
|
-
|
|
170
|
+
G.upi.length > 0 && /* @__PURE__ */ b("section", { children: [/* @__PURE__ */ b("h3", {
|
|
154
171
|
className: "text-sm font-semibold text-text-primary mb-3 flex items-center gap-2",
|
|
155
|
-
children: [/* @__PURE__ */ h
|
|
156
|
-
}), /* @__PURE__ */
|
|
172
|
+
children: [/* @__PURE__ */ y(h, { className: "h-4 w-4 text-text-secondary" }), "UPI"]
|
|
173
|
+
}), /* @__PURE__ */ y("div", {
|
|
157
174
|
className: "space-y-2",
|
|
158
|
-
children:
|
|
175
|
+
children: G.upi.map((e) => /* @__PURE__ */ y(w, {
|
|
159
176
|
method: e,
|
|
160
|
-
onRemove:
|
|
161
|
-
onSetDefault:
|
|
177
|
+
onRemove: H,
|
|
178
|
+
onSetDefault: U
|
|
162
179
|
}, e.id))
|
|
163
180
|
})] }),
|
|
164
|
-
|
|
181
|
+
G.card.length > 0 && /* @__PURE__ */ b("section", { children: [/* @__PURE__ */ b("h3", {
|
|
165
182
|
className: "text-sm font-semibold text-text-primary mb-3 flex items-center gap-2",
|
|
166
|
-
children: [/* @__PURE__ */
|
|
167
|
-
}), /* @__PURE__ */
|
|
183
|
+
children: [/* @__PURE__ */ y(u, { className: "h-4 w-4 text-text-secondary" }), "Cards"]
|
|
184
|
+
}), /* @__PURE__ */ y("div", {
|
|
168
185
|
className: "space-y-2",
|
|
169
|
-
children:
|
|
186
|
+
children: G.card.map((e) => /* @__PURE__ */ y(w, {
|
|
170
187
|
method: e,
|
|
171
|
-
onRemove:
|
|
172
|
-
onSetDefault:
|
|
188
|
+
onRemove: H,
|
|
189
|
+
onSetDefault: U
|
|
173
190
|
}, e.id))
|
|
174
191
|
})] }),
|
|
175
|
-
|
|
192
|
+
G.wallet.length > 0 && /* @__PURE__ */ b("section", { children: [/* @__PURE__ */ b("h3", {
|
|
176
193
|
className: "text-sm font-semibold text-text-primary mb-3 flex items-center gap-2",
|
|
177
|
-
children: [/* @__PURE__ */
|
|
178
|
-
}), /* @__PURE__ */
|
|
194
|
+
children: [/* @__PURE__ */ y(_, { className: "h-4 w-4 text-text-secondary" }), "Wallets"]
|
|
195
|
+
}), /* @__PURE__ */ y("div", {
|
|
179
196
|
className: "space-y-2",
|
|
180
|
-
children:
|
|
197
|
+
children: G.wallet.map((e) => /* @__PURE__ */ y(w, {
|
|
181
198
|
method: e,
|
|
182
|
-
onRemove:
|
|
183
|
-
onSetDefault:
|
|
199
|
+
onRemove: H,
|
|
200
|
+
onSetDefault: U
|
|
184
201
|
}, e.id))
|
|
185
202
|
})] }),
|
|
186
|
-
/* @__PURE__ */
|
|
203
|
+
/* @__PURE__ */ b("div", {
|
|
187
204
|
className: "flex items-start gap-3 rounded-lg border border-border-subtle bg-bg-surface p-4",
|
|
188
|
-
children: [/* @__PURE__ */
|
|
205
|
+
children: [/* @__PURE__ */ y(p, { className: "mt-0.5 h-5 w-5 shrink-0 text-text-secondary" }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
189
206
|
className: "text-sm font-medium text-text-primary",
|
|
190
207
|
children: "Secure Payments"
|
|
191
|
-
}), /* @__PURE__ */
|
|
208
|
+
}), /* @__PURE__ */ y("p", {
|
|
192
209
|
className: "mt-0.5 text-xs text-text-secondary",
|
|
193
210
|
children: "Your payment information is encrypted and securely stored. We never share your financial details with third parties."
|
|
194
211
|
})] })]
|
|
195
212
|
})
|
|
196
213
|
]
|
|
197
|
-
}) : /* @__PURE__ */
|
|
214
|
+
}) : /* @__PURE__ */ y(n, {
|
|
198
215
|
illustration: "empty-files",
|
|
199
|
-
icon: /* @__PURE__ */
|
|
216
|
+
icon: /* @__PURE__ */ y(u, { className: "h-12 w-12" }),
|
|
200
217
|
title: "No payment methods",
|
|
201
|
-
description: "Add a card, UPI ID, or wallet for faster checkout
|
|
202
|
-
action: /* @__PURE__ */
|
|
218
|
+
description: "Add a card, UPI ID, or wallet for faster checkout — it's saved to your account for next time.",
|
|
219
|
+
action: /* @__PURE__ */ y("button", {
|
|
203
220
|
type: "button",
|
|
204
|
-
onClick: () =>
|
|
221
|
+
onClick: () => k(!0),
|
|
205
222
|
className: "rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
|
|
206
223
|
children: "Add Payment Method"
|
|
207
224
|
})
|
|
208
225
|
}),
|
|
209
|
-
/* @__PURE__ */
|
|
226
|
+
/* @__PURE__ */ b("div", {
|
|
210
227
|
className: "mt-8",
|
|
211
|
-
children: [/* @__PURE__ */
|
|
228
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
212
229
|
className: "text-base font-semibold text-text-primary mb-4",
|
|
213
230
|
children: "Quick Pay Options"
|
|
214
|
-
}), /* @__PURE__ */
|
|
231
|
+
}), /* @__PURE__ */ b("div", {
|
|
215
232
|
className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
|
|
216
|
-
children: [/* @__PURE__ */
|
|
233
|
+
children: [/* @__PURE__ */ b("div", {
|
|
217
234
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
|
|
218
235
|
children: [
|
|
219
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ b("div", {
|
|
220
237
|
className: "flex items-center gap-3 mb-2",
|
|
221
|
-
children: [/* @__PURE__ */
|
|
238
|
+
children: [/* @__PURE__ */ y("div", {
|
|
222
239
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
|
|
223
|
-
children: /* @__PURE__ */
|
|
224
|
-
}), /* @__PURE__ */
|
|
240
|
+
children: /* @__PURE__ */ y(c, { className: "h-5 w-5 text-text-secondary" })
|
|
241
|
+
}), /* @__PURE__ */ y("h3", {
|
|
225
242
|
className: "text-sm font-semibold text-text-primary",
|
|
226
243
|
children: "Cash on Delivery"
|
|
227
244
|
})]
|
|
228
245
|
}),
|
|
229
|
-
/* @__PURE__ */
|
|
246
|
+
/* @__PURE__ */ y("p", {
|
|
230
247
|
className: "text-xs text-text-secondary mb-3",
|
|
231
248
|
children: "Pay when you receive your order"
|
|
232
249
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
250
|
+
/* @__PURE__ */ b("div", {
|
|
234
251
|
className: "flex items-center gap-2 text-status-success-text",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
252
|
+
children: [/* @__PURE__ */ y(l, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ y("span", {
|
|
236
253
|
className: "text-xs",
|
|
237
254
|
children: "Available for all orders"
|
|
238
255
|
})]
|
|
239
256
|
})
|
|
240
257
|
]
|
|
241
|
-
}), /* @__PURE__ */
|
|
258
|
+
}), /* @__PURE__ */ b("div", {
|
|
242
259
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
|
|
243
260
|
children: [
|
|
244
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ b("div", {
|
|
245
262
|
className: "flex items-center gap-3 mb-2",
|
|
246
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ y("div", {
|
|
247
264
|
className: "flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-bg-sunken",
|
|
248
|
-
children: /* @__PURE__ */
|
|
249
|
-
}), /* @__PURE__ */
|
|
265
|
+
children: /* @__PURE__ */ y(m, { className: "h-5 w-5 text-text-secondary" })
|
|
266
|
+
}), /* @__PURE__ */ y("h3", {
|
|
250
267
|
className: "text-sm font-semibold text-text-primary",
|
|
251
268
|
children: "Pay at Cart"
|
|
252
269
|
})]
|
|
253
270
|
}),
|
|
254
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ y("p", {
|
|
255
272
|
className: "text-xs text-text-secondary mb-3",
|
|
256
273
|
children: "Pay directly to the vendor"
|
|
257
274
|
}),
|
|
258
|
-
/* @__PURE__ */
|
|
275
|
+
/* @__PURE__ */ b("div", {
|
|
259
276
|
className: "flex items-center gap-2 text-status-success-text",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
277
|
+
children: [/* @__PURE__ */ y(l, { className: "h-3.5 w-3.5 shrink-0" }), /* @__PURE__ */ y("span", {
|
|
261
278
|
className: "text-xs",
|
|
262
279
|
children: "Supports all payment methods"
|
|
263
280
|
})]
|
|
@@ -266,126 +283,126 @@ function b() {
|
|
|
266
283
|
})]
|
|
267
284
|
})]
|
|
268
285
|
}),
|
|
269
|
-
|
|
286
|
+
O && /* @__PURE__ */ y("div", {
|
|
270
287
|
className: "fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",
|
|
271
|
-
children: /* @__PURE__ */
|
|
288
|
+
children: /* @__PURE__ */ y("div", {
|
|
272
289
|
className: "w-full max-w-md max-h-[90vh] overflow-y-auto rounded-lg border border-border-subtle bg-bg-surface shadow-lg",
|
|
273
|
-
children: /* @__PURE__ */
|
|
290
|
+
children: /* @__PURE__ */ b("div", {
|
|
274
291
|
className: "p-5",
|
|
275
292
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
293
|
+
/* @__PURE__ */ b("div", {
|
|
277
294
|
className: "flex items-center justify-between mb-4",
|
|
278
|
-
children: [/* @__PURE__ */
|
|
295
|
+
children: [/* @__PURE__ */ y("h2", {
|
|
279
296
|
className: "text-lg font-semibold text-text-primary",
|
|
280
297
|
children: "Add Payment Method"
|
|
281
|
-
}), /* @__PURE__ */
|
|
298
|
+
}), /* @__PURE__ */ y("button", {
|
|
282
299
|
type: "button",
|
|
283
300
|
onClick: () => {
|
|
284
|
-
|
|
301
|
+
k(!1), V();
|
|
285
302
|
},
|
|
286
303
|
className: "rounded-md p-2 text-text-secondary hover:bg-accent hover:text-text-primary transition-colors",
|
|
287
|
-
children: /* @__PURE__ */
|
|
304
|
+
children: /* @__PURE__ */ y(v, { className: "h-4 w-4" })
|
|
288
305
|
})]
|
|
289
306
|
}),
|
|
290
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ y("p", {
|
|
291
308
|
className: "text-sm text-text-secondary mb-5",
|
|
292
309
|
children: "Choose a payment method to add to your account"
|
|
293
310
|
}),
|
|
294
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ y("div", {
|
|
295
312
|
className: "space-y-2 mb-5",
|
|
296
313
|
children: [
|
|
297
314
|
{
|
|
298
315
|
value: "card",
|
|
299
316
|
label: "Credit/Debit Card",
|
|
300
317
|
sub: "Visa, Mastercard, Rupay",
|
|
301
|
-
Icon:
|
|
318
|
+
Icon: u
|
|
302
319
|
},
|
|
303
320
|
{
|
|
304
321
|
value: "upi",
|
|
305
322
|
label: "UPI",
|
|
306
323
|
sub: "Google Pay, PhonePe, Paytm",
|
|
307
|
-
Icon:
|
|
324
|
+
Icon: h
|
|
308
325
|
},
|
|
309
326
|
{
|
|
310
327
|
value: "wallet",
|
|
311
328
|
label: "Wallet",
|
|
312
329
|
sub: "Paytm, Amazon Pay, Mobikwik",
|
|
313
|
-
Icon:
|
|
330
|
+
Icon: _
|
|
314
331
|
}
|
|
315
|
-
].map(({ value:
|
|
316
|
-
className:
|
|
332
|
+
].map(({ value: t, label: n, sub: r, Icon: i }) => /* @__PURE__ */ b("label", {
|
|
333
|
+
className: e("flex items-center gap-3 rounded-lg border p-3 cursor-pointer transition-colors", A === t ? "border-foreground bg-accent" : "border-border-subtle hover:bg-accent"),
|
|
317
334
|
children: [
|
|
318
|
-
/* @__PURE__ */
|
|
335
|
+
/* @__PURE__ */ y("input", {
|
|
319
336
|
type: "radio",
|
|
320
337
|
name: "paymentType",
|
|
321
|
-
value:
|
|
322
|
-
checked:
|
|
323
|
-
onChange: () =>
|
|
338
|
+
value: t,
|
|
339
|
+
checked: A === t,
|
|
340
|
+
onChange: () => j(t),
|
|
324
341
|
className: "h-4 w-4 shrink-0"
|
|
325
342
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ y(i, { className: "h-5 w-5 text-text-secondary shrink-0" }),
|
|
344
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("p", {
|
|
328
345
|
className: "text-sm font-medium text-text-primary",
|
|
329
346
|
children: n
|
|
330
|
-
}), /* @__PURE__ */
|
|
347
|
+
}), /* @__PURE__ */ y("p", {
|
|
331
348
|
className: "text-xs text-text-secondary",
|
|
332
349
|
children: r
|
|
333
350
|
})] })
|
|
334
351
|
]
|
|
335
|
-
},
|
|
352
|
+
}, t))
|
|
336
353
|
}),
|
|
337
|
-
|
|
354
|
+
A === "card" && /* @__PURE__ */ b("div", {
|
|
338
355
|
className: "space-y-3",
|
|
339
356
|
children: [
|
|
340
|
-
/* @__PURE__ */
|
|
357
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
341
358
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
342
359
|
children: "Card Number"
|
|
343
|
-
}), /* @__PURE__ */
|
|
360
|
+
}), /* @__PURE__ */ y("input", {
|
|
344
361
|
type: "text",
|
|
345
362
|
placeholder: "1234 5678 9012 3456",
|
|
346
|
-
value:
|
|
347
|
-
onChange: (e) =>
|
|
363
|
+
value: P.cardNumber,
|
|
364
|
+
onChange: (e) => F((t) => ({
|
|
348
365
|
...t,
|
|
349
366
|
cardNumber: e.target.value
|
|
350
367
|
})),
|
|
351
368
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
352
369
|
})] }),
|
|
353
|
-
/* @__PURE__ */
|
|
370
|
+
/* @__PURE__ */ b("div", {
|
|
354
371
|
className: "grid grid-cols-2 gap-3",
|
|
355
|
-
children: [/* @__PURE__ */
|
|
372
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
356
373
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
357
374
|
children: "Expiry Date"
|
|
358
|
-
}), /* @__PURE__ */
|
|
375
|
+
}), /* @__PURE__ */ y("input", {
|
|
359
376
|
type: "text",
|
|
360
377
|
placeholder: "MM/YY",
|
|
361
|
-
value:
|
|
362
|
-
onChange: (e) =>
|
|
378
|
+
value: P.expiry,
|
|
379
|
+
onChange: (e) => F((t) => ({
|
|
363
380
|
...t,
|
|
364
381
|
expiry: e.target.value
|
|
365
382
|
})),
|
|
366
383
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
367
|
-
})] }), /* @__PURE__ */
|
|
384
|
+
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
368
385
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
369
386
|
children: "CVV"
|
|
370
|
-
}), /* @__PURE__ */
|
|
387
|
+
}), /* @__PURE__ */ y("input", {
|
|
371
388
|
type: "password",
|
|
372
389
|
placeholder: "123",
|
|
373
|
-
value:
|
|
374
|
-
onChange: (e) =>
|
|
390
|
+
value: P.cvv,
|
|
391
|
+
onChange: (e) => F((t) => ({
|
|
375
392
|
...t,
|
|
376
393
|
cvv: e.target.value
|
|
377
394
|
})),
|
|
378
395
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
379
396
|
})] })]
|
|
380
397
|
}),
|
|
381
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
382
399
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
383
400
|
children: "Name on Card"
|
|
384
|
-
}), /* @__PURE__ */
|
|
401
|
+
}), /* @__PURE__ */ y("input", {
|
|
385
402
|
type: "text",
|
|
386
403
|
placeholder: "John Doe",
|
|
387
|
-
value:
|
|
388
|
-
onChange: (e) =>
|
|
404
|
+
value: P.nameOnCard,
|
|
405
|
+
onChange: (e) => F((t) => ({
|
|
389
406
|
...t,
|
|
390
407
|
nameOnCard: e.target.value
|
|
391
408
|
})),
|
|
@@ -393,59 +410,59 @@ function b() {
|
|
|
393
410
|
})] })
|
|
394
411
|
]
|
|
395
412
|
}),
|
|
396
|
-
|
|
413
|
+
A === "upi" && /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
397
414
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
398
415
|
children: "UPI ID"
|
|
399
|
-
}), /* @__PURE__ */
|
|
416
|
+
}), /* @__PURE__ */ y("input", {
|
|
400
417
|
type: "text",
|
|
401
418
|
placeholder: "yourname@paytm",
|
|
402
|
-
value:
|
|
403
|
-
onChange: (e) =>
|
|
419
|
+
value: I.upiId,
|
|
420
|
+
onChange: (e) => L({ upiId: e.target.value }),
|
|
404
421
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
405
422
|
})] }),
|
|
406
|
-
|
|
423
|
+
A === "wallet" && /* @__PURE__ */ b("div", {
|
|
407
424
|
className: "space-y-3",
|
|
408
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
409
426
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
410
427
|
children: "Select Wallet"
|
|
411
|
-
}), /* @__PURE__ */
|
|
412
|
-
value:
|
|
413
|
-
onChange: (e) =>
|
|
428
|
+
}), /* @__PURE__ */ b("select", {
|
|
429
|
+
value: R.walletProvider,
|
|
430
|
+
onChange: (e) => z((t) => ({
|
|
414
431
|
...t,
|
|
415
432
|
walletProvider: e.target.value
|
|
416
433
|
})),
|
|
417
434
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]",
|
|
418
435
|
children: [
|
|
419
|
-
/* @__PURE__ */
|
|
420
|
-
/* @__PURE__ */
|
|
421
|
-
/* @__PURE__ */
|
|
422
|
-
/* @__PURE__ */
|
|
436
|
+
/* @__PURE__ */ y("option", { children: "Paytm" }),
|
|
437
|
+
/* @__PURE__ */ y("option", { children: "Amazon Pay" }),
|
|
438
|
+
/* @__PURE__ */ y("option", { children: "Mobikwik" }),
|
|
439
|
+
/* @__PURE__ */ y("option", { children: "Freecharge" })
|
|
423
440
|
]
|
|
424
|
-
})] }), /* @__PURE__ */
|
|
441
|
+
})] }), /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("label", {
|
|
425
442
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
426
443
|
children: "Mobile Number"
|
|
427
|
-
}), /* @__PURE__ */
|
|
444
|
+
}), /* @__PURE__ */ y("input", {
|
|
428
445
|
type: "tel",
|
|
429
446
|
placeholder: "9876543210",
|
|
430
|
-
value:
|
|
431
|
-
onChange: (e) =>
|
|
447
|
+
value: R.mobile,
|
|
448
|
+
onChange: (e) => z((t) => ({
|
|
432
449
|
...t,
|
|
433
450
|
mobile: e.target.value
|
|
434
451
|
})),
|
|
435
452
|
className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
436
453
|
})] })]
|
|
437
454
|
}),
|
|
438
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ b("div", {
|
|
439
456
|
className: "flex items-center gap-3 pt-5",
|
|
440
|
-
children: [/* @__PURE__ */
|
|
457
|
+
children: [/* @__PURE__ */ y("button", {
|
|
441
458
|
type: "button",
|
|
442
|
-
onClick:
|
|
459
|
+
onClick: W,
|
|
443
460
|
className: "flex-1 rounded-lg bg-foreground px-4 py-2 text-sm font-medium text-background hover:opacity-90 transition-opacity",
|
|
444
461
|
children: "Add Payment Method"
|
|
445
|
-
}), /* @__PURE__ */
|
|
462
|
+
}), /* @__PURE__ */ y("button", {
|
|
446
463
|
type: "button",
|
|
447
464
|
onClick: () => {
|
|
448
|
-
|
|
465
|
+
k(!1), V();
|
|
449
466
|
},
|
|
450
467
|
className: "flex-1 rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-accent transition-colors",
|
|
451
468
|
children: "Cancel"
|
|
@@ -459,6 +476,6 @@ function b() {
|
|
|
459
476
|
});
|
|
460
477
|
}
|
|
461
478
|
//#endregion
|
|
462
|
-
export {
|
|
479
|
+
export { T as PaymentMethodsPage };
|
|
463
480
|
|
|
464
481
|
//# sourceMappingURL=PaymentMethodsPage.js.map
|