@elqnt/react 1.0.0 → 1.0.2

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.
@@ -0,0 +1,36 @@
1
+ // lib/utils.ts
2
+ import { clsx } from "clsx";
3
+ import { twMerge } from "tailwind-merge";
4
+ function cn(...inputs) {
5
+ return twMerge(clsx(inputs));
6
+ }
7
+ function getBadgeVariant(status) {
8
+ return status === "open" ? "default" : "secondary";
9
+ }
10
+
11
+ // components/form-controls/icon.tsx
12
+ import { icons } from "lucide-react";
13
+ import { memo } from "react";
14
+ import { jsx } from "react/jsx-runtime";
15
+ var Icon = memo(({ name, className, strokeWidth, size }) => {
16
+ const IconComponent = icons[name];
17
+ if (!IconComponent) {
18
+ return null;
19
+ }
20
+ return /* @__PURE__ */ jsx(
21
+ IconComponent,
22
+ {
23
+ className: cn(className),
24
+ strokeWidth: strokeWidth || 2.5,
25
+ size
26
+ }
27
+ );
28
+ });
29
+ Icon.displayName = "Icon";
30
+
31
+ export {
32
+ cn,
33
+ getBadgeVariant,
34
+ Icon
35
+ };
36
+ //# sourceMappingURL=chunk-FLTEIMWJ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../lib/utils.ts","../components/form-controls/icon.tsx"],"sourcesContent":["import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport function getBadgeVariant(status: string) {\n return status === \"open\" ? \"default\" : \"secondary\";\n}\n\n// export function getColspanByFieldType(fieldType: EntityFieldType) {\n// return fieldType === \"text\" ? \"col-span-2\" : \"\";\n// }\n","import { cn } from \"../../lib/utils\";\nimport { icons } from \"lucide-react\";\nimport { memo } from \"react\";\n\nexport type IconProps = {\n name: keyof typeof icons;\n size?: number;\n className?: string;\n strokeWidth?: number;\n};\n\nexport const Icon = memo(({ name, className, strokeWidth, size }: IconProps) => {\n const IconComponent = icons[name];\n\n if (!IconComponent) {\n return null;\n }\n\n return (\n <IconComponent\n className={cn(className)}\n strokeWidth={strokeWidth || 2.5}\n size={size}\n />\n );\n});\n\nIcon.displayName = \"Icon\";\n"],"mappings":";AAAA,SAA0B,YAAY;AACtC,SAAS,eAAe;AAEjB,SAAS,MAAM,QAAsB;AAC1C,SAAO,QAAQ,KAAK,MAAM,CAAC;AAC7B;AAEO,SAAS,gBAAgB,QAAgB;AAC9C,SAAO,WAAW,SAAS,YAAY;AACzC;;;ACRA,SAAS,aAAa;AACtB,SAAS,YAAY;AAiBjB;AARG,IAAM,OAAO,KAAK,CAAC,EAAE,MAAM,WAAW,aAAa,KAAK,MAAiB;AAC9E,QAAM,gBAAgB,MAAM,IAAI;AAEhC,MAAI,CAAC,eAAe;AAClB,WAAO;AAAA,EACT;AAEA,SACE;AAAA,IAAC;AAAA;AAAA,MACC,WAAW,GAAG,SAAS;AAAA,MACvB,aAAa,eAAe;AAAA,MAC5B;AAAA;AAAA,EACF;AAEJ,CAAC;AAED,KAAK,cAAc;","names":[]}
@@ -0,0 +1,122 @@
1
+ // components/upload/upload-actions.ts
2
+ import { BlobServiceClient } from "@azure/storage-blob";
3
+ import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
4
+ async function uploadFile(formData) {
5
+ try {
6
+ const file = formData.get("file");
7
+ if (!file) {
8
+ throw new Error("No file provided");
9
+ }
10
+ const STORAGE_CONNECTION_STRING = process.env.AZURE_STORAGE_CONNECTION_STRING;
11
+ const STORAGE_CONTAINER_NAME = process.env.AZURE_STORAGE_CONTAINER_NAME;
12
+ if (!STORAGE_CONNECTION_STRING || !STORAGE_CONTAINER_NAME) {
13
+ throw new Error(
14
+ "STORAGE_CONNECTION_STRING or STORAGE_CONTAINER_NAME not set"
15
+ );
16
+ }
17
+ const fileExtension = file.name.split(".").pop()?.toLowerCase();
18
+ const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;
19
+ const contentType = getContentType(fileExtension);
20
+ const buffer = Buffer.from(await file.arrayBuffer());
21
+ const blobServiceClient = BlobServiceClient.fromConnectionString(
22
+ STORAGE_CONNECTION_STRING
23
+ );
24
+ const containerClient = blobServiceClient.getContainerClient(
25
+ STORAGE_CONTAINER_NAME
26
+ );
27
+ await containerClient.createIfNotExists();
28
+ const blockBlobClient = containerClient.getBlockBlobClient(fileName);
29
+ await blockBlobClient.upload(buffer, buffer.length, {
30
+ blobHTTPHeaders: {
31
+ blobContentType: contentType
32
+ }
33
+ });
34
+ const fileUrl = blockBlobClient.url;
35
+ return { success: true, fileUrl };
36
+ } catch (error) {
37
+ console.error("Upload error:", error);
38
+ return {
39
+ success: false,
40
+ error: error instanceof Error ? error.message : "Failed to upload file"
41
+ };
42
+ }
43
+ }
44
+ function getContentType(fileExtension) {
45
+ if (!fileExtension) return "application/octet-stream";
46
+ const mimeTypes = {
47
+ // Images
48
+ png: "image/png",
49
+ jpg: "image/jpeg",
50
+ jpeg: "image/jpeg",
51
+ gif: "image/gif",
52
+ webp: "image/webp",
53
+ svg: "image/svg+xml",
54
+ // Documents
55
+ pdf: "application/pdf",
56
+ doc: "application/msword",
57
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
58
+ // Others
59
+ txt: "text/plain",
60
+ csv: "text/csv",
61
+ json: "application/json"
62
+ };
63
+ return mimeTypes[fileExtension] || "application/octet-stream";
64
+ }
65
+ async function uploadToS3(formData) {
66
+ try {
67
+ const file = formData.get("file");
68
+ if (!file) {
69
+ throw new Error("No file provided");
70
+ }
71
+ const AWS_ACCESS_KEY_ID = process.env.LINODE_ACCESS_KEY;
72
+ const AWS_SECRET_ACCESS_KEY = process.env.LINODE_SECRET_KEY;
73
+ const S3_BUCKET_NAME = process.env.LINODE_BUCKET_NAME;
74
+ let S3_ENDPOINT = process.env.LINODE_OBJECT_STORAGE_ENDPOINT;
75
+ if (!AWS_ACCESS_KEY_ID || !AWS_SECRET_ACCESS_KEY || !S3_BUCKET_NAME || !S3_ENDPOINT) {
76
+ throw new Error("S3 credentials or configuration not set");
77
+ }
78
+ const fileExtension = file.name.split(".").pop()?.toLowerCase();
79
+ const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;
80
+ const contentType = getContentType(fileExtension);
81
+ const buffer = Buffer.from(await file.arrayBuffer());
82
+ const s3Client = new S3Client({
83
+ endpoint: S3_ENDPOINT,
84
+ region: "us-east-1",
85
+ // Linode requires a region but it's not used with custom endpoint
86
+ credentials: {
87
+ accessKeyId: AWS_ACCESS_KEY_ID,
88
+ secretAccessKey: AWS_SECRET_ACCESS_KEY
89
+ },
90
+ forcePathStyle: true,
91
+ // Required for Linode Object Storage
92
+ maxAttempts: 3,
93
+ requestHandler: {
94
+ timeout: 1e4
95
+ // 10 seconds timeout
96
+ }
97
+ });
98
+ const command = new PutObjectCommand({
99
+ Bucket: S3_BUCKET_NAME,
100
+ Key: fileName,
101
+ Body: buffer,
102
+ ContentType: contentType,
103
+ ACL: "public-read"
104
+ // Make the object publicly readable
105
+ });
106
+ await s3Client.send(command);
107
+ const fileUrl = `${S3_ENDPOINT}/${S3_BUCKET_NAME}/${fileName}`;
108
+ return { success: true, fileUrl };
109
+ } catch (error) {
110
+ console.error("Upload error:", JSON.stringify(error, null, 2));
111
+ return {
112
+ success: false,
113
+ error: error instanceof Error ? error.message : "Failed to upload file"
114
+ };
115
+ }
116
+ }
117
+
118
+ export {
119
+ uploadFile,
120
+ uploadToS3
121
+ };
122
+ //# sourceMappingURL=chunk-UXJQ7CBV.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../components/upload/upload-actions.ts"],"sourcesContent":["\"use server\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport { PutObjectCommand, S3Client } from \"@aws-sdk/client-s3\";\n\n\nexport async function uploadFile(formData: FormData) {\n try {\n const file = formData.get(\"file\") as File;\n if (!file) {\n throw new Error(\"No file provided\");\n }\n\n const STORAGE_CONNECTION_STRING =\n process.env.AZURE_STORAGE_CONNECTION_STRING;\n const STORAGE_CONTAINER_NAME = process.env.AZURE_STORAGE_CONTAINER_NAME;\n\n if (!STORAGE_CONNECTION_STRING || !STORAGE_CONTAINER_NAME) {\n throw new Error(\n \"STORAGE_CONNECTION_STRING or STORAGE_CONTAINER_NAME not set\"\n );\n }\n\n // Generate unique filename\n const fileExtension = file.name.split(\".\").pop()?.toLowerCase();\n const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;\n\n // Determine content type based on file extension\n const contentType = getContentType(fileExtension);\n\n // Convert file to buffer\n const buffer = Buffer.from(await file.arrayBuffer());\n\n // Upload to Azure Blob Storage\n const blobServiceClient = BlobServiceClient.fromConnectionString(\n STORAGE_CONNECTION_STRING\n );\n const containerClient = blobServiceClient.getContainerClient(\n STORAGE_CONTAINER_NAME\n );\n\n // Create container if it doesn't exist\n await containerClient.createIfNotExists();\n\n // Upload file with content type\n const blockBlobClient = containerClient.getBlockBlobClient(fileName);\n await blockBlobClient.upload(buffer, buffer.length, {\n blobHTTPHeaders: {\n blobContentType: contentType,\n },\n });\n\n // Get the URL\n const fileUrl = blockBlobClient.url;\n\n return { success: true, fileUrl };\n } catch (error) {\n console.error(\"Upload error:\", error);\n return {\n success: false,\n error: error instanceof Error ? error.message : \"Failed to upload file\",\n };\n }\n}\n\nfunction getContentType(fileExtension: string | undefined): string {\n if (!fileExtension) return \"application/octet-stream\";\n\n const mimeTypes: Record<string, string> = {\n // Images\n png: \"image/png\",\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n gif: \"image/gif\",\n webp: \"image/webp\",\n svg: \"image/svg+xml\",\n // Documents\n pdf: \"application/pdf\",\n doc: \"application/msword\",\n docx: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n // Others\n txt: \"text/plain\",\n csv: \"text/csv\",\n json: \"application/json\",\n };\n\n return mimeTypes[fileExtension] || \"application/octet-stream\";\n}\n\nexport async function uploadToS3(formData: FormData) {\n try {\n const file = formData.get(\"file\") as File;\n if (!file) {\n throw new Error(\"No file provided\");\n }\n\n const AWS_ACCESS_KEY_ID = process.env.LINODE_ACCESS_KEY;\n const AWS_SECRET_ACCESS_KEY = process.env.LINODE_SECRET_KEY;\n const S3_BUCKET_NAME = process.env.LINODE_BUCKET_NAME;\n let S3_ENDPOINT = process.env.LINODE_OBJECT_STORAGE_ENDPOINT;\n\n if (\n !AWS_ACCESS_KEY_ID ||\n !AWS_SECRET_ACCESS_KEY ||\n !S3_BUCKET_NAME ||\n !S3_ENDPOINT\n ) {\n throw new Error(\"S3 credentials or configuration not set\");\n }\n\n // Generate unique filename\n const fileExtension = file.name.split(\".\").pop()?.toLowerCase();\n const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;\n\n // Determine content type based on file extension\n const contentType = getContentType(fileExtension);\n\n // Convert file to buffer\n const buffer = Buffer.from(await file.arrayBuffer());\n\n // Initialize S3 client\n const s3Client = new S3Client({\n endpoint: S3_ENDPOINT,\n region: \"us-east-1\", // Linode requires a region but it's not used with custom endpoint\n credentials: {\n accessKeyId: AWS_ACCESS_KEY_ID,\n secretAccessKey: AWS_SECRET_ACCESS_KEY,\n },\n forcePathStyle: true, // Required for Linode Object Storage\n maxAttempts: 3,\n requestHandler: {\n timeout: 10000, // 10 seconds timeout\n },\n });\n\n // Upload to S3\n const command = new PutObjectCommand({\n Bucket: S3_BUCKET_NAME,\n Key: fileName,\n Body: buffer,\n ContentType: contentType,\n ACL: \"public-read\", // Make the object publicly readable\n });\n\n await s3Client.send(command);\n\n // Construct the URL using the endpoint\n const fileUrl = `${S3_ENDPOINT}/${S3_BUCKET_NAME}/${fileName}`;\n\n return { success: true, fileUrl };\n } catch (error) {\n console.error(\"Upload error:\", JSON.stringify(error, null, 2));\n return {\n success: false,\n error: error instanceof Error ? error.message : \"Failed to upload file\",\n };\n }\n}\n"],"mappings":";AACA,SAAS,yBAAyB;AAClC,SAAS,kBAAkB,gBAAgB;AAG3C,eAAsB,WAAW,UAAoB;AACnD,MAAI;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O;AAG3B,UAAM,UAAU,GAAG,WAAW,IAAI,cAAc,IAAI,QAAQ;AAE5D,WAAO,EAAE,SAAS,MAAM,QAAQ;AAAA,EAClC,SAAS,OAAO;AACd,YAAQ,MAAM,iBAAiB,KAAK,UAAU,OAAO,MAAM,CAAC,CAAC;AAC7D,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO,iBAAiB,QAAQ,MAAM,UAAU;AAAA,IAClD;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,122 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }// components/upload/upload-actions.ts
2
+ var _storageblob = require('@azure/storage-blob');
3
+ var _clients3 = require('@aws-sdk/client-s3');
4
+ async function uploadFile(formData) {
5
+ try {
6
+ const file = formData.get("file");
7
+ if (!file) {
8
+ throw new Error("No file provided");
9
+ }
10
+ const STORAGE_CONNECTION_STRING = process.env.AZURE_STORAGE_CONNECTION_STRING;
11
+ const STORAGE_CONTAINER_NAME = process.env.AZURE_STORAGE_CONTAINER_NAME;
12
+ if (!STORAGE_CONNECTION_STRING || !STORAGE_CONTAINER_NAME) {
13
+ throw new Error(
14
+ "STORAGE_CONNECTION_STRING or STORAGE_CONTAINER_NAME not set"
15
+ );
16
+ }
17
+ const fileExtension = _optionalChain([file, 'access', _ => _.name, 'access', _2 => _2.split, 'call', _3 => _3("."), 'access', _4 => _4.pop, 'call', _5 => _5(), 'optionalAccess', _6 => _6.toLowerCase, 'call', _7 => _7()]);
18
+ const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;
19
+ const contentType = getContentType(fileExtension);
20
+ const buffer = Buffer.from(await file.arrayBuffer());
21
+ const blobServiceClient = _storageblob.BlobServiceClient.fromConnectionString(
22
+ STORAGE_CONNECTION_STRING
23
+ );
24
+ const containerClient = blobServiceClient.getContainerClient(
25
+ STORAGE_CONTAINER_NAME
26
+ );
27
+ await containerClient.createIfNotExists();
28
+ const blockBlobClient = containerClient.getBlockBlobClient(fileName);
29
+ await blockBlobClient.upload(buffer, buffer.length, {
30
+ blobHTTPHeaders: {
31
+ blobContentType: contentType
32
+ }
33
+ });
34
+ const fileUrl = blockBlobClient.url;
35
+ return { success: true, fileUrl };
36
+ } catch (error) {
37
+ console.error("Upload error:", error);
38
+ return {
39
+ success: false,
40
+ error: error instanceof Error ? error.message : "Failed to upload file"
41
+ };
42
+ }
43
+ }
44
+ function getContentType(fileExtension) {
45
+ if (!fileExtension) return "application/octet-stream";
46
+ const mimeTypes = {
47
+ // Images
48
+ png: "image/png",
49
+ jpg: "image/jpeg",
50
+ jpeg: "image/jpeg",
51
+ gif: "image/gif",
52
+ webp: "image/webp",
53
+ svg: "image/svg+xml",
54
+ // Documents
55
+ pdf: "application/pdf",
56
+ doc: "application/msword",
57
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
58
+ // Others
59
+ txt: "text/plain",
60
+ csv: "text/csv",
61
+ json: "application/json"
62
+ };
63
+ return mimeTypes[fileExtension] || "application/octet-stream";
64
+ }
65
+ async function uploadToS3(formData) {
66
+ try {
67
+ const file = formData.get("file");
68
+ if (!file) {
69
+ throw new Error("No file provided");
70
+ }
71
+ const AWS_ACCESS_KEY_ID = process.env.LINODE_ACCESS_KEY;
72
+ const AWS_SECRET_ACCESS_KEY = process.env.LINODE_SECRET_KEY;
73
+ const S3_BUCKET_NAME = process.env.LINODE_BUCKET_NAME;
74
+ let S3_ENDPOINT = process.env.LINODE_OBJECT_STORAGE_ENDPOINT;
75
+ if (!AWS_ACCESS_KEY_ID || !AWS_SECRET_ACCESS_KEY || !S3_BUCKET_NAME || !S3_ENDPOINT) {
76
+ throw new Error("S3 credentials or configuration not set");
77
+ }
78
+ const fileExtension = _optionalChain([file, 'access', _8 => _8.name, 'access', _9 => _9.split, 'call', _10 => _10("."), 'access', _11 => _11.pop, 'call', _12 => _12(), 'optionalAccess', _13 => _13.toLowerCase, 'call', _14 => _14()]);
79
+ const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;
80
+ const contentType = getContentType(fileExtension);
81
+ const buffer = Buffer.from(await file.arrayBuffer());
82
+ const s3Client = new (0, _clients3.S3Client)({
83
+ endpoint: S3_ENDPOINT,
84
+ region: "us-east-1",
85
+ // Linode requires a region but it's not used with custom endpoint
86
+ credentials: {
87
+ accessKeyId: AWS_ACCESS_KEY_ID,
88
+ secretAccessKey: AWS_SECRET_ACCESS_KEY
89
+ },
90
+ forcePathStyle: true,
91
+ // Required for Linode Object Storage
92
+ maxAttempts: 3,
93
+ requestHandler: {
94
+ timeout: 1e4
95
+ // 10 seconds timeout
96
+ }
97
+ });
98
+ const command = new (0, _clients3.PutObjectCommand)({
99
+ Bucket: S3_BUCKET_NAME,
100
+ Key: fileName,
101
+ Body: buffer,
102
+ ContentType: contentType,
103
+ ACL: "public-read"
104
+ // Make the object publicly readable
105
+ });
106
+ await s3Client.send(command);
107
+ const fileUrl = `${S3_ENDPOINT}/${S3_BUCKET_NAME}/${fileName}`;
108
+ return { success: true, fileUrl };
109
+ } catch (error) {
110
+ console.error("Upload error:", JSON.stringify(error, null, 2));
111
+ return {
112
+ success: false,
113
+ error: error instanceof Error ? error.message : "Failed to upload file"
114
+ };
115
+ }
116
+ }
117
+
118
+
119
+
120
+
121
+ exports.uploadFile = uploadFile; exports.uploadToS3 = uploadToS3;
122
+ //# sourceMappingURL=chunk-W4AIK44N.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/react/dist/chunk-W4AIK44N.js","../components/upload/upload-actions.ts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;AACW,IAAA;AACF,IAAA;AACO,MAAA;AAClB,IAAA;AAEM,IAAA;AACA,IAAA;AACA,IAAA;AACY,IAAA;AAGf,IAAA;AAKe,MAAA;AAClB,IAAA;AAGM,IAAA;AACW,IAAA;AAGX,IAAA;AAGS,IAAA;AAGE,IAAA;AACL,MAAA;AACF,MAAA;AAAA;AACK,MAAA;AACE,QAAA;AACb,QAAA;AACF,MAAA;AACgB,MAAA;AAAA;AACH,MAAA;AACG,MAAA;AACL,QAAA;AAAA;AACX,MAAA;AACD,IAAA;AAGe,IAAA;AACN,MAAA;AACH,MAAA;AACC,MAAA;AACO,MAAA;AACR,MAAA;AAAA;AACN,IAAA;AAEc,IAAA;AAGC,IAAA;AAEE,IAAA;AACJ,EAAA;AACA,IAAA;AACP,IAAA;AACI,MAAA;AACF,MAAA;AACT,IAAA;AACF,EAAA;AACF;ADxCsB;AACA;AACA;AACA;AACA","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/react/dist/chunk-W4AIK44N.js","sourcesContent":[null,"\"use server\";\nimport { BlobServiceClient } from \"@azure/storage-blob\";\nimport { PutObjectCommand, S3Client } from \"@aws-sdk/client-s3\";\n\n\nexport async function uploadFile(formData: FormData) {\n try {\n const file = formData.get(\"file\") as File;\n if (!file) {\n throw new Error(\"No file provided\");\n }\n\n const STORAGE_CONNECTION_STRING =\n process.env.AZURE_STORAGE_CONNECTION_STRING;\n const STORAGE_CONTAINER_NAME = process.env.AZURE_STORAGE_CONTAINER_NAME;\n\n if (!STORAGE_CONNECTION_STRING || !STORAGE_CONTAINER_NAME) {\n throw new Error(\n \"STORAGE_CONNECTION_STRING or STORAGE_CONTAINER_NAME not set\"\n );\n }\n\n // Generate unique filename\n const fileExtension = file.name.split(\".\").pop()?.toLowerCase();\n const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;\n\n // Determine content type based on file extension\n const contentType = getContentType(fileExtension);\n\n // Convert file to buffer\n const buffer = Buffer.from(await file.arrayBuffer());\n\n // Upload to Azure Blob Storage\n const blobServiceClient = BlobServiceClient.fromConnectionString(\n STORAGE_CONNECTION_STRING\n );\n const containerClient = blobServiceClient.getContainerClient(\n STORAGE_CONTAINER_NAME\n );\n\n // Create container if it doesn't exist\n await containerClient.createIfNotExists();\n\n // Upload file with content type\n const blockBlobClient = containerClient.getBlockBlobClient(fileName);\n await blockBlobClient.upload(buffer, buffer.length, {\n blobHTTPHeaders: {\n blobContentType: contentType,\n },\n });\n\n // Get the URL\n const fileUrl = blockBlobClient.url;\n\n return { success: true, fileUrl };\n } catch (error) {\n console.error(\"Upload error:\", error);\n return {\n success: false,\n error: error instanceof Error ? error.message : \"Failed to upload file\",\n };\n }\n}\n\nfunction getContentType(fileExtension: string | undefined): string {\n if (!fileExtension) return \"application/octet-stream\";\n\n const mimeTypes: Record<string, string> = {\n // Images\n png: \"image/png\",\n jpg: \"image/jpeg\",\n jpeg: \"image/jpeg\",\n gif: \"image/gif\",\n webp: \"image/webp\",\n svg: \"image/svg+xml\",\n // Documents\n pdf: \"application/pdf\",\n doc: \"application/msword\",\n docx: \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\",\n // Others\n txt: \"text/plain\",\n csv: \"text/csv\",\n json: \"application/json\",\n };\n\n return mimeTypes[fileExtension] || \"application/octet-stream\";\n}\n\nexport async function uploadToS3(formData: FormData) {\n try {\n const file = formData.get(\"file\") as File;\n if (!file) {\n throw new Error(\"No file provided\");\n }\n\n const AWS_ACCESS_KEY_ID = process.env.LINODE_ACCESS_KEY;\n const AWS_SECRET_ACCESS_KEY = process.env.LINODE_SECRET_KEY;\n const S3_BUCKET_NAME = process.env.LINODE_BUCKET_NAME;\n let S3_ENDPOINT = process.env.LINODE_OBJECT_STORAGE_ENDPOINT;\n\n if (\n !AWS_ACCESS_KEY_ID ||\n !AWS_SECRET_ACCESS_KEY ||\n !S3_BUCKET_NAME ||\n !S3_ENDPOINT\n ) {\n throw new Error(\"S3 credentials or configuration not set\");\n }\n\n // Generate unique filename\n const fileExtension = file.name.split(\".\").pop()?.toLowerCase();\n const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;\n\n // Determine content type based on file extension\n const contentType = getContentType(fileExtension);\n\n // Convert file to buffer\n const buffer = Buffer.from(await file.arrayBuffer());\n\n // Initialize S3 client\n const s3Client = new S3Client({\n endpoint: S3_ENDPOINT,\n region: \"us-east-1\", // Linode requires a region but it's not used with custom endpoint\n credentials: {\n accessKeyId: AWS_ACCESS_KEY_ID,\n secretAccessKey: AWS_SECRET_ACCESS_KEY,\n },\n forcePathStyle: true, // Required for Linode Object Storage\n maxAttempts: 3,\n requestHandler: {\n timeout: 10000, // 10 seconds timeout\n },\n });\n\n // Upload to S3\n const command = new PutObjectCommand({\n Bucket: S3_BUCKET_NAME,\n Key: fileName,\n Body: buffer,\n ContentType: contentType,\n ACL: \"public-read\", // Make the object publicly readable\n });\n\n await s3Client.send(command);\n\n // Construct the URL using the endpoint\n const fileUrl = `${S3_ENDPOINT}/${S3_BUCKET_NAME}/${fileName}`;\n\n return { success: true, fileUrl };\n } catch (error) {\n console.error(\"Upload error:\", JSON.stringify(error, null, 2));\n return {\n success: false,\n error: error instanceof Error ? error.message : \"Failed to upload file\",\n };\n }\n}\n"]}
@@ -0,0 +1,36 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// lib/utils.ts
2
+ var _clsx = require('clsx');
3
+ var _tailwindmerge = require('tailwind-merge');
4
+ function cn(...inputs) {
5
+ return _tailwindmerge.twMerge.call(void 0, _clsx.clsx.call(void 0, inputs));
6
+ }
7
+ function getBadgeVariant(status) {
8
+ return status === "open" ? "default" : "secondary";
9
+ }
10
+
11
+ // components/form-controls/icon.tsx
12
+ var _lucidereact = require('lucide-react');
13
+ var _react = require('react');
14
+ var _jsxruntime = require('react/jsx-runtime');
15
+ var Icon = _react.memo.call(void 0, ({ name, className, strokeWidth, size }) => {
16
+ const IconComponent = _lucidereact.icons[name];
17
+ if (!IconComponent) {
18
+ return null;
19
+ }
20
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
21
+ IconComponent,
22
+ {
23
+ className: cn(className),
24
+ strokeWidth: strokeWidth || 2.5,
25
+ size
26
+ }
27
+ );
28
+ });
29
+ Icon.displayName = "Icon";
30
+
31
+
32
+
33
+
34
+
35
+ exports.cn = cn; exports.getBadgeVariant = getBadgeVariant; exports.Icon = Icon;
36
+ //# sourceMappingURL=chunk-ZCBGKBZS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/react/dist/chunk-ZCBGKBZS.js","../lib/utils.ts","../components/form-controls/icon.tsx"],"names":[],"mappings":"AAAA;ACAA,4BAAsC;AACtC,+CAAwB;AAEjB,SAAS,EAAA,CAAA,GAAM,MAAA,EAAsB;AAC1C,EAAA,OAAO,oCAAA,wBAAQ,MAAW,CAAC,CAAA;AAC7B;AAEO,SAAS,eAAA,CAAgB,MAAA,EAAgB;AAC9C,EAAA,OAAO,OAAA,IAAW,OAAA,EAAS,UAAA,EAAY,WAAA;AACzC;ADAA;AACA;AETA,2CAAsB;AACtB,8BAAqB;AAiBjB,+CAAA;AARG,IAAM,KAAA,EAAO,yBAAA,CAAM,EAAE,IAAA,EAAM,SAAA,EAAW,WAAA,EAAa,KAAK,CAAA,EAAA,GAAiB;AAC9E,EAAA,MAAM,cAAA,EAAgB,kBAAA,CAAM,IAAI,CAAA;AAEhC,EAAA,GAAA,CAAI,CAAC,aAAA,EAAe;AAClB,IAAA,OAAO,IAAA;AAAA,EACT;AAEA,EAAA,uBACE,6BAAA;AAAA,IAAC,aAAA;AAAA,IAAA;AAAA,MACC,SAAA,EAAW,EAAA,CAAG,SAAS,CAAA;AAAA,MACvB,WAAA,EAAa,YAAA,GAAe,GAAA;AAAA,MAC5B;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAC,CAAA;AAED,IAAA,CAAK,YAAA,EAAc,MAAA;AFEnB;AACA;AACE;AACA;AACA;AACF,gFAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/react/dist/chunk-ZCBGKBZS.js","sourcesContent":[null,"import { type ClassValue, clsx } from \"clsx\";\nimport { twMerge } from \"tailwind-merge\";\n\nexport function cn(...inputs: ClassValue[]) {\n return twMerge(clsx(inputs));\n}\n\nexport function getBadgeVariant(status: string) {\n return status === \"open\" ? \"default\" : \"secondary\";\n}\n\n// export function getColspanByFieldType(fieldType: EntityFieldType) {\n// return fieldType === \"text\" ? \"col-span-2\" : \"\";\n// }\n","import { cn } from \"../../lib/utils\";\nimport { icons } from \"lucide-react\";\nimport { memo } from \"react\";\n\nexport type IconProps = {\n name: keyof typeof icons;\n size?: number;\n className?: string;\n strokeWidth?: number;\n};\n\nexport const Icon = memo(({ name, className, strokeWidth, size }: IconProps) => {\n const IconComponent = icons[name];\n\n if (!IconComponent) {\n return null;\n }\n\n return (\n <IconComponent\n className={cn(className)}\n strokeWidth={strokeWidth || 2.5}\n size={size}\n />\n );\n});\n\nIcon.displayName = \"Icon\";\n"]}
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { icons } from 'lucide-react';
4
+
5
+ type IconProps = {
6
+ name: keyof typeof icons;
7
+ size?: number;
8
+ className?: string;
9
+ strokeWidth?: number;
10
+ };
11
+ declare const Icon: React.MemoExoticComponent<({ name, className, strokeWidth, size }: IconProps) => react_jsx_runtime.JSX.Element | null>;
12
+
13
+ export { Icon, type IconProps };
@@ -0,0 +1,13 @@
1
+ import * as React from 'react';
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import { icons } from 'lucide-react';
4
+
5
+ type IconProps = {
6
+ name: keyof typeof icons;
7
+ size?: number;
8
+ className?: string;
9
+ strokeWidth?: number;
10
+ };
11
+ declare const Icon: React.MemoExoticComponent<({ name, className, strokeWidth, size }: IconProps) => react_jsx_runtime.JSX.Element | null>;
12
+
13
+ export { Icon, type IconProps };
@@ -0,0 +1,7 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+ var _chunkZCBGKBZSjs = require('../../chunk-ZCBGKBZS.js');
4
+
5
+
6
+ exports.Icon = _chunkZCBGKBZSjs.Icon;
7
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/react/dist/components/form-controls/icon.js"],"names":[],"mappings":"AAAA;AACE;AACF,0DAAgC;AAChC;AACE;AACF,qCAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/react/dist/components/form-controls/icon.js"}
@@ -0,0 +1,7 @@
1
+ import {
2
+ Icon
3
+ } from "../../chunk-FLTEIMWJ.mjs";
4
+ export {
5
+ Icon
6
+ };
7
+ //# sourceMappingURL=icon.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,20 @@
1
+ declare function uploadFile(formData: FormData): Promise<{
2
+ success: boolean;
3
+ fileUrl: string;
4
+ error?: undefined;
5
+ } | {
6
+ success: boolean;
7
+ error: string;
8
+ fileUrl?: undefined;
9
+ }>;
10
+ declare function uploadToS3(formData: FormData): Promise<{
11
+ success: boolean;
12
+ fileUrl: string;
13
+ error?: undefined;
14
+ } | {
15
+ success: boolean;
16
+ error: string;
17
+ fileUrl?: undefined;
18
+ }>;
19
+
20
+ export { uploadFile, uploadToS3 };
@@ -0,0 +1,20 @@
1
+ declare function uploadFile(formData: FormData): Promise<{
2
+ success: boolean;
3
+ fileUrl: string;
4
+ error?: undefined;
5
+ } | {
6
+ success: boolean;
7
+ error: string;
8
+ fileUrl?: undefined;
9
+ }>;
10
+ declare function uploadToS3(formData: FormData): Promise<{
11
+ success: boolean;
12
+ fileUrl: string;
13
+ error?: undefined;
14
+ } | {
15
+ success: boolean;
16
+ error: string;
17
+ fileUrl?: undefined;
18
+ }>;
19
+
20
+ export { uploadFile, uploadToS3 };
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});"use server";
2
+
3
+
4
+
5
+ var _chunkW4AIK44Njs = require('../../chunk-W4AIK44N.js');
6
+
7
+
8
+
9
+ exports.uploadFile = _chunkW4AIK44Njs.uploadFile; exports.uploadToS3 = _chunkW4AIK44Njs.uploadToS3;
10
+ //# sourceMappingURL=upload-actions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/work/eloquent-packages/eloquent-packages/packages/react/dist/components/upload/upload-actions.js"],"names":[],"mappings":"AAAA,qFAAY;AACZ;AACE;AACA;AACF,0DAAgC;AAChC;AACE;AACA;AACF,mGAAC","file":"/home/runner/work/eloquent-packages/eloquent-packages/packages/react/dist/components/upload/upload-actions.js"}
@@ -0,0 +1,10 @@
1
+ "use server";
2
+ import {
3
+ uploadFile,
4
+ uploadToS3
5
+ } from "../../chunk-UXJQ7CBV.mjs";
6
+ export {
7
+ uploadFile,
8
+ uploadToS3
9
+ };
10
+ //# sourceMappingURL=upload-actions.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
package/dist/index.d.mts CHANGED
@@ -11,6 +11,7 @@ import { ColumnDef } from '@tanstack/react-table';
11
11
  export { ColumnDef } from '@tanstack/react-table';
12
12
  import { DateRange } from 'react-day-picker';
13
13
  import { Drawer as Drawer$1 } from 'vaul';
14
+ export { Icon, IconProps } from './components/form-controls/icon.mjs';
14
15
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
15
16
  import { ScrollArea as ScrollArea$1 } from '@radix-ui/react-scroll-area';
16
17
  import * as SheetPrimitive from '@radix-ui/react-dialog';
@@ -289,14 +290,6 @@ declare const FormWithActionButtons: ({ children, form, onSubmit, onCancel, prim
289
290
  declare const getFileIcon: (fileName: string) => react_jsx_runtime.JSX.Element;
290
291
  declare const getFileName: (url: string) => string;
291
292
 
292
- type IconProps = {
293
- name: keyof typeof icons;
294
- size?: number;
295
- className?: string;
296
- strokeWidth?: number;
297
- };
298
- declare const Icon: React$1.MemoExoticComponent<({ name, className, strokeWidth, size }: IconProps) => react_jsx_runtime.JSX.Element | null>;
299
-
300
293
  type NavItem = {
301
294
  key: string;
302
295
  group?: string;
@@ -600,4 +593,4 @@ declare const useFileUpload: (formFieldName: string) => {
600
593
  isUploading: boolean;
601
594
  };
602
595
 
603
- export { ActionBar, ActionBarButton, type ActionBarProps, type ActionButton, type ActionButtonColor, type Actions, Alert, type AlertProps, Avatar, type AvatarProps, BackButton, Badge, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps$1 as ButtonProps, Card, type CardProps, ChatLoading, Checkbox, type CheckboxProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandGroupProps, type CommandProps, DataTable, DateFilter, Dialog, type DialogProps, Drawer, type DrawerProps, DropdownField, DropdownMenu, type DropdownMenuProps, DurationInput, EloquentActionBar, FilterCombobox, type FilterComboboxProps, type FilterCondition, FilterDialog, type FilterOptionProps, Form, FormCombobox, type FormComboboxProps, FormControl, FormDescription, FormField, FormItem, FormLabel, FormLayout, FormMessage, FormRow, FormWithActionButtons, Icon, IconButton, type IconButtonProps, type IconProps, Input, type InputProps, KnowledgeGraphWordCloud, LeftNav, MarkdownRenderer, MultiSelect, type MultiSelectOption, type MultiSelectProps, MultiStepProcess, type NavItem, OrgSelector, PageHeader, type PageHeaderProps, Popover, type PopoverProps, ProfileMenu, RadioGroup, type RadioGroupProps, type RadioOption, SchemaField, type SchemaFieldProps, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, SetupGuide, Sheet, type SheetPrimitiveRootProps, type SheetProps, Slider, type Step, type StepComponentProps, StringField, TagsInput, type TagsInputProps, TextField, Textarea, type TextareaProps, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, UploadWidget, UploadWidgetV2, badgeVariants, cn, getBadgeVariant, getColspanBySchema, getFieldType, getFileIcon, getFileName, useFileUpload, useFormField };
596
+ export { ActionBar, ActionBarButton, type ActionBarProps, type ActionButton, type ActionButtonColor, type Actions, Alert, type AlertProps, Avatar, type AvatarProps, BackButton, Badge, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps$1 as ButtonProps, Card, type CardProps, ChatLoading, Checkbox, type CheckboxProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandGroupProps, type CommandProps, DataTable, DateFilter, Dialog, type DialogProps, Drawer, type DrawerProps, DropdownField, DropdownMenu, type DropdownMenuProps, DurationInput, EloquentActionBar, FilterCombobox, type FilterComboboxProps, type FilterCondition, FilterDialog, type FilterOptionProps, Form, FormCombobox, type FormComboboxProps, FormControl, FormDescription, FormField, FormItem, FormLabel, FormLayout, FormMessage, FormRow, FormWithActionButtons, IconButton, type IconButtonProps, Input, type InputProps, KnowledgeGraphWordCloud, LeftNav, MarkdownRenderer, MultiSelect, type MultiSelectOption, type MultiSelectProps, MultiStepProcess, type NavItem, OrgSelector, PageHeader, type PageHeaderProps, Popover, type PopoverProps, ProfileMenu, RadioGroup, type RadioGroupProps, type RadioOption, SchemaField, type SchemaFieldProps, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, SetupGuide, Sheet, type SheetPrimitiveRootProps, type SheetProps, Slider, type Step, type StepComponentProps, StringField, TagsInput, type TagsInputProps, TextField, Textarea, type TextareaProps, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, UploadWidget, UploadWidgetV2, badgeVariants, cn, getBadgeVariant, getColspanBySchema, getFieldType, getFileIcon, getFileName, useFileUpload, useFormField };
package/dist/index.d.ts CHANGED
@@ -11,6 +11,7 @@ import { ColumnDef } from '@tanstack/react-table';
11
11
  export { ColumnDef } from '@tanstack/react-table';
12
12
  import { DateRange } from 'react-day-picker';
13
13
  import { Drawer as Drawer$1 } from 'vaul';
14
+ export { Icon, IconProps } from './components/form-controls/icon.js';
14
15
  import * as RadioGroupPrimitive from '@radix-ui/react-radio-group';
15
16
  import { ScrollArea as ScrollArea$1 } from '@radix-ui/react-scroll-area';
16
17
  import * as SheetPrimitive from '@radix-ui/react-dialog';
@@ -289,14 +290,6 @@ declare const FormWithActionButtons: ({ children, form, onSubmit, onCancel, prim
289
290
  declare const getFileIcon: (fileName: string) => react_jsx_runtime.JSX.Element;
290
291
  declare const getFileName: (url: string) => string;
291
292
 
292
- type IconProps = {
293
- name: keyof typeof icons;
294
- size?: number;
295
- className?: string;
296
- strokeWidth?: number;
297
- };
298
- declare const Icon: React$1.MemoExoticComponent<({ name, className, strokeWidth, size }: IconProps) => react_jsx_runtime.JSX.Element | null>;
299
-
300
293
  type NavItem = {
301
294
  key: string;
302
295
  group?: string;
@@ -600,4 +593,4 @@ declare const useFileUpload: (formFieldName: string) => {
600
593
  isUploading: boolean;
601
594
  };
602
595
 
603
- export { ActionBar, ActionBarButton, type ActionBarProps, type ActionButton, type ActionButtonColor, type Actions, Alert, type AlertProps, Avatar, type AvatarProps, BackButton, Badge, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps$1 as ButtonProps, Card, type CardProps, ChatLoading, Checkbox, type CheckboxProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandGroupProps, type CommandProps, DataTable, DateFilter, Dialog, type DialogProps, Drawer, type DrawerProps, DropdownField, DropdownMenu, type DropdownMenuProps, DurationInput, EloquentActionBar, FilterCombobox, type FilterComboboxProps, type FilterCondition, FilterDialog, type FilterOptionProps, Form, FormCombobox, type FormComboboxProps, FormControl, FormDescription, FormField, FormItem, FormLabel, FormLayout, FormMessage, FormRow, FormWithActionButtons, Icon, IconButton, type IconButtonProps, type IconProps, Input, type InputProps, KnowledgeGraphWordCloud, LeftNav, MarkdownRenderer, MultiSelect, type MultiSelectOption, type MultiSelectProps, MultiStepProcess, type NavItem, OrgSelector, PageHeader, type PageHeaderProps, Popover, type PopoverProps, ProfileMenu, RadioGroup, type RadioGroupProps, type RadioOption, SchemaField, type SchemaFieldProps, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, SetupGuide, Sheet, type SheetPrimitiveRootProps, type SheetProps, Slider, type Step, type StepComponentProps, StringField, TagsInput, type TagsInputProps, TextField, Textarea, type TextareaProps, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, UploadWidget, UploadWidgetV2, badgeVariants, cn, getBadgeVariant, getColspanBySchema, getFieldType, getFileIcon, getFileName, useFileUpload, useFormField };
596
+ export { ActionBar, ActionBarButton, type ActionBarProps, type ActionButton, type ActionButtonColor, type Actions, Alert, type AlertProps, Avatar, type AvatarProps, BackButton, Badge, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, type ButtonProps$1 as ButtonProps, Card, type CardProps, ChatLoading, Checkbox, type CheckboxProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandGroupProps, type CommandProps, DataTable, DateFilter, Dialog, type DialogProps, Drawer, type DrawerProps, DropdownField, DropdownMenu, type DropdownMenuProps, DurationInput, EloquentActionBar, FilterCombobox, type FilterComboboxProps, type FilterCondition, FilterDialog, type FilterOptionProps, Form, FormCombobox, type FormComboboxProps, FormControl, FormDescription, FormField, FormItem, FormLabel, FormLayout, FormMessage, FormRow, FormWithActionButtons, IconButton, type IconButtonProps, Input, type InputProps, KnowledgeGraphWordCloud, LeftNav, MarkdownRenderer, MultiSelect, type MultiSelectOption, type MultiSelectProps, MultiStepProcess, type NavItem, OrgSelector, PageHeader, type PageHeaderProps, Popover, type PopoverProps, ProfileMenu, RadioGroup, type RadioGroupProps, type RadioOption, SchemaField, type SchemaFieldProps, ScrollArea, type ScrollAreaProps, Select, type SelectOption, type SelectProps, SetupGuide, Sheet, type SheetPrimitiveRootProps, type SheetProps, Slider, type Step, type StepComponentProps, StringField, TagsInput, type TagsInputProps, TextField, Textarea, type TextareaProps, TimePicker, type TimePickerProps, Tooltip, type TooltipProps, UploadWidget, UploadWidgetV2, badgeVariants, cn, getBadgeVariant, getColspanBySchema, getFieldType, getFileIcon, getFileName, useFileUpload, useFormField };