@elqnt/react 1.0.1 → 1.0.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.
@@ -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,58 @@
1
+ "use client";
2
+ "use strict";
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
+
21
+ // components/form-controls/icon.tsx
22
+ var icon_exports = {};
23
+ __export(icon_exports, {
24
+ Icon: () => Icon
25
+ });
26
+ module.exports = __toCommonJS(icon_exports);
27
+
28
+ // lib/utils.ts
29
+ var import_clsx = require("clsx");
30
+ var import_tailwind_merge = require("tailwind-merge");
31
+ function cn(...inputs) {
32
+ return (0, import_tailwind_merge.twMerge)((0, import_clsx.clsx)(inputs));
33
+ }
34
+
35
+ // components/form-controls/icon.tsx
36
+ var import_lucide_react = require("lucide-react");
37
+ var import_react = require("react");
38
+ var import_jsx_runtime = require("react/jsx-runtime");
39
+ var Icon = (0, import_react.memo)(({ name, className, strokeWidth, size }) => {
40
+ const IconComponent = import_lucide_react.icons[name];
41
+ if (!IconComponent) {
42
+ return null;
43
+ }
44
+ return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
45
+ IconComponent,
46
+ {
47
+ className: cn(className),
48
+ strokeWidth: strokeWidth || 2.5,
49
+ size
50
+ }
51
+ );
52
+ });
53
+ Icon.displayName = "Icon";
54
+ // Annotate the CommonJS export names for ESM import in node:
55
+ 0 && (module.exports = {
56
+ Icon
57
+ });
58
+ //# sourceMappingURL=icon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../components/form-controls/icon.tsx","../../../lib/utils.ts"],"sourcesContent":["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","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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,kBAAsC;AACtC,4BAAwB;AAEjB,SAAS,MAAM,QAAsB;AAC1C,aAAO,mCAAQ,kBAAK,MAAM,CAAC;AAC7B;;;ADJA,0BAAsB;AACtB,mBAAqB;AAiBjB;AARG,IAAM,WAAO,mBAAK,CAAC,EAAE,MAAM,WAAW,aAAa,KAAK,MAAiB;AAC9E,QAAM,gBAAgB,0BAAM,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,32 @@
1
+ "use client";
2
+
3
+ // lib/utils.ts
4
+ import { clsx } from "clsx";
5
+ import { twMerge } from "tailwind-merge";
6
+ function cn(...inputs) {
7
+ return twMerge(clsx(inputs));
8
+ }
9
+
10
+ // components/form-controls/icon.tsx
11
+ import { icons } from "lucide-react";
12
+ import { memo } from "react";
13
+ import { jsx } from "react/jsx-runtime";
14
+ var Icon = memo(({ name, className, strokeWidth, size }) => {
15
+ const IconComponent = icons[name];
16
+ if (!IconComponent) {
17
+ return null;
18
+ }
19
+ return /* @__PURE__ */ jsx(
20
+ IconComponent,
21
+ {
22
+ className: cn(className),
23
+ strokeWidth: strokeWidth || 2.5,
24
+ size
25
+ }
26
+ );
27
+ });
28
+ Icon.displayName = "Icon";
29
+ export {
30
+ Icon
31
+ };
32
+ //# sourceMappingURL=icon.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;;;ACJA,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,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,149 @@
1
+ "use client";
2
+ "use strict";
3
+ "use server";
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
21
+
22
+ // components/upload/upload-actions.ts
23
+ var upload_actions_exports = {};
24
+ __export(upload_actions_exports, {
25
+ uploadFile: () => uploadFile,
26
+ uploadToS3: () => uploadToS3
27
+ });
28
+ module.exports = __toCommonJS(upload_actions_exports);
29
+ var import_storage_blob = require("@azure/storage-blob");
30
+ var import_client_s3 = require("@aws-sdk/client-s3");
31
+ async function uploadFile(formData) {
32
+ try {
33
+ const file = formData.get("file");
34
+ if (!file) {
35
+ throw new Error("No file provided");
36
+ }
37
+ const STORAGE_CONNECTION_STRING = process.env.AZURE_STORAGE_CONNECTION_STRING;
38
+ const STORAGE_CONTAINER_NAME = process.env.AZURE_STORAGE_CONTAINER_NAME;
39
+ if (!STORAGE_CONNECTION_STRING || !STORAGE_CONTAINER_NAME) {
40
+ throw new Error(
41
+ "STORAGE_CONNECTION_STRING or STORAGE_CONTAINER_NAME not set"
42
+ );
43
+ }
44
+ const fileExtension = file.name.split(".").pop()?.toLowerCase();
45
+ const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;
46
+ const contentType = getContentType(fileExtension);
47
+ const buffer = Buffer.from(await file.arrayBuffer());
48
+ const blobServiceClient = import_storage_blob.BlobServiceClient.fromConnectionString(
49
+ STORAGE_CONNECTION_STRING
50
+ );
51
+ const containerClient = blobServiceClient.getContainerClient(
52
+ STORAGE_CONTAINER_NAME
53
+ );
54
+ await containerClient.createIfNotExists();
55
+ const blockBlobClient = containerClient.getBlockBlobClient(fileName);
56
+ await blockBlobClient.upload(buffer, buffer.length, {
57
+ blobHTTPHeaders: {
58
+ blobContentType: contentType
59
+ }
60
+ });
61
+ const fileUrl = blockBlobClient.url;
62
+ return { success: true, fileUrl };
63
+ } catch (error) {
64
+ console.error("Upload error:", error);
65
+ return {
66
+ success: false,
67
+ error: error instanceof Error ? error.message : "Failed to upload file"
68
+ };
69
+ }
70
+ }
71
+ function getContentType(fileExtension) {
72
+ if (!fileExtension) return "application/octet-stream";
73
+ const mimeTypes = {
74
+ // Images
75
+ png: "image/png",
76
+ jpg: "image/jpeg",
77
+ jpeg: "image/jpeg",
78
+ gif: "image/gif",
79
+ webp: "image/webp",
80
+ svg: "image/svg+xml",
81
+ // Documents
82
+ pdf: "application/pdf",
83
+ doc: "application/msword",
84
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
85
+ // Others
86
+ txt: "text/plain",
87
+ csv: "text/csv",
88
+ json: "application/json"
89
+ };
90
+ return mimeTypes[fileExtension] || "application/octet-stream";
91
+ }
92
+ async function uploadToS3(formData) {
93
+ try {
94
+ const file = formData.get("file");
95
+ if (!file) {
96
+ throw new Error("No file provided");
97
+ }
98
+ const AWS_ACCESS_KEY_ID = process.env.LINODE_ACCESS_KEY;
99
+ const AWS_SECRET_ACCESS_KEY = process.env.LINODE_SECRET_KEY;
100
+ const S3_BUCKET_NAME = process.env.LINODE_BUCKET_NAME;
101
+ let S3_ENDPOINT = process.env.LINODE_OBJECT_STORAGE_ENDPOINT;
102
+ if (!AWS_ACCESS_KEY_ID || !AWS_SECRET_ACCESS_KEY || !S3_BUCKET_NAME || !S3_ENDPOINT) {
103
+ throw new Error("S3 credentials or configuration not set");
104
+ }
105
+ const fileExtension = file.name.split(".").pop()?.toLowerCase();
106
+ const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;
107
+ const contentType = getContentType(fileExtension);
108
+ const buffer = Buffer.from(await file.arrayBuffer());
109
+ const s3Client = new import_client_s3.S3Client({
110
+ endpoint: S3_ENDPOINT,
111
+ region: "us-east-1",
112
+ // Linode requires a region but it's not used with custom endpoint
113
+ credentials: {
114
+ accessKeyId: AWS_ACCESS_KEY_ID,
115
+ secretAccessKey: AWS_SECRET_ACCESS_KEY
116
+ },
117
+ forcePathStyle: true,
118
+ // Required for Linode Object Storage
119
+ maxAttempts: 3,
120
+ requestHandler: {
121
+ timeout: 1e4
122
+ // 10 seconds timeout
123
+ }
124
+ });
125
+ const command = new import_client_s3.PutObjectCommand({
126
+ Bucket: S3_BUCKET_NAME,
127
+ Key: fileName,
128
+ Body: buffer,
129
+ ContentType: contentType,
130
+ ACL: "public-read"
131
+ // Make the object publicly readable
132
+ });
133
+ await s3Client.send(command);
134
+ const fileUrl = `${S3_ENDPOINT}/${S3_BUCKET_NAME}/${fileName}`;
135
+ return { success: true, fileUrl };
136
+ } catch (error) {
137
+ console.error("Upload error:", JSON.stringify(error, null, 2));
138
+ return {
139
+ success: false,
140
+ error: error instanceof Error ? error.message : "Failed to upload file"
141
+ };
142
+ }
143
+ }
144
+ // Annotate the CommonJS export names for ESM import in node:
145
+ 0 && (module.exports = {
146
+ uploadFile,
147
+ uploadToS3
148
+ });
149
+ //# sourceMappingURL=upload-actions.js.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":"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","names":[]}
@@ -0,0 +1,124 @@
1
+ "use client";
2
+ "use server";
3
+
4
+ // components/upload/upload-actions.ts
5
+ import { BlobServiceClient } from "@azure/storage-blob";
6
+ import { PutObjectCommand, S3Client } from "@aws-sdk/client-s3";
7
+ async function uploadFile(formData) {
8
+ try {
9
+ const file = formData.get("file");
10
+ if (!file) {
11
+ throw new Error("No file provided");
12
+ }
13
+ const STORAGE_CONNECTION_STRING = process.env.AZURE_STORAGE_CONNECTION_STRING;
14
+ const STORAGE_CONTAINER_NAME = process.env.AZURE_STORAGE_CONTAINER_NAME;
15
+ if (!STORAGE_CONNECTION_STRING || !STORAGE_CONTAINER_NAME) {
16
+ throw new Error(
17
+ "STORAGE_CONNECTION_STRING or STORAGE_CONTAINER_NAME not set"
18
+ );
19
+ }
20
+ const fileExtension = file.name.split(".").pop()?.toLowerCase();
21
+ const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;
22
+ const contentType = getContentType(fileExtension);
23
+ const buffer = Buffer.from(await file.arrayBuffer());
24
+ const blobServiceClient = BlobServiceClient.fromConnectionString(
25
+ STORAGE_CONNECTION_STRING
26
+ );
27
+ const containerClient = blobServiceClient.getContainerClient(
28
+ STORAGE_CONTAINER_NAME
29
+ );
30
+ await containerClient.createIfNotExists();
31
+ const blockBlobClient = containerClient.getBlockBlobClient(fileName);
32
+ await blockBlobClient.upload(buffer, buffer.length, {
33
+ blobHTTPHeaders: {
34
+ blobContentType: contentType
35
+ }
36
+ });
37
+ const fileUrl = blockBlobClient.url;
38
+ return { success: true, fileUrl };
39
+ } catch (error) {
40
+ console.error("Upload error:", error);
41
+ return {
42
+ success: false,
43
+ error: error instanceof Error ? error.message : "Failed to upload file"
44
+ };
45
+ }
46
+ }
47
+ function getContentType(fileExtension) {
48
+ if (!fileExtension) return "application/octet-stream";
49
+ const mimeTypes = {
50
+ // Images
51
+ png: "image/png",
52
+ jpg: "image/jpeg",
53
+ jpeg: "image/jpeg",
54
+ gif: "image/gif",
55
+ webp: "image/webp",
56
+ svg: "image/svg+xml",
57
+ // Documents
58
+ pdf: "application/pdf",
59
+ doc: "application/msword",
60
+ docx: "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
61
+ // Others
62
+ txt: "text/plain",
63
+ csv: "text/csv",
64
+ json: "application/json"
65
+ };
66
+ return mimeTypes[fileExtension] || "application/octet-stream";
67
+ }
68
+ async function uploadToS3(formData) {
69
+ try {
70
+ const file = formData.get("file");
71
+ if (!file) {
72
+ throw new Error("No file provided");
73
+ }
74
+ const AWS_ACCESS_KEY_ID = process.env.LINODE_ACCESS_KEY;
75
+ const AWS_SECRET_ACCESS_KEY = process.env.LINODE_SECRET_KEY;
76
+ const S3_BUCKET_NAME = process.env.LINODE_BUCKET_NAME;
77
+ let S3_ENDPOINT = process.env.LINODE_OBJECT_STORAGE_ENDPOINT;
78
+ if (!AWS_ACCESS_KEY_ID || !AWS_SECRET_ACCESS_KEY || !S3_BUCKET_NAME || !S3_ENDPOINT) {
79
+ throw new Error("S3 credentials or configuration not set");
80
+ }
81
+ const fileExtension = file.name.split(".").pop()?.toLowerCase();
82
+ const fileName = `${Date.now()}-${Math.random().toString(36).substring(2)}.${fileExtension}`;
83
+ const contentType = getContentType(fileExtension);
84
+ const buffer = Buffer.from(await file.arrayBuffer());
85
+ const s3Client = new S3Client({
86
+ endpoint: S3_ENDPOINT,
87
+ region: "us-east-1",
88
+ // Linode requires a region but it's not used with custom endpoint
89
+ credentials: {
90
+ accessKeyId: AWS_ACCESS_KEY_ID,
91
+ secretAccessKey: AWS_SECRET_ACCESS_KEY
92
+ },
93
+ forcePathStyle: true,
94
+ // Required for Linode Object Storage
95
+ maxAttempts: 3,
96
+ requestHandler: {
97
+ timeout: 1e4
98
+ // 10 seconds timeout
99
+ }
100
+ });
101
+ const command = new PutObjectCommand({
102
+ Bucket: S3_BUCKET_NAME,
103
+ Key: fileName,
104
+ Body: buffer,
105
+ ContentType: contentType,
106
+ ACL: "public-read"
107
+ // Make the object publicly readable
108
+ });
109
+ await s3Client.send(command);
110
+ const fileUrl = `${S3_ENDPOINT}/${S3_BUCKET_NAME}/${fileName}`;
111
+ return { success: true, fileUrl };
112
+ } catch (error) {
113
+ console.error("Upload error:", JSON.stringify(error, null, 2));
114
+ return {
115
+ success: false,
116
+ error: error instanceof Error ? error.message : "Failed to upload file"
117
+ };
118
+ }
119
+ }
120
+ export {
121
+ uploadFile,
122
+ uploadToS3
123
+ };
124
+ //# sourceMappingURL=upload-actions.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":"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","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 };
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  "use strict";
2
3
  var __create = Object.create;
3
4
  var __defProp = Object.defineProperty;