@doujins/payments-ui 0.1.0 → 0.1.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/index.js CHANGED
@@ -77,18 +77,10 @@ var ensureFetch = (fetchImpl) => {
77
77
  var createClient = (config) => {
78
78
  const fetchImpl = ensureFetch(config.fetch);
79
79
  const normalizeBase = (value) => value.replace(/\/$/, "");
80
- const normalizePath = (value, fallback = "/v1") => {
81
- if (!value) return fallback;
82
- return value.startsWith("/") ? value : `/${value}`;
83
- };
84
80
  const billingBaseUrl = normalizeBase(config.billingBaseUrl);
85
81
  const accountBaseUrl = normalizeBase(
86
82
  config.accountBaseUrl ?? config.billingBaseUrl
87
83
  );
88
- const billingBasePath = normalizePath(config.billingBasePath ?? "/v1");
89
- const accountBasePath = normalizePath(
90
- config.accountBasePath ?? config.billingBasePath ?? "/v1"
91
- );
92
84
  const defaultHeaders = config.defaultHeaders ?? {};
93
85
  const resolveAuthToken = async () => {
94
86
  if (!config.getAuthToken) return null;
@@ -102,11 +94,8 @@ var createClient = (config) => {
102
94
  };
103
95
  const buildUrl = (path, query, target) => {
104
96
  const normalizedPath = path.startsWith("/") ? path : `/${path}`;
105
- const basePath = target === "account" ? accountBasePath : billingBasePath;
106
97
  const baseUrl = target === "account" ? accountBaseUrl : billingBaseUrl;
107
- const needsBasePrefix = !normalizedPath.startsWith(basePath);
108
- const finalPath = needsBasePrefix ? `${basePath}${normalizedPath}` : normalizedPath;
109
- const url = new URL(`${baseUrl}${finalPath}`);
98
+ const url = new URL(`${baseUrl}${normalizedPath}`);
110
99
  if (query) {
111
100
  Object.entries(query).forEach(([key, value]) => {
112
101
  if (value === void 0 || value === null) return;
@@ -163,7 +152,7 @@ var createClient = (config) => {
163
152
  async listPaymentMethods(params) {
164
153
  const result = await request(
165
154
  "GET",
166
- "/me/payment-methods",
155
+ "/v1/me/payment-methods",
167
156
  {
168
157
  query: {
169
158
  limit: params?.limit,
@@ -176,7 +165,7 @@ var createClient = (config) => {
176
165
  return normalizeList(result);
177
166
  },
178
167
  createPaymentMethod(payload) {
179
- return request("POST", "/me/payment-methods", {
168
+ return request("POST", "/v1/me/payment-methods", {
180
169
  body: payload,
181
170
  target: "account"
182
171
  });
@@ -198,17 +187,17 @@ var createClient = (config) => {
198
187
  });
199
188
  },
200
189
  checkout(payload) {
201
- return request("POST", "/me/checkout", {
190
+ return request("POST", "/v1/me/checkout", {
202
191
  body: payload
203
192
  });
204
193
  },
205
194
  cancelSubscription(feedback) {
206
- return request("POST", "/me/subscriptions/cancel", {
195
+ return request("POST", "/v1/me/subscriptions/cancel", {
207
196
  body: feedback ? { feedback } : void 0
208
197
  });
209
198
  },
210
199
  async getPaymentHistory(params) {
211
- const result = await request("GET", "/me/payments", {
200
+ const result = await request("GET", "/v1/me/payments", {
212
201
  query: {
213
202
  limit: params?.limit,
214
203
  offset: params?.offset,
@@ -220,7 +209,7 @@ var createClient = (config) => {
220
209
  async getSolanaTokens() {
221
210
  const response = await request(
222
211
  "GET",
223
- "/solana/tokens"
212
+ "/v1/solana/tokens"
224
213
  );
225
214
  if (Array.isArray(response)) {
226
215
  return response;
@@ -228,7 +217,7 @@ var createClient = (config) => {
228
217
  return response.tokens ?? [];
229
218
  },
230
219
  async createSolanaPayIntent(payload) {
231
- const response = await request("POST", "/solana/pay", {
220
+ const response = await request("POST", "/v1/solana/pay", {
232
221
  body: {
233
222
  price_id: payload.priceId,
234
223
  token: payload.token,
@@ -295,27 +284,27 @@ var DialogOverlay = React17.forwardRef(({ className, ...props }, ref) => /* @__P
295
284
  }
296
285
  ));
297
286
  DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
298
- var DialogContent = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(DialogPortal, { children: /* @__PURE__ */ jsxs("div", { className: "payments-ui-portal", children: [
287
+ var DialogContent = React17.forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsxs(DialogPortal, { children: [
299
288
  /* @__PURE__ */ jsx(DialogOverlay, {}),
300
289
  /* @__PURE__ */ jsxs(
301
290
  DialogPrimitive.Content,
302
291
  {
303
292
  ref,
304
293
  className: cn(
305
- "fixed left-[50%] top-[50%] z-50 grid w-[calc(100vw-40px)] sm:w-[calc(100vw-60px)] max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-white/10 bg-[#161b22] text-white p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] rounded-lg",
294
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
306
295
  className
307
296
  ),
308
297
  ...props,
309
298
  children: [
310
299
  children,
311
- /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-5 rounded-full bg-white/10 p-1 opacity-70 transition-opacity hover:opacity-100 hover:bg-white/20 focus:outline-none disabled:pointer-events-none", children: [
312
- /* @__PURE__ */ jsx(X, { className: "h-3 w-3 text-white" }),
300
+ /* @__PURE__ */ jsxs(DialogPrimitive.Close, { className: "absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground", children: [
301
+ /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }),
313
302
  /* @__PURE__ */ jsx("span", { className: "sr-only", children: "Close" })
314
303
  ] })
315
304
  ]
316
305
  }
317
306
  )
318
- ] }) }));
307
+ ] }));
319
308
  DialogContent.displayName = DialogPrimitive.Content.displayName;
320
309
  var DialogHeader = ({
321
310
  className,
@@ -347,7 +336,7 @@ var DialogDescription = React17.forwardRef(({ className, ...props }, ref) => /*
347
336
  DialogPrimitive.Description,
348
337
  {
349
338
  ref,
350
- className: cn("text-white/60 text-sm", className),
339
+ className: cn("text-sm text-muted-foreground", className),
351
340
  ...props
352
341
  }
353
342
  ));
@@ -368,16 +357,16 @@ var customCountries = [
368
357
  countryList.overwrite(customCountries);
369
358
  var countries = countryList.getData().sort((a, b) => a.name.localeCompare(b.name));
370
359
  var buttonVariants = cva(
371
- "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20 disabled:pointer-events-none disabled:opacity-50",
360
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
372
361
  {
373
362
  variants: {
374
363
  variant: {
375
- default: "bg-[#28a745] text-white shadow hover:bg-[#16a34a]",
376
- secondary: "bg-white/10 text-white hover:bg-white/20",
377
- outline: "border border-white/10 bg-transparent text-white hover:bg-white/10",
378
- ghost: "text-white/80 hover:bg-white/10 hover:text-white",
379
- destructive: "bg-red-600 text-white hover:bg-red-700",
380
- link: "text-blue-400 underline-offset-4 hover:underline"
364
+ default: "bg-primary text-primary-foreground hover:bg-primary/90",
365
+ destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
366
+ outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
367
+ secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
368
+ ghost: "hover:bg-accent hover:text-accent-foreground",
369
+ link: "text-primary underline-offset-4 hover:underline"
381
370
  },
382
371
  size: {
383
372
  default: "h-10 px-4 py-2",
@@ -413,7 +402,7 @@ var Input = React17.forwardRef(
413
402
  {
414
403
  type,
415
404
  className: cn(
416
- "flex h-10 w-full rounded-md border border-white/10 bg-white/5 px-3 py-2 text-sm text-white placeholder:text-white/40 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20 focus-visible:border-white/20 disabled:cursor-not-allowed disabled:opacity-50",
405
+ "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
417
406
  className
418
407
  ),
419
408
  ref,
@@ -423,14 +412,14 @@ var Input = React17.forwardRef(
423
412
  }
424
413
  );
425
414
  Input.displayName = "Input";
415
+ var labelVariants = cva(
416
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"
417
+ );
426
418
  var Label = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
427
419
  LabelPrimitive.Root,
428
420
  {
429
421
  ref,
430
- className: cn(
431
- "text-sm font-medium leading-none text-white peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
432
- className
433
- ),
422
+ className: cn(labelVariants(), className),
434
423
  ...props
435
424
  }
436
425
  ));
@@ -442,7 +431,7 @@ var SelectTrigger = React17.forwardRef(({ className, children, ...props }, ref)
442
431
  {
443
432
  ref,
444
433
  className: cn(
445
- "flex h-10 w-full items-center justify-between rounded-md border border-white/10 bg-white/5 px-3 py-2 text-sm text-white placeholder:text-white/40 focus:outline-none focus:ring-2 focus:ring-white/20 disabled:cursor-not-allowed disabled:opacity-50",
434
+ "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
446
435
  className
447
436
  ),
448
437
  ...props,
@@ -453,29 +442,65 @@ var SelectTrigger = React17.forwardRef(({ className, children, ...props }, ref)
453
442
  }
454
443
  ));
455
444
  SelectTrigger.displayName = SelectPrimitive.Trigger.displayName;
456
- var SelectContent = React17.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsx("div", { className: "payments-ui-portal", children: /* @__PURE__ */ jsxs(
445
+ var SelectScrollUpButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
446
+ SelectPrimitive.ScrollUpButton,
447
+ {
448
+ ref,
449
+ className: cn(
450
+ "flex cursor-default items-center justify-center py-1",
451
+ className
452
+ ),
453
+ ...props,
454
+ children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" })
455
+ }
456
+ ));
457
+ SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
458
+ var SelectScrollDownButton = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
459
+ SelectPrimitive.ScrollDownButton,
460
+ {
461
+ ref,
462
+ className: cn(
463
+ "flex cursor-default items-center justify-center py-1",
464
+ className
465
+ ),
466
+ ...props,
467
+ children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" })
468
+ }
469
+ ));
470
+ SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
471
+ var SelectContent = React17.forwardRef(({ className, children, position = "popper", ...props }, ref) => /* @__PURE__ */ jsx(SelectPrimitive.Portal, { children: /* @__PURE__ */ jsxs(
457
472
  SelectPrimitive.Content,
458
473
  {
459
474
  ref,
460
475
  className: cn(
461
- "relative z-50 min-w-[8rem] overflow-hidden rounded-md border border-white/10 bg-[#1a1f26] text-white shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
476
+ "relative z-50 max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-y-auto overflow-x-hidden rounded-md border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",
477
+ position === "popper" && "data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
462
478
  className
463
479
  ),
464
480
  position,
465
481
  ...props,
466
482
  children: [
467
- /* @__PURE__ */ jsx(SelectPrimitive.ScrollUpButton, { className: "flex cursor-default items-center justify-center py-1 text-white/60", children: /* @__PURE__ */ jsx(ChevronUp, { className: "h-4 w-4" }) }),
468
- /* @__PURE__ */ jsx(SelectPrimitive.Viewport, { className: "p-1", children }),
469
- /* @__PURE__ */ jsx(SelectPrimitive.ScrollDownButton, { className: "flex cursor-default items-center justify-center py-1 text-white/60", children: /* @__PURE__ */ jsx(ChevronDown, { className: "h-4 w-4" }) })
483
+ /* @__PURE__ */ jsx(SelectScrollUpButton, {}),
484
+ /* @__PURE__ */ jsx(
485
+ SelectPrimitive.Viewport,
486
+ {
487
+ className: cn(
488
+ "p-1",
489
+ position === "popper" && "h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"
490
+ ),
491
+ children
492
+ }
493
+ ),
494
+ /* @__PURE__ */ jsx(SelectScrollDownButton, {})
470
495
  ]
471
496
  }
472
- ) }) }));
497
+ ) }));
473
498
  SelectContent.displayName = SelectPrimitive.Content.displayName;
474
499
  var SelectLabel = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
475
500
  SelectPrimitive.Label,
476
501
  {
477
502
  ref,
478
- className: cn("px-2 py-1.5 text-sm font-semibold text-white/60", className),
503
+ className: cn("py-1.5 pl-8 pr-2 text-sm font-semibold", className),
479
504
  ...props
480
505
  }
481
506
  ));
@@ -485,7 +510,7 @@ var SelectItem = React17.forwardRef(({ className, children, ...props }, ref) =>
485
510
  {
486
511
  ref,
487
512
  className: cn(
488
- "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm text-white outline-none focus:bg-white/10 focus:text-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
513
+ "relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
489
514
  className
490
515
  ),
491
516
  ...props,
@@ -500,7 +525,7 @@ var SelectSeparator = React17.forwardRef(({ className, ...props }, ref) => /* @_
500
525
  SelectPrimitive.Separator,
501
526
  {
502
527
  ref,
503
- className: cn("mx-1 my-1 h-px bg-white/10", className),
528
+ className: cn("-mx-1 my-1 h-px bg-muted", className),
504
529
  ...props
505
530
  }
506
531
  ));
@@ -872,14 +897,14 @@ var usePaymentMethods = () => {
872
897
  };
873
898
  };
874
899
  var badgeVariants = cva(
875
- "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none",
900
+ "inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
876
901
  {
877
902
  variants: {
878
903
  variant: {
879
- default: "border-transparent bg-emerald-500/20 text-emerald-400",
880
- secondary: "border-transparent bg-white/10 text-white/70",
881
- outline: "border-white/20 text-white/80",
882
- destructive: "border-transparent bg-red-500/20 text-red-400"
904
+ default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
905
+ secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
906
+ destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
907
+ outline: "text-foreground"
883
908
  }
884
909
  },
885
910
  defaultVariants: {
@@ -912,7 +937,7 @@ var ScrollBar = React17.forwardRef(({ className, orientation = "vertical", ...pr
912
937
  className: cn(
913
938
  "flex touch-none select-none transition-colors",
914
939
  orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
915
- orientation === "horizontal" && "h-2.5 border-t border-t-transparent p-[1px]",
940
+ orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
916
941
  className
917
942
  ),
918
943
  ...props,
@@ -1047,7 +1072,7 @@ var TabsList = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__
1047
1072
  {
1048
1073
  ref,
1049
1074
  className: cn(
1050
- "inline-flex h-10 items-center justify-center rounded-md bg-white/5 border border-white/10 p-1 text-white/60",
1075
+ "inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",
1051
1076
  className
1052
1077
  ),
1053
1078
  ...props
@@ -1059,7 +1084,7 @@ var TabsTrigger = React17.forwardRef(({ className, ...props }, ref) => /* @__PUR
1059
1084
  {
1060
1085
  ref,
1061
1086
  className: cn(
1062
- "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-white/10 data-[state=active]:text-white data-[state=active]:shadow",
1087
+ "inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",
1063
1088
  className
1064
1089
  ),
1065
1090
  ...props
@@ -1071,7 +1096,7 @@ var TabsContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PUR
1071
1096
  {
1072
1097
  ref,
1073
1098
  className: cn(
1074
- "mt-2 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-white/20",
1099
+ "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
1075
1100
  className
1076
1101
  ),
1077
1102
  ...props
@@ -1302,16 +1327,17 @@ var useSolanaQrPayment = (options) => {
1302
1327
  refresh
1303
1328
  };
1304
1329
  };
1305
- var Card = React17.forwardRef(
1306
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1307
- "div",
1308
- {
1309
- ref,
1310
- className: cn("rounded-xl border border-white/10 bg-[#161b22] text-white shadow", className),
1311
- ...props
1312
- }
1313
- )
1314
- );
1330
+ var Card = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1331
+ "div",
1332
+ {
1333
+ ref,
1334
+ className: cn(
1335
+ "rounded-lg border bg-card text-card-foreground shadow-sm",
1336
+ className
1337
+ ),
1338
+ ...props
1339
+ }
1340
+ ));
1315
1341
  Card.displayName = "Card";
1316
1342
  var CardHeader = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1317
1343
  "div",
@@ -1322,11 +1348,26 @@ var CardHeader = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE
1322
1348
  }
1323
1349
  ));
1324
1350
  CardHeader.displayName = "CardHeader";
1325
- var CardTitle = React17.forwardRef(
1326
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx("h3", { ref, className: cn("text-xl font-semibold leading-none tracking-tight text-white", className), ...props })
1327
- );
1351
+ var CardTitle = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1352
+ "div",
1353
+ {
1354
+ ref,
1355
+ className: cn(
1356
+ "text-2xl font-semibold leading-none tracking-tight",
1357
+ className
1358
+ ),
1359
+ ...props
1360
+ }
1361
+ ));
1328
1362
  CardTitle.displayName = "CardTitle";
1329
- var CardDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("p", { ref, className: cn("text-sm text-white/60", className), ...props }));
1363
+ var CardDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
1364
+ "div",
1365
+ {
1366
+ ref,
1367
+ className: cn("text-sm text-muted-foreground", className),
1368
+ ...props
1369
+ }
1370
+ ));
1330
1371
  CardDescription.displayName = "CardDescription";
1331
1372
  var CardContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { ref, className: cn("p-6 pt-0", className), ...props }));
1332
1373
  CardContent.displayName = "CardContent";
@@ -2364,9 +2405,7 @@ var PaymentProvider = ({
2364
2405
  }) : void 0;
2365
2406
  return createClient({
2366
2407
  billingBaseUrl: config.endpoints.billingBaseUrl,
2367
- billingBasePath: config.endpoints.billingBasePath,
2368
2408
  accountBaseUrl: config.endpoints.accountBaseUrl,
2369
- accountBasePath: config.endpoints.accountBasePath,
2370
2409
  getAuthToken: authProvider,
2371
2410
  defaultHeaders: config.defaultHeaders,
2372
2411
  fetch: wrappedFetch
@@ -2409,7 +2448,7 @@ var usePaymentContext = () => {
2409
2448
  }
2410
2449
  return context;
2411
2450
  };
2412
- var PaymentsUIRoot = ({
2451
+ var BillingThemeProvider = ({
2413
2452
  children,
2414
2453
  className,
2415
2454
  dark = false
@@ -2426,7 +2465,7 @@ var PaymentsUIRoot = ({
2426
2465
  }
2427
2466
  );
2428
2467
  };
2429
- var PaymentsUIPortalRoot = ({
2468
+ var BillingThemePortal = ({
2430
2469
  children,
2431
2470
  className,
2432
2471
  dark = false
@@ -2450,51 +2489,79 @@ var SolanaPaymentSelector = ({
2450
2489
  }) => {
2451
2490
  return /* @__PURE__ */ jsx(Dialog, { open: isOpen, onOpenChange: (value) => value ? void 0 : onClose(), children: /* @__PURE__ */ jsx(DialogContent, { className: "w-full max-w-2xl max-h-[90vh] overflow-y-auto rounded-md border border-border/70 bg-background/95 p-0 shadow-2xl [&::-webkit-scrollbar]:hidden", children: /* @__PURE__ */ jsx(SolanaPaymentView, { ...props, onClose }) }) });
2452
2491
  };
2453
- var Table = React17.forwardRef(
2454
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2455
- "table",
2456
- {
2457
- ref,
2458
- className: cn("w-full caption-bottom text-sm", className),
2459
- ...props
2460
- }
2461
- )
2462
- );
2492
+ var Table = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("div", { className: "relative w-full overflow-auto", children: /* @__PURE__ */ jsx(
2493
+ "table",
2494
+ {
2495
+ ref,
2496
+ className: cn("w-full caption-bottom text-sm", className),
2497
+ ...props
2498
+ }
2499
+ ) }));
2463
2500
  Table.displayName = "Table";
2464
2501
  var TableHeader = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("thead", { ref, className: cn("[&_tr]:border-b", className), ...props }));
2465
2502
  TableHeader.displayName = "TableHeader";
2466
- var TableBody = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tbody", { ref, className: cn("[&_tr:last-child]:border-0", className), ...props }));
2503
+ var TableBody = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2504
+ "tbody",
2505
+ {
2506
+ ref,
2507
+ className: cn("[&_tr:last-child]:border-0", className),
2508
+ ...props
2509
+ }
2510
+ ));
2467
2511
  TableBody.displayName = "TableBody";
2468
- var TableFooter = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tfoot", { ref, className: cn("bg-muted/50 font-medium text-muted-foreground", className), ...props }));
2512
+ var TableFooter = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2513
+ "tfoot",
2514
+ {
2515
+ ref,
2516
+ className: cn(
2517
+ "border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",
2518
+ className
2519
+ ),
2520
+ ...props
2521
+ }
2522
+ ));
2469
2523
  TableFooter.displayName = "TableFooter";
2470
- var TableRow = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("tr", { ref, className: cn("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted", className), ...props }));
2524
+ var TableRow = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2525
+ "tr",
2526
+ {
2527
+ ref,
2528
+ className: cn(
2529
+ "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
2530
+ className
2531
+ ),
2532
+ ...props
2533
+ }
2534
+ ));
2471
2535
  TableRow.displayName = "TableRow";
2472
- var TableHead = React17.forwardRef(
2473
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2474
- "th",
2475
- {
2476
- ref,
2477
- className: cn(
2478
- "h-10 px-2 text-left align-middle text-xs font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",
2479
- className
2480
- ),
2481
- ...props
2482
- }
2483
- )
2484
- );
2536
+ var TableHead = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2537
+ "th",
2538
+ {
2539
+ ref,
2540
+ className: cn(
2541
+ "h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
2542
+ className
2543
+ ),
2544
+ ...props
2545
+ }
2546
+ ));
2485
2547
  TableHead.displayName = "TableHead";
2486
- var TableCell = React17.forwardRef(
2487
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2488
- "td",
2489
- {
2490
- ref,
2491
- className: cn("p-2 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]", className),
2492
- ...props
2493
- }
2494
- )
2495
- );
2548
+ var TableCell = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2549
+ "td",
2550
+ {
2551
+ ref,
2552
+ className: cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className),
2553
+ ...props
2554
+ }
2555
+ ));
2496
2556
  TableCell.displayName = "TableCell";
2497
- var TableCaption = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx("caption", { ref, className: cn("mt-4 text-sm text-muted-foreground", className), ...props }));
2557
+ var TableCaption = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2558
+ "caption",
2559
+ {
2560
+ ref,
2561
+ className: cn("mt-4 text-sm text-muted-foreground", className),
2562
+ ...props
2563
+ }
2564
+ ));
2498
2565
  TableCaption.displayName = "TableCaption";
2499
2566
  var AlertDialog = AlertDialogPrimitive.Root;
2500
2567
  var AlertDialogTrigger = AlertDialogPrimitive.Trigger;
@@ -2502,34 +2569,43 @@ var AlertDialogPortal = AlertDialogPrimitive.Portal;
2502
2569
  var AlertDialogOverlay = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2503
2570
  AlertDialogPrimitive.Overlay,
2504
2571
  {
2505
- ref,
2506
2572
  className: cn(
2507
- "fixed inset-0 z-50 bg-black/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0",
2573
+ "fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
2508
2574
  className
2509
2575
  ),
2510
- ...props
2576
+ ...props,
2577
+ ref
2511
2578
  }
2512
2579
  ));
2513
2580
  AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
2514
- var AlertDialogContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPortal, { children: /* @__PURE__ */ jsxs("div", { className: "payments-ui-portal", children: [
2581
+ var AlertDialogContent = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsxs(AlertDialogPortal, { children: [
2515
2582
  /* @__PURE__ */ jsx(AlertDialogOverlay, {}),
2516
2583
  /* @__PURE__ */ jsx(
2517
2584
  AlertDialogPrimitive.Content,
2518
2585
  {
2519
2586
  ref,
2520
2587
  className: cn(
2521
- "fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border border-white/10 bg-[#161b22] text-white p-6 shadow-lg rounded-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95",
2588
+ "fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
2522
2589
  className
2523
2590
  ),
2524
2591
  ...props
2525
2592
  }
2526
2593
  )
2527
- ] }) }));
2594
+ ] }));
2528
2595
  AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
2529
2596
  var AlertDialogHeader = ({
2530
2597
  className,
2531
2598
  ...props
2532
- }) => /* @__PURE__ */ jsx("div", { className: cn("flex flex-col space-y-2 text-center sm:text-left", className), ...props });
2599
+ }) => /* @__PURE__ */ jsx(
2600
+ "div",
2601
+ {
2602
+ className: cn(
2603
+ "flex flex-col space-y-2 text-center sm:text-left",
2604
+ className
2605
+ ),
2606
+ ...props
2607
+ }
2608
+ );
2533
2609
  AlertDialogHeader.displayName = "AlertDialogHeader";
2534
2610
  var AlertDialogFooter = ({
2535
2611
  className,
@@ -2537,39 +2613,67 @@ var AlertDialogFooter = ({
2537
2613
  }) => /* @__PURE__ */ jsx(
2538
2614
  "div",
2539
2615
  {
2540
- className: cn("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end sm:gap-2", className),
2616
+ className: cn(
2617
+ "flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
2618
+ className
2619
+ ),
2541
2620
  ...props
2542
2621
  }
2543
2622
  );
2544
2623
  AlertDialogFooter.displayName = "AlertDialogFooter";
2545
- var AlertDialogTitle = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, { ref, className: cn("text-lg font-semibold text-white", className), ...props }));
2624
+ var AlertDialogTitle = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2625
+ AlertDialogPrimitive.Title,
2626
+ {
2627
+ ref,
2628
+ className: cn("text-lg font-semibold", className),
2629
+ ...props
2630
+ }
2631
+ ));
2546
2632
  AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
2547
- var AlertDialogDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, { ref, className: cn("text-sm text-white/60", className), ...props }));
2633
+ var AlertDialogDescription = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2634
+ AlertDialogPrimitive.Description,
2635
+ {
2636
+ ref,
2637
+ className: cn("text-sm text-muted-foreground", className),
2638
+ ...props
2639
+ }
2640
+ ));
2548
2641
  AlertDialogDescription.displayName = AlertDialogPrimitive.Description.displayName;
2549
- var AlertDialogAction = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, { ref, className: cn(buttonVariants(), className), ...props }));
2642
+ var AlertDialogAction = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2643
+ AlertDialogPrimitive.Action,
2644
+ {
2645
+ ref,
2646
+ className: cn(buttonVariants(), className),
2647
+ ...props
2648
+ }
2649
+ ));
2550
2650
  AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
2551
2651
  var AlertDialogCancel = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2552
2652
  AlertDialogPrimitive.Cancel,
2553
2653
  {
2554
2654
  ref,
2555
- className: cn(buttonVariants({ variant: "outline" }), "mt-2 sm:mt-0", className),
2655
+ className: cn(
2656
+ buttonVariants({ variant: "outline" }),
2657
+ "mt-2 sm:mt-0",
2658
+ className
2659
+ ),
2556
2660
  ...props
2557
2661
  }
2558
2662
  ));
2559
2663
  AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName;
2560
- var Textarea = React17.forwardRef(
2561
- ({ className, ...props }, ref) => /* @__PURE__ */ jsx(
2664
+ var Textarea = React17.forwardRef(({ className, ...props }, ref) => {
2665
+ return /* @__PURE__ */ jsx(
2562
2666
  "textarea",
2563
2667
  {
2564
- ref,
2565
2668
  className: cn(
2566
- "flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
2669
+ "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
2567
2670
  className
2568
2671
  ),
2672
+ ref,
2569
2673
  ...props
2570
2674
  }
2571
- )
2572
- );
2675
+ );
2676
+ });
2573
2677
  Textarea.displayName = "Textarea";
2574
2678
  var notifyDefault = (payload) => {
2575
2679
  const level = payload.status === "destructive" ? "error" : "info";
@@ -3142,15 +3246,15 @@ var Checkbox = React17.forwardRef(({ className, ...props }, ref) => /* @__PURE__
3142
3246
  {
3143
3247
  ref,
3144
3248
  className: cn(
3145
- "peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
3249
+ "grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",
3146
3250
  className
3147
3251
  ),
3148
3252
  ...props,
3149
3253
  children: /* @__PURE__ */ jsx(
3150
3254
  CheckboxPrimitive.Indicator,
3151
3255
  {
3152
- className: cn("flex items-center justify-center text-current"),
3153
- children: /* @__PURE__ */ jsx(Check, { className: "h-3 w-3" })
3256
+ className: cn("grid place-content-center text-current"),
3257
+ children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" })
3154
3258
  }
3155
3259
  )
3156
3260
  }
@@ -3652,6 +3756,6 @@ var usePaymentStatus = (options = {}) => {
3652
3756
  };
3653
3757
  };
3654
3758
 
3655
- export { BillingHistory, CancelMembershipDialog, CardDetailsForm, ClientApiError, PaymentContext, PaymentExperience, PaymentMethodsSection, PaymentProvider, PaymentsDialogProvider, PaymentsUIPortalRoot, PaymentsUIRoot, SolanaPaymentSelector, SolanaPaymentView, StoredPaymentMethods, SubscriptionCheckoutModal, SubscriptionSuccessDialog, WalletDialog, WalletModal, createClient, usePaymentContext, usePaymentDialogs, usePaymentMethods, usePaymentNotifications, usePaymentStatus, useSolanaQrPayment, useSubscriptionActions, useSupportedTokens, useTokenBalance };
3759
+ export { BillingHistory, BillingThemePortal, BillingThemeProvider, CancelMembershipDialog, CardDetailsForm, ClientApiError, PaymentContext, PaymentExperience, PaymentMethodsSection, PaymentProvider, PaymentsDialogProvider, SolanaPaymentSelector, SolanaPaymentView, StoredPaymentMethods, SubscriptionCheckoutModal, SubscriptionSuccessDialog, WalletDialog, WalletModal, createClient, usePaymentContext, usePaymentDialogs, usePaymentMethods, usePaymentNotifications, usePaymentStatus, useSolanaQrPayment, useSubscriptionActions, useSupportedTokens, useTokenBalance };
3656
3760
  //# sourceMappingURL=index.js.map
3657
3761
  //# sourceMappingURL=index.js.map