@omnikit-js/ui 0.9.45 → 0.9.47
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/chunk-LIZKLYHH.js +2205 -0
- package/dist/chunk-LIZKLYHH.js.map +1 -0
- package/dist/{chunk-3AQCVPQI.js → chunk-SRPYYSJZ.js} +694 -34
- package/dist/chunk-SRPYYSJZ.js.map +1 -0
- package/dist/components/client/index.d.ts +61 -7
- package/dist/components/client/index.js +23 -35
- package/dist/components/client/index.js.map +1 -1
- package/dist/components/server/index.d.ts +2 -2
- package/dist/components/server/index.js +2 -2
- package/dist/index-Bp2ZenHB.d.ts +376 -0
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/{types-CnhWTSXv.d.ts → types-DAbudCAC.d.ts} +5 -3
- package/package.json +1 -1
- package/dist/chunk-3AQCVPQI.js.map +0 -1
- package/dist/chunk-FNZCGWVE.js +0 -531
- package/dist/chunk-FNZCGWVE.js.map +0 -1
- package/dist/index-DKuejSvz.d.ts +0 -83
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { AddPaymentMethodForm, BillingContent } from '../../chunk-
|
|
1
|
+
export { AddPaymentMethodForm, BillingContent, PaymentForm } from '../../chunk-SRPYYSJZ.js';
|
|
2
2
|
import { useState, useEffect, useRef, useCallback } from 'react';
|
|
3
3
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
4
|
-
import { Button, TextInput, Spinner } from '@marcoschwartz/lite-ui';
|
|
4
|
+
import { Button, TextInput, Spinner, ProgressBar } from '@marcoschwartz/lite-ui';
|
|
5
5
|
export { Button } from '@marcoschwartz/lite-ui';
|
|
6
6
|
|
|
7
7
|
function Tabs({ tabs, defaultTab, className = "" }) {
|
|
@@ -1252,7 +1252,7 @@ function FileUploader({
|
|
|
1252
1252
|
const isUploading = uploads.some((u) => u.status === "uploading");
|
|
1253
1253
|
const hasPendingFiles = uploads.some((u) => u.status === "pending");
|
|
1254
1254
|
return /* @__PURE__ */ jsxs("div", { className: `w-full ${className}`, children: [
|
|
1255
|
-
label && /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-
|
|
1255
|
+
label && /* @__PURE__ */ jsx("label", { className: "block text-sm font-medium text-[hsl(var(--foreground))] mb-2", children: label }),
|
|
1256
1256
|
/* @__PURE__ */ jsxs(
|
|
1257
1257
|
"div",
|
|
1258
1258
|
{
|
|
@@ -1262,7 +1262,7 @@ function FileUploader({
|
|
|
1262
1262
|
onClick: handleClick,
|
|
1263
1263
|
className: `
|
|
1264
1264
|
relative border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-all
|
|
1265
|
-
${isDragging ? "border-
|
|
1265
|
+
${isDragging ? "border-[hsl(var(--primary))] bg-[hsl(var(--primary))]/10" : "border-[hsl(var(--input))] hover:border-[hsl(var(--muted-foreground))]"}
|
|
1266
1266
|
${disabled ? "opacity-50 cursor-not-allowed" : ""}
|
|
1267
1267
|
`,
|
|
1268
1268
|
children: [
|
|
@@ -1279,13 +1279,13 @@ function FileUploader({
|
|
|
1279
1279
|
}
|
|
1280
1280
|
),
|
|
1281
1281
|
/* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center gap-2", children: [
|
|
1282
|
-
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-full bg-
|
|
1282
|
+
/* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-full bg-[hsl(var(--muted))] flex items-center justify-center", children: /* @__PURE__ */ jsx("svg", { className: "w-6 h-6 text-[hsl(var(--muted-foreground))]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12" }) }) }),
|
|
1283
1283
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
1284
|
-
/* @__PURE__ */ jsxs("p", { className: "text-sm font-medium text-
|
|
1285
|
-
/* @__PURE__ */ jsx("span", { className: "text-
|
|
1284
|
+
/* @__PURE__ */ jsxs("p", { className: "text-sm font-medium text-[hsl(var(--foreground))]", children: [
|
|
1285
|
+
/* @__PURE__ */ jsx("span", { className: "text-[hsl(var(--primary))]", children: "Click to upload" }),
|
|
1286
1286
|
" or drag and drop"
|
|
1287
1287
|
] }),
|
|
1288
|
-
/* @__PURE__ */ jsxs("p", { className: "text-xs text-
|
|
1288
|
+
/* @__PURE__ */ jsxs("p", { className: "text-xs text-[hsl(var(--muted-foreground))] mt-1", children: [
|
|
1289
1289
|
accept ? `Accepted: ${accept}` : "Any file type",
|
|
1290
1290
|
maxFileSize && ` \xB7 Max: ${formatFileSize(maxFileSize)}`
|
|
1291
1291
|
] })
|
|
@@ -1294,28 +1294,22 @@ function FileUploader({
|
|
|
1294
1294
|
]
|
|
1295
1295
|
}
|
|
1296
1296
|
),
|
|
1297
|
-
helperText && /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-
|
|
1298
|
-
showProgress && overallProgress && isUploading && overallProgress.totalFiles > 1 && /* @__PURE__ */ jsxs("div", { className: "mt-4 p-3 bg-
|
|
1297
|
+
helperText && /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-[hsl(var(--muted-foreground))]", children: helperText }),
|
|
1298
|
+
showProgress && overallProgress && isUploading && overallProgress.totalFiles > 1 && /* @__PURE__ */ jsxs("div", { className: "mt-4 p-3 bg-[hsl(var(--muted))] rounded-lg", children: [
|
|
1299
1299
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm mb-2", children: [
|
|
1300
|
-
/* @__PURE__ */ jsxs("span", { className: "text-
|
|
1300
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[hsl(var(--foreground))]", children: [
|
|
1301
1301
|
"Uploading ",
|
|
1302
1302
|
overallProgress.completedFiles + 1,
|
|
1303
1303
|
" of ",
|
|
1304
1304
|
overallProgress.totalFiles
|
|
1305
1305
|
] }),
|
|
1306
|
-
/* @__PURE__ */ jsxs("span", { className: "text-
|
|
1306
|
+
/* @__PURE__ */ jsxs("span", { className: "text-[hsl(var(--muted-foreground))]", children: [
|
|
1307
1307
|
overallProgress.percentage,
|
|
1308
1308
|
"%"
|
|
1309
1309
|
] })
|
|
1310
1310
|
] }),
|
|
1311
|
-
/* @__PURE__ */ jsx(
|
|
1312
|
-
|
|
1313
|
-
{
|
|
1314
|
-
className: "h-full bg-blue-600 dark:bg-neutral-300 transition-all duration-300",
|
|
1315
|
-
style: { width: `${overallProgress.percentage}%` }
|
|
1316
|
-
}
|
|
1317
|
-
) }),
|
|
1318
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-gray-500 dark:text-neutral-400 mt-1", children: [
|
|
1311
|
+
/* @__PURE__ */ jsx(ProgressBar, { value: overallProgress.percentage, size: "sm" }),
|
|
1312
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-[hsl(var(--muted-foreground))] mt-1", children: [
|
|
1319
1313
|
/* @__PURE__ */ jsxs("span", { children: [
|
|
1320
1314
|
formatFileSize(overallProgress.bytesUploaded),
|
|
1321
1315
|
" / ",
|
|
@@ -1327,35 +1321,29 @@ function FileUploader({
|
|
|
1327
1321
|
showFileList && uploads.length > 0 && /* @__PURE__ */ jsx("div", { className: "mt-4 space-y-2", children: uploads.map((upload) => /* @__PURE__ */ jsxs(
|
|
1328
1322
|
"div",
|
|
1329
1323
|
{
|
|
1330
|
-
className: "flex items-center gap-3 p-3 bg-
|
|
1324
|
+
className: "flex items-center gap-3 p-3 bg-[hsl(var(--muted))] rounded-lg border border-[hsl(var(--border))]",
|
|
1331
1325
|
children: [
|
|
1332
|
-
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded bg-
|
|
1326
|
+
/* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded bg-[hsl(var(--card))] flex items-center justify-center flex-shrink-0", children: upload.status === "uploading" ? /* @__PURE__ */ jsx(Spinner, { size: "sm" }) : upload.status === "completed" ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5 text-[hsl(var(--success))]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M5 13l4 4L19 7" }) }) : upload.status === "error" ? /* @__PURE__ */ jsx("svg", { className: "w-5 h-5 text-[hsl(var(--destructive))]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }) : /* @__PURE__ */ jsx("svg", { className: "w-5 h-5 text-[hsl(var(--muted-foreground))]", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z" }) }) }),
|
|
1333
1327
|
/* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
|
|
1334
|
-
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-
|
|
1335
|
-
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-
|
|
1328
|
+
/* @__PURE__ */ jsx("p", { className: "text-sm font-medium text-[hsl(var(--foreground))] truncate", children: upload.file.name }),
|
|
1329
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-[hsl(var(--muted-foreground))]", children: [
|
|
1336
1330
|
/* @__PURE__ */ jsx("span", { children: formatFileSize(upload.file.size) }),
|
|
1337
1331
|
upload.status === "uploading" && /* @__PURE__ */ jsxs("span", { children: [
|
|
1338
1332
|
"\xB7 ",
|
|
1339
1333
|
upload.progress,
|
|
1340
1334
|
"%"
|
|
1341
1335
|
] }),
|
|
1342
|
-
upload.status === "error" && /* @__PURE__ */ jsx("span", { className: "text-
|
|
1343
|
-
upload.file.size >= multipartThreshold && upload.status === "pending" && /* @__PURE__ */ jsx("span", { className: "text-
|
|
1336
|
+
upload.status === "error" && /* @__PURE__ */ jsx("span", { className: "text-[hsl(var(--destructive))]", children: upload.error }),
|
|
1337
|
+
upload.file.size >= multipartThreshold && upload.status === "pending" && /* @__PURE__ */ jsx("span", { className: "text-[hsl(var(--primary))]", children: "Multipart" })
|
|
1344
1338
|
] }),
|
|
1345
|
-
upload.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "
|
|
1346
|
-
"div",
|
|
1347
|
-
{
|
|
1348
|
-
className: "h-full bg-blue-600 dark:bg-neutral-300 transition-all duration-300",
|
|
1349
|
-
style: { width: `${upload.progress}%` }
|
|
1350
|
-
}
|
|
1351
|
-
) })
|
|
1339
|
+
upload.status === "uploading" && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsx(ProgressBar, { value: upload.progress, size: "sm" }) })
|
|
1352
1340
|
] }),
|
|
1353
1341
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 flex-shrink-0", children: [
|
|
1354
1342
|
upload.status === "error" && /* @__PURE__ */ jsx(
|
|
1355
1343
|
"button",
|
|
1356
1344
|
{
|
|
1357
1345
|
onClick: () => handleRetry(upload),
|
|
1358
|
-
className: "p-1 text-
|
|
1346
|
+
className: "p-1 text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--primary))] transition-colors",
|
|
1359
1347
|
title: "Retry",
|
|
1360
1348
|
children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" }) })
|
|
1361
1349
|
}
|
|
@@ -1364,7 +1352,7 @@ function FileUploader({
|
|
|
1364
1352
|
"button",
|
|
1365
1353
|
{
|
|
1366
1354
|
onClick: () => handleRemoveFile(upload.id),
|
|
1367
|
-
className: "p-1 text-
|
|
1355
|
+
className: "p-1 text-[hsl(var(--muted-foreground))] hover:text-[hsl(var(--destructive))] transition-colors",
|
|
1368
1356
|
title: "Remove",
|
|
1369
1357
|
children: /* @__PURE__ */ jsx("svg", { className: "w-4 h-4", fill: "none", stroke: "currentColor", viewBox: "0 0 24 24", children: /* @__PURE__ */ jsx("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) })
|
|
1370
1358
|
}
|