ikoncomponents 1.6.9 → 1.7.0
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/README.md +36 -36
- package/dist/ikoncomponents/fileUpload/index.d.ts +11 -12
- package/dist/ikoncomponents/fileUpload/index.js +117 -59
- package/dist/ikoncomponents/fileUploadApi/index.d.ts +31 -0
- package/dist/ikoncomponents/fileUploadApi/index.js +159 -0
- package/dist/ikoncomponents/main-layout/nav-main.js +3 -1
- package/dist/index.d.ts +8 -3
- package/dist/index.js +8 -2
- package/dist/styles.css +28 -0
- package/dist/utils/api/file-upload copy/index.d.ts +13 -0
- package/dist/utils/api/file-upload copy/index.js +120 -0
- package/package.json +2 -1
- package/dist/ikoncomponents/assistant-ui/Assistant.d.ts +0 -28
- package/dist/ikoncomponents/assistant-ui/Assistant.js +0 -306
- package/dist/ikoncomponents/assistant-ui/agent-dropdown.d.ts +0 -24
- package/dist/ikoncomponents/assistant-ui/agent-dropdown.js +0 -16
- package/dist/ikoncomponents/assistant-ui/agentTextChatTransport.d.ts +0 -30
- package/dist/ikoncomponents/assistant-ui/agentTextChatTransport.js +0 -208
- package/dist/ikoncomponents/assistant-ui/attachment.d.ts +0 -4
- package/dist/ikoncomponents/assistant-ui/attachment.js +0 -93
- package/dist/ikoncomponents/assistant-ui/markdown-text.d.ts +0 -2
- package/dist/ikoncomponents/assistant-ui/markdown-text.js +0 -126
- package/dist/ikoncomponents/assistant-ui/thread.d.ts +0 -10
- package/dist/ikoncomponents/assistant-ui/thread.js +0 -115
- package/dist/ikoncomponents/assistant-ui/tool-fallback.d.ts +0 -2
- package/dist/ikoncomponents/assistant-ui/tool-fallback.js +0 -18
- package/dist/ikoncomponents/assistant-ui/tooltip-icon-button.d.ts +0 -7
- package/dist/ikoncomponents/assistant-ui/tooltip-icon-button.js +0 -23
- package/dist/ikoncomponents/table/component/DataTable.d.ts +0 -14
- package/dist/ikoncomponents/table/component/DataTable.js +0 -10
- package/dist/ikoncomponents/table/component/DataTablePageSize.d.ts +0 -1
- package/dist/ikoncomponents/table/component/DataTablePageSize.js +0 -16
- package/dist/ikoncomponents/table/component/DataTablePagination.d.ts +0 -6
- package/dist/ikoncomponents/table/component/DataTablePagination.js +0 -14
- package/dist/ikoncomponents/table/component/DataTableSearch.d.ts +0 -1
- package/dist/ikoncomponents/table/component/DataTableSearch.js +0 -27
- package/dist/utils/userType.d.ts +0 -13
- package/dist/utils/userType.js +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export interface ColumnDef<T> {
|
|
3
|
-
header: string | (() => React.ReactNode);
|
|
4
|
-
accessorKey?: keyof T;
|
|
5
|
-
cell?: (row: T) => React.ReactNode;
|
|
6
|
-
}
|
|
7
|
-
interface DataTableProps<T> {
|
|
8
|
-
data: T[];
|
|
9
|
-
columns: ColumnDef<T>[];
|
|
10
|
-
keyExtractor: (row: T) => string | number;
|
|
11
|
-
onRowClick?: (row: T) => void;
|
|
12
|
-
}
|
|
13
|
-
export declare function DataTable<T>({ data, columns, keyExtractor, onRowClick }: DataTableProps<T>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
-
export {};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { TableHeader, TableRow, TableHead, TableBody, TableCell } from "@/shadcn/table";
|
|
3
|
-
import { Table } from "lucide-react";
|
|
4
|
-
export function DataTable({ data, columns, keyExtractor, onRowClick }) {
|
|
5
|
-
return (_jsx("div", { className: "rounded-md border bg-background shadow-sm overflow-hidden", children: _jsxs(Table, { children: [_jsx(TableHeader, { children: _jsx(TableRow, { className: "bg-muted border-b border-border", children: columns.map((col, index) => (_jsx(TableHead, { className: "font-semibold text-muted-foreground", children: typeof col.header === "function" ? col.header() : col.header }, index))) }) }), _jsx(TableBody, { children: data && data.length > 0 ? (data.map((row) => (_jsx(TableRow, { onClick: () => onRowClick && onRowClick(row), className: `hover:bg-muted/50 transition-colors border-b border-border ${onRowClick ? "cursor-pointer" : ""}`, children: columns.map((col, colIndex) => (_jsx(TableCell, { className: colIndex === 0 ? "font-medium" : "", children: col.cell
|
|
6
|
-
? col.cell(row)
|
|
7
|
-
: col.accessorKey
|
|
8
|
-
? String(row[col.accessorKey] || "N/A")
|
|
9
|
-
: null }, colIndex))) }, keyExtractor(onRowClick ? row : row))))) : (_jsx(TableRow, { children: _jsx(TableCell, { colSpan: columns.length, className: "h-24 text-center text-muted-foreground", children: "No records found." }) })) })] }) }));
|
|
10
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function DataTablePageSize(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
|
4
|
-
export function DataTablePageSize() {
|
|
5
|
-
const router = useRouter();
|
|
6
|
-
const pathname = usePathname();
|
|
7
|
-
const searchParams = useSearchParams();
|
|
8
|
-
const currentSize = searchParams.get("size") || "10";
|
|
9
|
-
const handleSizeChange = (e) => {
|
|
10
|
-
const params = new URLSearchParams(searchParams.toString());
|
|
11
|
-
params.set("size", e.target.value);
|
|
12
|
-
params.set("page", "1");
|
|
13
|
-
router.push(`${pathname}?${params.toString()}`);
|
|
14
|
-
};
|
|
15
|
-
return (_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm text-muted-foreground", children: "Rows per page:" }), _jsxs("select", { className: "h-9 rounded-md border border-border bg-background text-foreground px-2 py-1 text-sm focus:outline-none focus:ring-2 focus:ring-primary", value: currentSize, onChange: handleSizeChange, children: [_jsx("option", { value: "10", children: "10" }), _jsx("option", { value: "20", children: "20" }), _jsx("option", { value: "50", children: "50" }), _jsx("option", { value: "100", children: "100" })] })] }));
|
|
16
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
|
4
|
-
export function DataTablePagination({ totalPages, currentPage }) {
|
|
5
|
-
const router = useRouter();
|
|
6
|
-
const pathname = usePathname();
|
|
7
|
-
const searchParams = useSearchParams();
|
|
8
|
-
const handlePageChange = (newPage) => {
|
|
9
|
-
const params = new URLSearchParams(searchParams.toString());
|
|
10
|
-
params.set("page", newPage.toString());
|
|
11
|
-
router.push(`${pathname}?${params.toString()}`);
|
|
12
|
-
};
|
|
13
|
-
return (_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("button", { onClick: () => handlePageChange(currentPage - 1), disabled: currentPage <= 1, className: "h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors", children: "Previous" }), _jsxs("span", { className: "text-sm text-muted-foreground px-2", children: ["Page ", _jsx("span", { className: "font-semibold", children: currentPage }), " of", " ", _jsx("span", { className: "font-semibold", children: Math.max(totalPages, 1) })] }), _jsx("button", { onClick: () => handlePageChange(currentPage + 1), disabled: currentPage >= totalPages, className: "h-9 px-3 py-1 text-sm font-medium border border-border rounded-md bg-background text-foreground hover:bg-muted disabled:opacity-50 disabled:cursor-not-allowed transition-colors", children: "Next" })] }));
|
|
14
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function DataTableSearch(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useRouter, usePathname, useSearchParams } from "next/navigation";
|
|
4
|
-
import { useState, useEffect } from "react";
|
|
5
|
-
import { useDebounce } from "use-debounce";
|
|
6
|
-
import { Search } from "lucide-react";
|
|
7
|
-
export function DataTableSearch() {
|
|
8
|
-
const router = useRouter();
|
|
9
|
-
const pathname = usePathname();
|
|
10
|
-
const searchParams = useSearchParams();
|
|
11
|
-
const [searchTerm, setSearchTerm] = useState(searchParams.get("search") || "");
|
|
12
|
-
const [debouncedSearch] = useDebounce(searchTerm, 500);
|
|
13
|
-
useEffect(() => {
|
|
14
|
-
const params = new URLSearchParams(searchParams.toString());
|
|
15
|
-
if (debouncedSearch) {
|
|
16
|
-
params.set("search", debouncedSearch);
|
|
17
|
-
}
|
|
18
|
-
else {
|
|
19
|
-
params.delete("search");
|
|
20
|
-
}
|
|
21
|
-
if (params.get("search") !== searchParams.get("search")) {
|
|
22
|
-
params.set("page", "1");
|
|
23
|
-
router.push(`${pathname}?${params.toString()}`);
|
|
24
|
-
}
|
|
25
|
-
}, [debouncedSearch, pathname, router, searchParams]);
|
|
26
|
-
return (_jsxs("div", { className: "relative w-full max-w-sm", children: [_jsx(Search, { className: "absolute left-2.5 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" }), _jsx("input", { type: "text", placeholder: "Search ...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "flex h-9 w-full rounded-md border border-border bg-transparent pl-9 pr-3 py-1 text-sm shadow-sm transition-colors text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-primary" })] }));
|
|
27
|
-
}
|
package/dist/utils/userType.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface UserData {
|
|
2
|
-
userId: string;
|
|
3
|
-
userName: string;
|
|
4
|
-
userLogin: string;
|
|
5
|
-
password: string;
|
|
6
|
-
userPhone?: string;
|
|
7
|
-
userEmail: string;
|
|
8
|
-
userThumbnail?: string | null;
|
|
9
|
-
userType?: string;
|
|
10
|
-
active?: boolean;
|
|
11
|
-
accountId?: string;
|
|
12
|
-
userDeleted?: boolean;
|
|
13
|
-
}
|
package/dist/utils/userType.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|