@freehold/payments 0.0.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.
- package/LICENSE +21 -0
- package/dist/index.d.mts +151 -0
- package/dist/index.d.ts +151 -0
- package/dist/index.js +595 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +578 -0
- package/dist/index.mjs.map +1 -0
- package/dist/stripe.d.mts +29 -0
- package/dist/stripe.d.ts +29 -0
- package/dist/stripe.js +233 -0
- package/dist/stripe.js.map +1 -0
- package/dist/stripe.mjs +229 -0
- package/dist/stripe.mjs.map +1 -0
- package/package.json +77 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var clsx = require('clsx');
|
|
4
|
+
var tailwindMerge = require('tailwind-merge');
|
|
5
|
+
var react = require('react');
|
|
6
|
+
var classVarianceAuthority = require('class-variance-authority');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
8
|
+
|
|
9
|
+
// src/utils/format-currency.ts
|
|
10
|
+
function formatCurrency(amount, currency = "USD", locale = "en-US") {
|
|
11
|
+
return new Intl.NumberFormat(locale, {
|
|
12
|
+
style: "currency",
|
|
13
|
+
currency,
|
|
14
|
+
minimumFractionDigits: 2,
|
|
15
|
+
maximumFractionDigits: 2
|
|
16
|
+
}).format(amount);
|
|
17
|
+
}
|
|
18
|
+
function cn(...inputs) {
|
|
19
|
+
return tailwindMerge.twMerge(clsx.clsx(inputs));
|
|
20
|
+
}
|
|
21
|
+
var orderSummaryVariants = classVarianceAuthority.cva(
|
|
22
|
+
["w-full font-sans"],
|
|
23
|
+
{
|
|
24
|
+
variants: {
|
|
25
|
+
variant: {
|
|
26
|
+
default: "space-y-3",
|
|
27
|
+
compact: "space-y-2"
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
defaultVariants: {
|
|
31
|
+
variant: "default"
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
);
|
|
35
|
+
var OrderSummary = react.forwardRef(
|
|
36
|
+
({
|
|
37
|
+
className,
|
|
38
|
+
variant,
|
|
39
|
+
items,
|
|
40
|
+
subtotal,
|
|
41
|
+
tax,
|
|
42
|
+
discount,
|
|
43
|
+
total,
|
|
44
|
+
currency,
|
|
45
|
+
...props
|
|
46
|
+
}, ref) => {
|
|
47
|
+
const isCompact = variant === "compact";
|
|
48
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
49
|
+
"div",
|
|
50
|
+
{
|
|
51
|
+
ref,
|
|
52
|
+
className: cn(orderSummaryVariants({ variant }), className),
|
|
53
|
+
...props,
|
|
54
|
+
children: [
|
|
55
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: cn("space-y-2", isCompact && "space-y-1"), children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
56
|
+
"div",
|
|
57
|
+
{
|
|
58
|
+
className: "flex items-start justify-between gap-4",
|
|
59
|
+
children: [
|
|
60
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
61
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
62
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: cn(
|
|
63
|
+
"text-[#2C2824] font-medium truncate",
|
|
64
|
+
isCompact ? "text-sm" : "text-sm"
|
|
65
|
+
), children: item.name }),
|
|
66
|
+
item.quantity > 1 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "text-xs text-[#8A847A] shrink-0", children: [
|
|
67
|
+
"x",
|
|
68
|
+
item.quantity
|
|
69
|
+
] })
|
|
70
|
+
] }),
|
|
71
|
+
!isCompact && item.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-xs text-[#5C574F] mt-0.5 truncate", children: item.description })
|
|
72
|
+
] }),
|
|
73
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-[#2C2824] font-medium shrink-0", children: formatCurrency(item.unitPrice * item.quantity, currency) })
|
|
74
|
+
]
|
|
75
|
+
},
|
|
76
|
+
item.id
|
|
77
|
+
)) }),
|
|
78
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[rgba(184,164,142,0.15)]" }),
|
|
79
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("space-y-1.5", isCompact && "space-y-1"), children: [
|
|
80
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm text-[#5C574F]", children: [
|
|
81
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Subtotal" }),
|
|
82
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: formatCurrency(subtotal, currency) })
|
|
83
|
+
] }),
|
|
84
|
+
discount !== void 0 && discount > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm text-[#8DB580]", children: [
|
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Discount" }),
|
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { children: [
|
|
87
|
+
"-",
|
|
88
|
+
formatCurrency(discount, currency)
|
|
89
|
+
] })
|
|
90
|
+
] }),
|
|
91
|
+
tax !== void 0 && tax > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between text-sm text-[#5C574F]", children: [
|
|
92
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "Tax" }),
|
|
93
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: formatCurrency(tax, currency) })
|
|
94
|
+
] }),
|
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[rgba(184,164,142,0.15)] pt-1.5", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between", children: [
|
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-semibold text-[#2C2824]", children: "Total" }),
|
|
97
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-semibold text-[#2C2824]", children: formatCurrency(total, currency) })
|
|
98
|
+
] }) })
|
|
99
|
+
] })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
102
|
+
);
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
OrderSummary.displayName = "OrderSummary";
|
|
106
|
+
function VisaIcon(props) {
|
|
107
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
108
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "32", rx: "4", fill: "#1A1F71" }),
|
|
109
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20.3 21.5h-2.9l1.8-11h2.9l-1.8 11zm-4.2-11l-2.7 7.5-.3-1.6-1-5.1s-.1-.8-1.1-.8H7.1l-.1.3s1.2.2 2.5.9l2.1 8h3l4.5-10.2h-3zm22.4 11h2.6l-2.3-11h-2.3c-.8 0-1.1.5-1.1.5l-4.3 10.5h3l.6-1.6h3.7l.3 1.6zm-3.2-3.9l1.5-4.2.9 4.2h-2.4zm-5.3-4.5l.4-2.4s-1.3-.5-2.6-.5c-1.4 0-4.8.6-4.8 3.7 0 2.9 4 2.9 4 4.4s-3.6 1.2-4.8.3l-.4 2.5s1.3.6 3.3.6c2 0 4.9-1 4.9-3.8 0-2.9-4-3.2-4-4.4 0-1.3 2.8-1.1 4-.4z", fill: "#fff" })
|
|
110
|
+
] });
|
|
111
|
+
}
|
|
112
|
+
function MastercardIcon(props) {
|
|
113
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
114
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "32", rx: "4", fill: "#252525" }),
|
|
115
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "19", cy: "16", r: "8", fill: "#EB001B" }),
|
|
116
|
+
/* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "29", cy: "16", r: "8", fill: "#F79E1B" }),
|
|
117
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M24 10.3a8 8 0 0 1 0 11.4 8 8 0 0 1 0-11.4z", fill: "#FF5F00" })
|
|
118
|
+
] });
|
|
119
|
+
}
|
|
120
|
+
function AmexIcon(props) {
|
|
121
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
122
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "32", rx: "4", fill: "#2E77BC" }),
|
|
123
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 16h34M11 11l-4 5 4 5m26-10l4 5-4 5", stroke: "#fff", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
124
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: "24", y: "18", textAnchor: "middle", fill: "#fff", fontSize: "7", fontWeight: "bold", fontFamily: "sans-serif", children: "AMEX" })
|
|
125
|
+
] });
|
|
126
|
+
}
|
|
127
|
+
function ApplePayIcon(props) {
|
|
128
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
129
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "32", rx: "4", fill: "#000" }),
|
|
130
|
+
/* @__PURE__ */ jsxRuntime.jsx("text", { x: "24", y: "18.5", textAnchor: "middle", fill: "#fff", fontSize: "9", fontWeight: "600", fontFamily: "system-ui, sans-serif", children: " Pay" }),
|
|
131
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.5 10.5c.5-.6.8-1.5.7-2.3-.7 0-1.6.5-2.1 1.1-.4.5-.8 1.4-.7 2.2.8.1 1.6-.4 2.1-1z", fill: "#fff" }),
|
|
132
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M16.2 11.6c-1.2-.1-2.2.7-2.7.7s-1.4-.6-2.4-.6c-1.2 0-2.3.7-2.9 1.8-1.3 2.2-.3 5.4.9 7.2.6.9 1.3 1.8 2.3 1.8s1.3-.6 2.4-.6 1.4.6 2.4.6 1.6-.9 2.2-1.8c.7-1 1-2 1-2s-1.9-.7-1.9-2.8c0-1.8 1.5-2.6 1.5-2.6-.8-1.2-2-1.3-2.5-1.4l-.3-.3z", fill: "#fff" })
|
|
133
|
+
] });
|
|
134
|
+
}
|
|
135
|
+
function GooglePayIcon(props) {
|
|
136
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
137
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "32", rx: "4", fill: "#fff", stroke: "#E5E5E5", strokeWidth: "1" }),
|
|
138
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M24.5 17.2v3.1h-1v-7.7h2.6c.6 0 1.2.2 1.7.7.5.4.7 1 .7 1.6 0 .7-.2 1.2-.7 1.6-.4.5-1 .7-1.7.7h-1.6zm0-3.6v2.7h1.7c.4 0 .7-.1 1-.4.3-.3.4-.6.4-1s-.1-.7-.4-1c-.3-.3-.6-.4-1-.4h-1.7z", fill: "#3C4043" }),
|
|
139
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M32.1 14.8c.7 0 1.3.2 1.7.6.4.4.6 1 .6 1.7v3.2h-.9v-.7c-.4.6-.9.8-1.6.8-.7 0-1.2-.2-1.6-.5-.4-.4-.6-.8-.6-1.3 0-.5.2-.9.6-1.3.4-.3.9-.5 1.5-.5.6 0 1 .2 1.4.5v-.3c0-.4-.1-.7-.4-1-.3-.3-.6-.4-1-.4-.6 0-1 .2-1.4.7l-.7-.5c.5-.6 1.2-1 2.1-1h.3zm-1.2 4.5c.3.2.6.3 1 .3s.7-.1 1-.3c.3-.2.4-.5.4-.8 0-.3-.1-.6-.4-.8-.3-.2-.6-.3-1-.3s-.7.1-1 .3c-.3.2-.4.5-.4.8 0 .3.1.6.4.8z", fill: "#3C4043" }),
|
|
140
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M39 14.9l-3.2 7.3h-1l1.2-2.6-2.1-4.7h1.1l1.5 3.5 1.5-3.5h1z", fill: "#3C4043" }),
|
|
141
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19.7 16.3c0-.3 0-.6-.1-.9h-4.2v1.7h2.4c-.1.6-.4 1-.8 1.4v1.1h1.3c.8-.7 1.3-1.8 1.4-3.3z", fill: "#4285F4" }),
|
|
142
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.4 20.3c1.1 0 2.1-.4 2.8-1l-1.3-1c-.4.3-.9.4-1.4.4-1.1 0-2-.7-2.3-1.7H11.8v1.1c.7 1.3 2 2.2 3.6 2.2z", fill: "#34A853" }),
|
|
143
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M13.1 16.9c-.2-.5-.2-1.1 0-1.6v-1.1h-1.4c-.5 1-.5 2.2 0 3.3l1.4-1.1v.5z", fill: "#FBBC04" }),
|
|
144
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M15.4 13.3c.6 0 1.2.2 1.6.6l1.2-1.2c-.8-.7-1.7-1.1-2.8-1.1-1.6 0-2.9.9-3.6 2.2l1.4 1.1c.3-1 1.2-1.6 2.2-1.6z", fill: "#EA4335" })
|
|
145
|
+
] });
|
|
146
|
+
}
|
|
147
|
+
function PayPalIcon(props) {
|
|
148
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("svg", { viewBox: "0 0 48 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [
|
|
149
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { width: "48", height: "32", rx: "4", fill: "#fff", stroke: "#E5E5E5", strokeWidth: "1" }),
|
|
150
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M19.5 8h5.3c2.4 0 4.1 1 3.7 3.5-.5 3.2-2.4 5-5.4 5h-1.4c-.4 0-.7.3-.8.7L20.2 22h-3c-.3 0-.4-.2-.4-.5L19 8.5c0-.3.2-.5.5-.5z", fill: "#003087" }),
|
|
151
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M22 8h5.3c2.4 0 4.1 1 3.7 3.5-.5 3.2-2.4 5-5.4 5h-1.4c-.4 0-.7.3-.8.7L22.7 22h-3c-.3 0-.4-.2-.4-.5L21.5 8.5c0-.3.2-.5.5-.5z", fill: "#0070E0" }),
|
|
152
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M27.8 13.5c.1-.5 0-.9-.3-1.2-.3-.3-.9-.5-1.7-.5h-2.2l-.6 3.8h1.4c1.5 0 2.9-.8 3.4-2.1z", fill: "#fff" })
|
|
153
|
+
] });
|
|
154
|
+
}
|
|
155
|
+
var iconMap = {
|
|
156
|
+
visa: VisaIcon,
|
|
157
|
+
mastercard: MastercardIcon,
|
|
158
|
+
amex: AmexIcon,
|
|
159
|
+
"apple-pay": ApplePayIcon,
|
|
160
|
+
"google-pay": GooglePayIcon,
|
|
161
|
+
paypal: PayPalIcon
|
|
162
|
+
};
|
|
163
|
+
var sizeClasses = {
|
|
164
|
+
sm: "w-8 h-5",
|
|
165
|
+
md: "w-10 h-6",
|
|
166
|
+
lg: "w-12 h-8"
|
|
167
|
+
};
|
|
168
|
+
var PaymentMethodIcon = react.forwardRef(
|
|
169
|
+
({ className, method, size = "md", ...props }, ref) => {
|
|
170
|
+
const Icon = iconMap[method];
|
|
171
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
172
|
+
"span",
|
|
173
|
+
{
|
|
174
|
+
ref,
|
|
175
|
+
className: cn("inline-flex items-center", className),
|
|
176
|
+
...props,
|
|
177
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: sizeClasses[size], "aria-label": method })
|
|
178
|
+
}
|
|
179
|
+
);
|
|
180
|
+
}
|
|
181
|
+
);
|
|
182
|
+
PaymentMethodIcon.displayName = "PaymentMethodIcon";
|
|
183
|
+
var securityBadgeVariants = classVarianceAuthority.cva(
|
|
184
|
+
["inline-flex items-center gap-1.5 font-medium"],
|
|
185
|
+
{
|
|
186
|
+
variants: {
|
|
187
|
+
variant: {
|
|
188
|
+
default: "text-sm text-[#5C574F]",
|
|
189
|
+
subtle: "text-xs text-[#8A847A]"
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
defaultVariants: {
|
|
193
|
+
variant: "default"
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
var SecurityBadge = react.forwardRef(
|
|
198
|
+
({ className, variant, label = "Secure checkout", ...props }, ref) => {
|
|
199
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
200
|
+
"div",
|
|
201
|
+
{
|
|
202
|
+
ref,
|
|
203
|
+
className: cn(securityBadgeVariants({ variant }), className),
|
|
204
|
+
...props,
|
|
205
|
+
children: [
|
|
206
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
207
|
+
"svg",
|
|
208
|
+
{
|
|
209
|
+
width: "14",
|
|
210
|
+
height: "14",
|
|
211
|
+
viewBox: "0 0 24 24",
|
|
212
|
+
fill: "none",
|
|
213
|
+
stroke: "currentColor",
|
|
214
|
+
strokeWidth: "2",
|
|
215
|
+
strokeLinecap: "round",
|
|
216
|
+
strokeLinejoin: "round",
|
|
217
|
+
"aria-hidden": "true",
|
|
218
|
+
children: [
|
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsx("rect", { x: "3", y: "11", width: "18", height: "11", rx: "2", ry: "2" }),
|
|
220
|
+
/* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7 11V7a5 5 0 0 1 10 0v4" })
|
|
221
|
+
]
|
|
222
|
+
}
|
|
223
|
+
),
|
|
224
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
225
|
+
]
|
|
226
|
+
}
|
|
227
|
+
);
|
|
228
|
+
}
|
|
229
|
+
);
|
|
230
|
+
SecurityBadge.displayName = "SecurityBadge";
|
|
231
|
+
var CheckoutDivider = react.forwardRef(
|
|
232
|
+
({ className, label = "or", ...props }, ref) => {
|
|
233
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
234
|
+
"div",
|
|
235
|
+
{
|
|
236
|
+
ref,
|
|
237
|
+
className: cn("relative flex items-center py-2", className),
|
|
238
|
+
...props,
|
|
239
|
+
children: [
|
|
240
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 border-t border-[rgba(184,164,142,0.2)]" }),
|
|
241
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "px-3 text-xs font-medium text-[#8A847A] uppercase tracking-wider", children: label }),
|
|
242
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1 border-t border-[rgba(184,164,142,0.2)]" })
|
|
243
|
+
]
|
|
244
|
+
}
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
);
|
|
248
|
+
CheckoutDivider.displayName = "CheckoutDivider";
|
|
249
|
+
var CheckoutHeader = react.forwardRef(
|
|
250
|
+
({ className, title, description, logo, ...props }, ref) => {
|
|
251
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { ref, className: cn("space-y-2", className), ...props, children: [
|
|
252
|
+
logo && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3", children: logo }),
|
|
253
|
+
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "font-['DM_Serif_Display',serif] text-xl text-[#2C2824]", children: title }),
|
|
254
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-[#5C574F]", children: description })
|
|
255
|
+
] });
|
|
256
|
+
}
|
|
257
|
+
);
|
|
258
|
+
CheckoutHeader.displayName = "CheckoutHeader";
|
|
259
|
+
var CheckoutFooter = react.forwardRef(
|
|
260
|
+
({ className, termsUrl, privacyUrl, showPoweredBy = false, ...props }, ref) => {
|
|
261
|
+
const hasLinks = termsUrl || privacyUrl;
|
|
262
|
+
if (!hasLinks && !showPoweredBy) return null;
|
|
263
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
264
|
+
"div",
|
|
265
|
+
{
|
|
266
|
+
ref,
|
|
267
|
+
className: cn(
|
|
268
|
+
"flex flex-col items-center gap-2 pt-4 text-xs text-[#8A847A]",
|
|
269
|
+
className
|
|
270
|
+
),
|
|
271
|
+
...props,
|
|
272
|
+
children: [
|
|
273
|
+
hasLinks && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
274
|
+
termsUrl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
275
|
+
"a",
|
|
276
|
+
{
|
|
277
|
+
href: termsUrl,
|
|
278
|
+
target: "_blank",
|
|
279
|
+
rel: "noopener noreferrer",
|
|
280
|
+
className: "underline underline-offset-2 hover:text-[#5C574F] transition-colors",
|
|
281
|
+
children: "Terms"
|
|
282
|
+
}
|
|
283
|
+
),
|
|
284
|
+
termsUrl && privacyUrl && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[rgba(184,164,142,0.4)]", children: "\xB7" }),
|
|
285
|
+
privacyUrl && /* @__PURE__ */ jsxRuntime.jsx(
|
|
286
|
+
"a",
|
|
287
|
+
{
|
|
288
|
+
href: privacyUrl,
|
|
289
|
+
target: "_blank",
|
|
290
|
+
rel: "noopener noreferrer",
|
|
291
|
+
className: "underline underline-offset-2 hover:text-[#5C574F] transition-colors",
|
|
292
|
+
children: "Privacy"
|
|
293
|
+
}
|
|
294
|
+
)
|
|
295
|
+
] }),
|
|
296
|
+
showPoweredBy && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[10px] text-[#8A847A]/70", children: "Powered by Freehold" })
|
|
297
|
+
]
|
|
298
|
+
}
|
|
299
|
+
);
|
|
300
|
+
}
|
|
301
|
+
);
|
|
302
|
+
CheckoutFooter.displayName = "CheckoutFooter";
|
|
303
|
+
var pricingCardVariants = classVarianceAuthority.cva(
|
|
304
|
+
[
|
|
305
|
+
"relative flex flex-col",
|
|
306
|
+
"bg-white rounded-[14px]",
|
|
307
|
+
"border",
|
|
308
|
+
"p-6 sm:p-8",
|
|
309
|
+
"transition-all duration-200"
|
|
310
|
+
],
|
|
311
|
+
{
|
|
312
|
+
variants: {
|
|
313
|
+
variant: {
|
|
314
|
+
default: [
|
|
315
|
+
"border-[rgba(184,164,142,0.15)]",
|
|
316
|
+
"shadow-[0_2px_4px_0_rgba(184,164,142,0.08),0_4px_8px_0_rgba(44,40,36,0.04)]"
|
|
317
|
+
],
|
|
318
|
+
featured: [
|
|
319
|
+
"border-[#B8A48E]",
|
|
320
|
+
"shadow-[0_4px_8px_0_rgba(184,164,142,0.08),0_8px_16px_-4px_rgba(44,40,36,0.06)]",
|
|
321
|
+
"scale-[1.02]",
|
|
322
|
+
"z-10"
|
|
323
|
+
]
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
defaultVariants: {
|
|
327
|
+
variant: "default"
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
);
|
|
331
|
+
var billingPeriodLabels = {
|
|
332
|
+
monthly: "/mo",
|
|
333
|
+
yearly: "/yr",
|
|
334
|
+
"one-time": ""
|
|
335
|
+
};
|
|
336
|
+
var PricingCard = react.forwardRef(
|
|
337
|
+
({
|
|
338
|
+
className,
|
|
339
|
+
variant: variantProp,
|
|
340
|
+
name,
|
|
341
|
+
description,
|
|
342
|
+
price,
|
|
343
|
+
currency,
|
|
344
|
+
billingPeriod,
|
|
345
|
+
billingLabel,
|
|
346
|
+
features,
|
|
347
|
+
badge,
|
|
348
|
+
ctaLabel,
|
|
349
|
+
featured,
|
|
350
|
+
originalPrice,
|
|
351
|
+
ctaSlot,
|
|
352
|
+
onCtaClick,
|
|
353
|
+
...props
|
|
354
|
+
}, ref) => {
|
|
355
|
+
const resolvedVariant = variantProp ?? (featured ? "featured" : "default");
|
|
356
|
+
const periodLabel = billingLabel || billingPeriodLabels[billingPeriod] || "";
|
|
357
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
358
|
+
"div",
|
|
359
|
+
{
|
|
360
|
+
ref,
|
|
361
|
+
className: cn(pricingCardVariants({ variant: resolvedVariant }), className),
|
|
362
|
+
...props,
|
|
363
|
+
children: [
|
|
364
|
+
badge && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "absolute -top-3 left-1/2 -translate-x-1/2", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
365
|
+
"span",
|
|
366
|
+
{
|
|
367
|
+
className: cn(
|
|
368
|
+
"inline-block px-3 py-1 rounded-full text-xs font-medium tracking-wide whitespace-nowrap",
|
|
369
|
+
resolvedVariant === "featured" ? "bg-[#2C2824] text-[#FAF9F6]" : "bg-[#F5F3EF] text-[#5C574F] border border-[rgba(184,164,142,0.25)]"
|
|
370
|
+
),
|
|
371
|
+
children: badge
|
|
372
|
+
}
|
|
373
|
+
) }),
|
|
374
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: cn("text-center", badge && "mt-2"), children: [
|
|
375
|
+
/* @__PURE__ */ jsxRuntime.jsx("h3", { className: "font-['DM_Serif_Display',serif] text-xl text-[#2C2824]", children: name }),
|
|
376
|
+
description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-sm text-[#5C574F]", children: description })
|
|
377
|
+
] }),
|
|
378
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "text-center py-6", children: [
|
|
379
|
+
originalPrice !== void 0 && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-[#8A847A] line-through mr-2", children: formatCurrency(originalPrice, currency) }),
|
|
380
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-baseline justify-center gap-1", children: [
|
|
381
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "font-['DM_Serif_Display',serif] text-4xl text-[#2C2824]", children: formatCurrency(price, currency) }),
|
|
382
|
+
periodLabel && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm text-[#8A847A]", children: periodLabel })
|
|
383
|
+
] })
|
|
384
|
+
] }),
|
|
385
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "border-t border-[rgba(184,164,142,0.15)]" }),
|
|
386
|
+
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "flex-1 space-y-3 py-6", children: features.map((feature, index) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "flex items-start gap-2.5", children: [
|
|
387
|
+
feature.included !== false ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
388
|
+
"svg",
|
|
389
|
+
{
|
|
390
|
+
width: "16",
|
|
391
|
+
height: "16",
|
|
392
|
+
viewBox: "0 0 24 24",
|
|
393
|
+
fill: "none",
|
|
394
|
+
stroke: "#8DB580",
|
|
395
|
+
strokeWidth: "2",
|
|
396
|
+
strokeLinecap: "round",
|
|
397
|
+
strokeLinejoin: "round",
|
|
398
|
+
className: "shrink-0 mt-0.5",
|
|
399
|
+
"aria-hidden": "true",
|
|
400
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("polyline", { points: "20 6 9 17 4 12" })
|
|
401
|
+
}
|
|
402
|
+
) : /* @__PURE__ */ jsxRuntime.jsxs(
|
|
403
|
+
"svg",
|
|
404
|
+
{
|
|
405
|
+
width: "16",
|
|
406
|
+
height: "16",
|
|
407
|
+
viewBox: "0 0 24 24",
|
|
408
|
+
fill: "none",
|
|
409
|
+
stroke: "#C4796B",
|
|
410
|
+
strokeWidth: "2",
|
|
411
|
+
strokeLinecap: "round",
|
|
412
|
+
strokeLinejoin: "round",
|
|
413
|
+
className: "shrink-0 mt-0.5",
|
|
414
|
+
"aria-hidden": "true",
|
|
415
|
+
children: [
|
|
416
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
|
|
417
|
+
/* @__PURE__ */ jsxRuntime.jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
|
|
418
|
+
]
|
|
419
|
+
}
|
|
420
|
+
),
|
|
421
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
422
|
+
"span",
|
|
423
|
+
{
|
|
424
|
+
className: cn(
|
|
425
|
+
"text-sm",
|
|
426
|
+
feature.included !== false ? "text-[#2C2824]" : "text-[#8A847A]"
|
|
427
|
+
),
|
|
428
|
+
children: feature.text
|
|
429
|
+
}
|
|
430
|
+
)
|
|
431
|
+
] }, index)) }),
|
|
432
|
+
ctaSlot ?? /* @__PURE__ */ jsxRuntime.jsx(
|
|
433
|
+
"button",
|
|
434
|
+
{
|
|
435
|
+
onClick: onCtaClick,
|
|
436
|
+
className: cn(
|
|
437
|
+
"w-full py-2.5 px-4 rounded-[10px] text-sm font-medium",
|
|
438
|
+
"transition-colors duration-200",
|
|
439
|
+
resolvedVariant === "featured" ? "bg-[#2C2824] text-[#FAF9F6] hover:bg-[#3d3832]" : "bg-[#F5F3EF] text-[#2C2824] hover:bg-[#EFECE6] border border-[rgba(184,164,142,0.25)]"
|
|
440
|
+
),
|
|
441
|
+
children: ctaLabel
|
|
442
|
+
}
|
|
443
|
+
)
|
|
444
|
+
]
|
|
445
|
+
}
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
);
|
|
449
|
+
PricingCard.displayName = "PricingCard";
|
|
450
|
+
var CheckoutCard = react.forwardRef(
|
|
451
|
+
({ className, header, footer, children, ...props }, ref) => {
|
|
452
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
453
|
+
"div",
|
|
454
|
+
{
|
|
455
|
+
ref,
|
|
456
|
+
className: cn(
|
|
457
|
+
"w-full max-w-md mx-auto",
|
|
458
|
+
"bg-white rounded-[14px]",
|
|
459
|
+
"border border-[rgba(184,164,142,0.15)]",
|
|
460
|
+
"shadow-[0_2px_4px_0_rgba(184,164,142,0.08),0_8px_24px_0_rgba(44,40,36,0.06)]",
|
|
461
|
+
"p-6 sm:p-8",
|
|
462
|
+
className
|
|
463
|
+
),
|
|
464
|
+
...props,
|
|
465
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
466
|
+
header && /* @__PURE__ */ jsxRuntime.jsx(CheckoutHeader, { ...header }),
|
|
467
|
+
children,
|
|
468
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx(CheckoutFooter, { ...footer })
|
|
469
|
+
] })
|
|
470
|
+
}
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
);
|
|
474
|
+
CheckoutCard.displayName = "CheckoutCard";
|
|
475
|
+
var CheckoutFullScreen = react.forwardRef(
|
|
476
|
+
({ className, header, footer, children, ...props }, ref) => {
|
|
477
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
478
|
+
"div",
|
|
479
|
+
{
|
|
480
|
+
ref,
|
|
481
|
+
className: cn(
|
|
482
|
+
"min-h-screen bg-[#FAF9F6]",
|
|
483
|
+
"flex items-center justify-center",
|
|
484
|
+
"px-4 py-12",
|
|
485
|
+
className
|
|
486
|
+
),
|
|
487
|
+
...props,
|
|
488
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full max-w-lg", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
489
|
+
"div",
|
|
490
|
+
{
|
|
491
|
+
className: cn(
|
|
492
|
+
"bg-white rounded-[14px]",
|
|
493
|
+
"border border-[rgba(184,164,142,0.15)]",
|
|
494
|
+
"shadow-[0_2px_4px_0_rgba(184,164,142,0.08),0_8px_24px_0_rgba(44,40,36,0.06)]",
|
|
495
|
+
"p-6 sm:p-8"
|
|
496
|
+
),
|
|
497
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
498
|
+
header && /* @__PURE__ */ jsxRuntime.jsx(CheckoutHeader, { ...header }),
|
|
499
|
+
children,
|
|
500
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx(CheckoutFooter, { ...footer })
|
|
501
|
+
] })
|
|
502
|
+
}
|
|
503
|
+
) })
|
|
504
|
+
}
|
|
505
|
+
);
|
|
506
|
+
}
|
|
507
|
+
);
|
|
508
|
+
CheckoutFullScreen.displayName = "CheckoutFullScreen";
|
|
509
|
+
var CheckoutSplitScreen = react.forwardRef(
|
|
510
|
+
({ className, left, header, footer, children, ...props }, ref) => {
|
|
511
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
512
|
+
"div",
|
|
513
|
+
{
|
|
514
|
+
ref,
|
|
515
|
+
className: cn(
|
|
516
|
+
"min-h-screen flex flex-col md:flex-row",
|
|
517
|
+
className
|
|
518
|
+
),
|
|
519
|
+
...props,
|
|
520
|
+
children: [
|
|
521
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
522
|
+
"div",
|
|
523
|
+
{
|
|
524
|
+
className: cn(
|
|
525
|
+
"md:w-1/2 bg-[#2C2824] text-[#FAF9F6]",
|
|
526
|
+
"flex items-center justify-center",
|
|
527
|
+
"p-8 md:p-12 lg:p-16",
|
|
528
|
+
"min-h-[240px] md:min-h-screen"
|
|
529
|
+
),
|
|
530
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full max-w-md", children: left })
|
|
531
|
+
}
|
|
532
|
+
),
|
|
533
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
534
|
+
"div",
|
|
535
|
+
{
|
|
536
|
+
className: cn(
|
|
537
|
+
"md:w-1/2 bg-white",
|
|
538
|
+
"flex items-center justify-center",
|
|
539
|
+
"p-6 sm:p-8 md:p-12 lg:p-16"
|
|
540
|
+
),
|
|
541
|
+
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-full max-w-md", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "space-y-6", children: [
|
|
542
|
+
header && /* @__PURE__ */ jsxRuntime.jsx(CheckoutHeader, { ...header }),
|
|
543
|
+
children,
|
|
544
|
+
footer && /* @__PURE__ */ jsxRuntime.jsx(CheckoutFooter, { ...footer })
|
|
545
|
+
] }) })
|
|
546
|
+
}
|
|
547
|
+
)
|
|
548
|
+
]
|
|
549
|
+
}
|
|
550
|
+
);
|
|
551
|
+
}
|
|
552
|
+
);
|
|
553
|
+
CheckoutSplitScreen.displayName = "CheckoutSplitScreen";
|
|
554
|
+
var columnClasses = {
|
|
555
|
+
2: "md:grid-cols-2 max-w-3xl",
|
|
556
|
+
3: "md:grid-cols-2 lg:grid-cols-3 max-w-5xl",
|
|
557
|
+
4: "md:grid-cols-2 lg:grid-cols-4 max-w-6xl"
|
|
558
|
+
};
|
|
559
|
+
var PricingGrid = react.forwardRef(
|
|
560
|
+
({ className, columns = 3, children, ...props }, ref) => {
|
|
561
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
562
|
+
"div",
|
|
563
|
+
{
|
|
564
|
+
ref,
|
|
565
|
+
className: cn(
|
|
566
|
+
"grid grid-cols-1 gap-6 items-start mx-auto",
|
|
567
|
+
columnClasses[columns],
|
|
568
|
+
className
|
|
569
|
+
),
|
|
570
|
+
...props,
|
|
571
|
+
children
|
|
572
|
+
}
|
|
573
|
+
);
|
|
574
|
+
}
|
|
575
|
+
);
|
|
576
|
+
PricingGrid.displayName = "PricingGrid";
|
|
577
|
+
|
|
578
|
+
exports.CheckoutCard = CheckoutCard;
|
|
579
|
+
exports.CheckoutDivider = CheckoutDivider;
|
|
580
|
+
exports.CheckoutFooter = CheckoutFooter;
|
|
581
|
+
exports.CheckoutFullScreen = CheckoutFullScreen;
|
|
582
|
+
exports.CheckoutHeader = CheckoutHeader;
|
|
583
|
+
exports.CheckoutSplitScreen = CheckoutSplitScreen;
|
|
584
|
+
exports.OrderSummary = OrderSummary;
|
|
585
|
+
exports.PaymentMethodIcon = PaymentMethodIcon;
|
|
586
|
+
exports.PricingCard = PricingCard;
|
|
587
|
+
exports.PricingGrid = PricingGrid;
|
|
588
|
+
exports.SecurityBadge = SecurityBadge;
|
|
589
|
+
exports.cn = cn;
|
|
590
|
+
exports.formatCurrency = formatCurrency;
|
|
591
|
+
exports.orderSummaryVariants = orderSummaryVariants;
|
|
592
|
+
exports.pricingCardVariants = pricingCardVariants;
|
|
593
|
+
exports.securityBadgeVariants = securityBadgeVariants;
|
|
594
|
+
//# sourceMappingURL=index.js.map
|
|
595
|
+
//# sourceMappingURL=index.js.map
|