ikoncomponents 1.1.8 → 1.1.9
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/ikoncomponents/alert-dialog/dialog-context.d.ts +21 -0
- package/dist/ikoncomponents/alert-dialog/dialog-context.js +30 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.d.ts +16 -0
- package/dist/ikoncomponents/app-breadcrumb/BreadcrumbProvider.js +32 -0
- package/dist/ikoncomponents/app-breadcrumb/index.d.ts +5 -0
- package/dist/ikoncomponents/app-breadcrumb/index.js +57 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/combobox-input/index.js +21 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.d.ts +18 -0
- package/dist/ikoncomponents/form-fields/combobox-input-value/index.js +25 -0
- package/dist/ikoncomponents/form-fields/date-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/date-input/index.js +15 -0
- package/dist/ikoncomponents/form-fields/file-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/file-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.d.ts +6 -0
- package/dist/ikoncomponents/form-fields/multi-combobox-input/index.js +381 -0
- package/dist/ikoncomponents/form-fields/otp-input/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/otp-input/index.js +18 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.d.ts +1 -0
- package/dist/ikoncomponents/form-fields/phone-input/index.js +4 -0
- package/dist/ikoncomponents/form-fields/textarea/index.d.ts +2 -0
- package/dist/ikoncomponents/form-fields/textarea/index.js +18 -0
- package/dist/ikoncomponents/form-fields/types/index.d.ts +36 -0
- package/dist/ikoncomponents/form-fields/types/index.js +1 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.d.ts +27 -0
- package/dist/ikoncomponents/main-layout/SidebarNavContext.js +40 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.d.ts +3 -0
- package/dist/ikoncomponents/main-layout/app-sidebar.js +19 -0
- package/dist/ikoncomponents/main-layout/footer.d.ts +1 -0
- package/dist/ikoncomponents/main-layout/footer.js +4 -0
- package/dist/ikoncomponents/main-layout/header.d.ts +1 -0
- package/dist/ikoncomponents/main-layout/header.js +10 -0
- package/dist/ikoncomponents/main-layout/index.d.ts +5 -0
- package/dist/ikoncomponents/main-layout/index.js +11 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +27 -0
- package/dist/ikoncomponents/main-layout/main-sidebar.js +74 -0
- package/dist/ikoncomponents/main-layout/nav-main.d.ts +8 -0
- package/dist/ikoncomponents/main-layout/nav-main.js +31 -0
- package/dist/ikoncomponents/resource/index.d.ts +19 -0
- package/dist/ikoncomponents/resource/index.js +89 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.d.ts +5 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-table.js +6 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.d.ts +3 -0
- package/dist/ikoncomponents/skeleton-loader/skeleton-widget.js +5 -0
- package/dist/ikoncomponents/theme-toggle-btn/index.d.ts +1 -1
- package/dist/ikoncomponents/theme-toggle-btn/index.js +112 -4
- package/dist/ikoncomponents/upload-tab/index.d.ts +1 -0
- package/dist/ikoncomponents/upload-tab/index.js +92 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +33 -0
- package/dist/shadcn/aspect-ratio.d.ts +3 -0
- package/dist/shadcn/aspect-ratio.js +19 -0
- package/dist/shadcn/breadcrumb.d.ts +11 -0
- package/dist/shadcn/breadcrumb.js +45 -0
- package/dist/shadcn/button.d.ts +1 -1
- package/dist/shadcn/button.js +3 -2
- package/dist/shadcn/collapsible.d.ts +5 -0
- package/dist/shadcn/collapsible.js +27 -0
- package/dist/shadcn/drawer.d.ts +13 -0
- package/dist/shadcn/drawer.js +56 -0
- package/dist/shadcn/form.d.ts +24 -0
- package/dist/shadcn/form.js +70 -0
- package/dist/shadcn/input-otp.d.ts +34 -0
- package/dist/shadcn/input-otp.js +40 -0
- package/dist/shadcn/radio-group.js +2 -4
- package/dist/shadcn/table.js +1 -1
- package/dist/shadcn/tabs.js +1 -1
- package/dist/shadcn/toggle-group.d.ts +9 -0
- package/dist/shadcn/toggle-group.js +35 -0
- package/dist/shadcn/toggle.d.ts +9 -0
- package/dist/shadcn/toggle.js +38 -0
- package/dist/shadcn/tooltip.js +2 -2
- package/dist/styles.css +534 -41
- package/dist/utils/border-radius-provider.d.ts +11 -0
- package/dist/utils/border-radius-provider.js +35 -0
- package/dist/utils/font-provider.d.ts +11 -0
- package/dist/utils/font-provider.js +37 -0
- package/dist/utils/session/cookieSession.d.ts +8 -0
- package/dist/utils/session/cookieSession.js +33 -0
- package/dist/utils/token-management/index.d.ts +7 -0
- package/dist/utils/token-management/index.js +78 -0
- package/dist/utils/token-management/types.d.ts +6 -0
- package/dist/utils/token-management/types.js +1 -0
- package/package.json +98 -91
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface Account {
|
|
2
|
+
accountId: string;
|
|
3
|
+
accountName: string;
|
|
4
|
+
accountConfiguration: any | null;
|
|
5
|
+
accountDeleted: boolean;
|
|
6
|
+
active: boolean;
|
|
7
|
+
createdBy: string;
|
|
8
|
+
createdOn: string;
|
|
9
|
+
updatedBy: string;
|
|
10
|
+
updatedOn: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Software {
|
|
13
|
+
softwareId: string;
|
|
14
|
+
softwareName: string;
|
|
15
|
+
softwareVersion: string;
|
|
16
|
+
softwareDescription: string;
|
|
17
|
+
accountId: string;
|
|
18
|
+
purchaseDate: string;
|
|
19
|
+
softwareOwnerId: string;
|
|
20
|
+
expiresOn: string | null;
|
|
21
|
+
active: boolean;
|
|
22
|
+
requestStatus: string | null;
|
|
23
|
+
softwareVisibility: 'PUBLIC' | 'PRIVATE' | 'RESTRICTED';
|
|
24
|
+
}
|
|
25
|
+
export declare const MainSidebar: ({ baseUrl }: {
|
|
26
|
+
baseUrl: string;
|
|
27
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { Check, Clock, FolderCode, Heart, Home, LogOut, Settings } from 'lucide-react';
|
|
5
|
+
import { Button } from '../../shadcn/button';
|
|
6
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '../../shadcn/tooltip';
|
|
7
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger } from '../../shadcn/dropdown-menu';
|
|
8
|
+
import { Avatar, AvatarFallback, AvatarImage } from '../../shadcn/avatar';
|
|
9
|
+
import { getValidAccessToken } from '../../utils/token-management';
|
|
10
|
+
import { clearAllCookieSession } from '../../utils/session/cookieSession';
|
|
11
|
+
import axios from 'axios';
|
|
12
|
+
import { redirect } from 'next/navigation';
|
|
13
|
+
import Link from 'next/link';
|
|
14
|
+
export const MainSidebar = ({ baseUrl }) => {
|
|
15
|
+
const user = {
|
|
16
|
+
name: "Username",
|
|
17
|
+
email: "User email",
|
|
18
|
+
role: "Role",
|
|
19
|
+
avatar: ""
|
|
20
|
+
};
|
|
21
|
+
const [accounts, setAccounts] = React.useState([]);
|
|
22
|
+
const [selectedAccount, setSelectedAccount] = React.useState();
|
|
23
|
+
const [softwares, setSoftwares] = React.useState([]);
|
|
24
|
+
const getInitials = (name) => {
|
|
25
|
+
return name
|
|
26
|
+
.split(' ')
|
|
27
|
+
.map(word => word[0])
|
|
28
|
+
.join('')
|
|
29
|
+
.toUpperCase()
|
|
30
|
+
.slice(0, 2);
|
|
31
|
+
};
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
const fetchAccounts = async () => {
|
|
34
|
+
try {
|
|
35
|
+
const accessToken = await getValidAccessToken();
|
|
36
|
+
const response = await axios.get(`${baseUrl}/platform/account/all`, {
|
|
37
|
+
headers: {
|
|
38
|
+
Authorization: `Bearer ${accessToken}`,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
setAccounts(response.data);
|
|
42
|
+
setSelectedAccount(response.data[0]);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
console.error(error);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const fetchSubscribedSoftwares = async () => {
|
|
49
|
+
try {
|
|
50
|
+
const accessToken = await getValidAccessToken();
|
|
51
|
+
const response = await axios.get(`${baseUrl}/platform/software-subscription/account`, {
|
|
52
|
+
headers: {
|
|
53
|
+
Authorization: `Bearer ${accessToken}`,
|
|
54
|
+
},
|
|
55
|
+
});
|
|
56
|
+
setSoftwares(response.data);
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
console.error(error);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
fetchAccounts();
|
|
63
|
+
fetchSubscribedSoftwares();
|
|
64
|
+
}, []);
|
|
65
|
+
return (_jsx(TooltipProvider, { delayDuration: 0, children: _jsxs("aside", { className: "fixed left-0 top-0 z-20 h-screen w-12 border-r border-border bg-sidebar text-sidebar-foreground flex flex-col items-center py-4 ", children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "default", className: "mb-4 h-8 w-8 rounded-lg p-0", disabled: !selectedAccount, children: _jsx("span", { className: "text-base font-medium text-accent-foreground", children: selectedAccount ? getInitials(selectedAccount.accountName) : '...' }) }) }), _jsxs(DropdownMenuContent, { className: "w-55", side: "right", sideOffset: 8, align: "start", children: [_jsx("div", { className: "px-2 py-1.5 text-xs font-semibold text-foreground", children: "Accounts" }), accounts.map((account) => (_jsxs(DropdownMenuItem, { className: "flex items-center justify-between cursor-pointer", onClick: () => {
|
|
66
|
+
setSelectedAccount(account);
|
|
67
|
+
}, children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "h-6 w-6 rounded bg-primary/10 flex items-center justify-center", children: _jsx("span", { className: "text-xs font-medium text-primary", children: getInitials(account.accountName) }) }), _jsx("span", { className: "text-sm", children: account.accountName })] }), (selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountId) === account.accountId && (_jsx(Check, { className: "h-4 w-4 text-primary" }))] }, account.accountId)))] })] }), _jsx("nav", { className: "flex flex-col gap-2", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: 'h-5 w-5', children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: "/", children: [_jsx(Home, { className: "h-5 w-5" }), _jsx("span", { className: "sr-only", children: "Home" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Home" })] }, "home") }), _jsx("nav", { className: "flex flex-col gap-2 flex-1", children: softwares.map((software) => {
|
|
68
|
+
const Icon = FolderCode;
|
|
69
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: 'h-5 w-5', children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: "/", children: [_jsx(Icon, { className: "h-5 w-5" }), _jsx("span", { className: "sr-only", children: software.softwareName })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: software.softwareName })] }, software.softwareName));
|
|
70
|
+
}) }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: 'h-5 w-5', children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: "/last-visited", children: [_jsx(Clock, { className: "h-5 w-5" }), _jsx("span", { className: "sr-only", children: "Last Visited" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Last Visited" })] }, "last-visited"), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: 'h-5 w-5', children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: "/favourites", children: [_jsx(Heart, { className: "h-5 w-5" }), _jsx("span", { className: "sr-only", children: "Favourites" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Favourites" })] }, "favourites"), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: 'h-5 w-5', children: _jsx(Button, { variant: "ghost", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: "/settings", children: [_jsx(Settings, { className: "h-5 w-5" }), _jsx("span", { className: "sr-only", children: "Settings" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Settings" })] }, "settings"), _jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10 rounded-full", children: _jsxs(Avatar, { className: "h-8 w-8", children: [_jsx(AvatarImage, { src: user.avatar, alt: user.name }), _jsx(AvatarFallback, { className: "text-sm font-semibold", children: user.name.split(' ').map(n => n[0]).join('') })] }) }) }), _jsxs(DropdownMenuContent, { className: "w-55 p-0", side: 'right', sideOffset: 8, children: [_jsxs("div", { className: "flex items-start gap-3 p-4 bg-card", children: [_jsxs(Avatar, { className: "h-10 w-10 mt-1", children: [_jsx(AvatarImage, { src: user.avatar, alt: user.name }), _jsx(AvatarFallback, { className: "", children: user.name.split(' ').map(n => n[0]).join('') })] }), _jsxs("div", { className: "flex flex-col gap-0.5 flex-1 min-w-0", children: [_jsx("p", { className: "text-sm font-bold text-foreground blue-dark:text-muted-foreground truncate", children: user.name }), _jsx("p", { className: "text-xs text-muted-foreground truncate", children: user.email }), _jsx("p", { className: "text-sm text-muted-foreground font-semibold", children: user.role })] })] }), _jsx(DropdownMenuSeparator, { className: "my-0" }), _jsxs(DropdownMenuItem, { onClick: async () => {
|
|
71
|
+
await clearAllCookieSession();
|
|
72
|
+
redirect("/login.html");
|
|
73
|
+
}, className: "flex items-center gap-2 px-4 py-3 cursor-pointer focus:bg-destructive dark:focus:bg-destructive blue-dark:focus:bg-destructive", children: [_jsx(LogOut, { className: "h-4 w-4 text-foreground" }), _jsx("span", { children: "Log out" })] })] })] })] }) }));
|
|
74
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { SidebarNavItem } from "./SidebarNavContext";
|
|
2
|
+
export declare function NavMain(): import("react/jsx-runtime").JSX.Element | null;
|
|
3
|
+
export declare function RenderSidebarNav({ items }: {
|
|
4
|
+
items: SidebarNavItem[];
|
|
5
|
+
}): null;
|
|
6
|
+
export declare function AddSidebarNav({ item }: {
|
|
7
|
+
item: SidebarNavItem;
|
|
8
|
+
}): null;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useEffect } from "react";
|
|
4
|
+
import { ChevronRight } from "lucide-react";
|
|
5
|
+
import { SidebarGroup, SidebarMenu, SidebarMenuButton, SidebarMenuItem, SidebarMenuSub, SidebarMenuSubButton, SidebarMenuSubItem } from "../../shadcn/sidebar";
|
|
6
|
+
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../../shadcn/collapsible";
|
|
7
|
+
import Link from "next/link";
|
|
8
|
+
import { useSidebarNav } from "./SidebarNavContext";
|
|
9
|
+
export function NavMain() {
|
|
10
|
+
const { navItems } = useSidebarNav();
|
|
11
|
+
if (!navItems || navItems.length === 0) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return (_jsx(SidebarGroup, { children: _jsx(SidebarMenu, { children: navItems.map((item) => item.items && item.items.length > 0 ? (_jsx(Collapsible, { asChild: true, defaultOpen: item.isActive, className: "group/collapsible", children: _jsxs(SidebarMenuItem, { children: [_jsx(CollapsibleTrigger, { asChild: true, children: _jsxs(SidebarMenuButton, { tooltip: item.title, children: [item.icon && _jsx(item.icon, {}), _jsx("span", { children: item.title }), _jsx(ChevronRight, { className: "ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90" })] }) }), _jsx(CollapsibleContent, { children: _jsx(SidebarMenuSub, { children: item.items.map((subItem) => (_jsx(SidebarMenuSubItem, { children: _jsx(SidebarMenuSubButton, { asChild: true, children: _jsx(Link, { href: subItem.url, children: _jsx("span", { children: subItem.title }) }) }) }, subItem.title))) }) })] }) }, item.title)) : (_jsx(SidebarMenuItem, { children: _jsx(SidebarMenuButton, { asChild: true, tooltip: item.title, children: _jsxs(Link, { href: item.url, className: "flex items-center gap-2 w-full", children: [item.icon && _jsx(item.icon, {}), _jsx("span", { children: item.title })] }) }) }, item.title))) }) }));
|
|
15
|
+
}
|
|
16
|
+
// Helper component to set nav items from pages
|
|
17
|
+
export function RenderSidebarNav({ items }) {
|
|
18
|
+
const { setNavItems } = useSidebarNav();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
setNavItems(items);
|
|
21
|
+
}, [items, setNavItems]);
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
// Helper component to add a single nav item
|
|
25
|
+
export function AddSidebarNav({ item }) {
|
|
26
|
+
const { addNavItem } = useSidebarNav();
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
addNavItem(item);
|
|
29
|
+
}, [item, addNavItem]);
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ResourceTableProps {
|
|
3
|
+
resourceDataWithAllocation: any[];
|
|
4
|
+
userMaps: {
|
|
5
|
+
userDetailsMap: {
|
|
6
|
+
[key: string]: {
|
|
7
|
+
name: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
rolesMap: {
|
|
11
|
+
[key: string]: {
|
|
12
|
+
roleId: string;
|
|
13
|
+
roleName: string;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
monthsRange: string[];
|
|
18
|
+
}
|
|
19
|
+
export declare const ResourceTable: React.FC<ResourceTableProps>;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/* eslint-disable react-hooks/preserve-manual-memoization */
|
|
3
|
+
import React, { useMemo } from 'react';
|
|
4
|
+
import { Button } from "../../shadcn/button";
|
|
5
|
+
import { Plus, Trash2 } from 'lucide-react';
|
|
6
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "../../shadcn/select";
|
|
7
|
+
import { Input } from "../../shadcn/input";
|
|
8
|
+
import { DataTable } from '../data-table';
|
|
9
|
+
export const ResourceTable = ({ resourceDataWithAllocation, userMaps, monthsRange, }) => {
|
|
10
|
+
const [data, setData] = React.useState(resourceDataWithAllocation);
|
|
11
|
+
const calculateTotalFTE = (row) => {
|
|
12
|
+
if (!row.detailedAllocation)
|
|
13
|
+
return 0;
|
|
14
|
+
return Object.values(row.detailedAllocation).reduce((sum, value) => sum + (parseFloat(value) || 0), 0);
|
|
15
|
+
};
|
|
16
|
+
const handleAddResource = (taskId) => {
|
|
17
|
+
var _a;
|
|
18
|
+
const newResource = {
|
|
19
|
+
id: `new-${Date.now()}`,
|
|
20
|
+
taskId,
|
|
21
|
+
taskName: ((_a = data.find(r => r.taskId === taskId)) === null || _a === void 0 ? void 0 : _a.taskName) || '',
|
|
22
|
+
userId: '',
|
|
23
|
+
roleId: '',
|
|
24
|
+
detailedAllocation: monthsRange.reduce((acc, month) => (Object.assign(Object.assign({}, acc), { [month]: 0 })), {}),
|
|
25
|
+
};
|
|
26
|
+
setData([...data, newResource]);
|
|
27
|
+
};
|
|
28
|
+
const handleDeleteResource = (resourceId) => {
|
|
29
|
+
setData(data.filter(resource => resource.id !== resourceId));
|
|
30
|
+
};
|
|
31
|
+
const handleUpdateAllocation = (resourceId, month, value) => {
|
|
32
|
+
setData(data.map(resource => {
|
|
33
|
+
if (resource.id === resourceId) {
|
|
34
|
+
return Object.assign(Object.assign({}, resource), { detailedAllocation: Object.assign(Object.assign({}, resource.detailedAllocation), { [month]: parseFloat(value) || 0 }) });
|
|
35
|
+
}
|
|
36
|
+
return resource;
|
|
37
|
+
}));
|
|
38
|
+
};
|
|
39
|
+
const columns = useMemo(() => [
|
|
40
|
+
{
|
|
41
|
+
accessorKey: "taskName",
|
|
42
|
+
header: "Task Name",
|
|
43
|
+
cell: ({ row }) => row.original.taskName,
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
accessorKey: "userId",
|
|
47
|
+
header: "Employee Name",
|
|
48
|
+
cell: ({ row }) => {
|
|
49
|
+
var _a;
|
|
50
|
+
return (_jsxs(Select, { value: row.original.userId, onValueChange: (value) => {
|
|
51
|
+
setData(data.map(resource => resource.id === row.original.id
|
|
52
|
+
? Object.assign(Object.assign({}, resource), { userId: value }) : resource));
|
|
53
|
+
}, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Select employee", children: ((_a = userMaps.userDetailsMap[row.original.userId]) === null || _a === void 0 ? void 0 : _a.name) || "Select employee" }) }), _jsx(SelectContent, { children: Object.entries(userMaps.userDetailsMap).map(([id, user]) => (_jsx(SelectItem, { value: id, children: user.name }, id))) })] }));
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
accessorKey: "roleId",
|
|
58
|
+
header: "Role",
|
|
59
|
+
cell: ({ row }) => {
|
|
60
|
+
var _a;
|
|
61
|
+
return (_jsxs(Select, { value: row.original.roleId, onValueChange: (value) => {
|
|
62
|
+
setData(data.map(resource => resource.id === row.original.id
|
|
63
|
+
? Object.assign(Object.assign({}, resource), { roleId: value }) : resource));
|
|
64
|
+
}, children: [_jsx(SelectTrigger, { children: _jsx(SelectValue, { placeholder: "Select role", children: ((_a = userMaps.rolesMap[row.original.roleId]) === null || _a === void 0 ? void 0 : _a.roleName) || "Select role" }) }), _jsx(SelectContent, { children: Object.entries(userMaps.rolesMap).map(([id, role]) => (_jsx(SelectItem, { value: id, children: role.roleName }, id))) })] }));
|
|
65
|
+
},
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
accessorKey: "totalFTE",
|
|
69
|
+
header: "Total FTE",
|
|
70
|
+
cell: ({ row }) => calculateTotalFTE(row.original).toFixed(2),
|
|
71
|
+
},
|
|
72
|
+
...monthsRange.map(month => ({
|
|
73
|
+
accessorKey: `detailedAllocation.${month}`,
|
|
74
|
+
header: month.replace('_', ' '),
|
|
75
|
+
cell: ({ row }) => (_jsx(Input, { type: "number", min: "0", max: "1", step: "0.1", value: row.original.detailedAllocation[month] || 0, onChange: (e) => handleUpdateAllocation(row.original.id, month, e.target.value), className: "w-20" })),
|
|
76
|
+
})),
|
|
77
|
+
{
|
|
78
|
+
id: "actions",
|
|
79
|
+
cell: ({ row }) => (_jsxs("div", { className: "flex gap-2 justify-end", children: [_jsx(Button, { variant: "ghost", size: "icon", onClick: () => handleAddResource(row.original.taskId), children: _jsx(Plus, { className: "h-4 w-4" }) }), _jsx(Button, { variant: "ghost", size: "icon", onClick: () => handleDeleteResource(row.original.id), children: _jsx(Trash2, { className: "h-4 w-4" }) })] })),
|
|
80
|
+
},
|
|
81
|
+
], [data, monthsRange, userMaps]);
|
|
82
|
+
return (_jsx(DataTable, { columns: columns, data: data, extraParams: {
|
|
83
|
+
defaultGroups: ["taskName"],
|
|
84
|
+
grouping: true,
|
|
85
|
+
sorting: true,
|
|
86
|
+
header: true,
|
|
87
|
+
paginationBar: true,
|
|
88
|
+
} }));
|
|
89
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Skeleton } from "../../shadcn/skeleton";
|
|
4
|
+
export function GradeTableLoader({ rowCount = 6, showToolbar = true, }) {
|
|
5
|
+
return (_jsxs("div", { className: "space-y-4", children: [showToolbar && (_jsxs("div", { className: "flex justify-between", children: [_jsx(Skeleton, { className: "h-8 w-64 rounded-md" }), _jsx(Skeleton, { className: "h-8 w-32 rounded-md" })] })), _jsx("div", { className: "space-y-4", children: [...Array(rowCount)].map((_, i) => (_jsx("div", { className: "grid gap-4 items-center", children: _jsx(Skeleton, { className: "h-8 w-full" }) }, i))) })] }));
|
|
6
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from "../../shadcn/skeleton";
|
|
3
|
+
export function SkeletonWidget({ count }) {
|
|
4
|
+
return (_jsx("div", { className: 'flex flex-row gap-3 w-full', children: count > 0 && Array.from({ length: count }).map((_, index) => (_jsx(Skeleton, { className: "w-1/" + count + " flex flex-col md:flex-row gap-2 h-20", children: _jsx("div", { className: "flex flex-1 flex-row justify-between border rounded-md p-2 bg-card-new" }) }, 'widget_' + index))) }));
|
|
5
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function ThemeToggleBtn(): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
export declare function ThemeToggleBtn(): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,10 +1,118 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Waves, Moon, Sun } from "lucide-react";
|
|
4
3
|
import { useTheme } from "next-themes";
|
|
5
|
-
import {
|
|
4
|
+
import { useEffect, useState, useCallback } from "react";
|
|
5
|
+
import { Laptop, Moon, Sun, Check, Waves } from "lucide-react";
|
|
6
6
|
import { Button } from "../../shadcn/button";
|
|
7
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../../shadcn/dropdown-menu";
|
|
7
8
|
export function ThemeToggleBtn() {
|
|
8
|
-
const { theme,
|
|
9
|
-
|
|
9
|
+
const { setTheme, theme, resolvedTheme } = useTheme();
|
|
10
|
+
const [mounted, setMounted] = useState(false);
|
|
11
|
+
useEffect(() => {
|
|
12
|
+
setMounted(true);
|
|
13
|
+
}, []);
|
|
14
|
+
const activeTheme = theme === "system" ? resolvedTheme : theme;
|
|
15
|
+
const getLuminance = (hexColor) => {
|
|
16
|
+
const rgb = parseInt(hexColor.slice(1), 16);
|
|
17
|
+
const r = (rgb >> 16) & 0xff;
|
|
18
|
+
const g = (rgb >> 8) & 0xff;
|
|
19
|
+
const b = (rgb >> 0) & 0xff;
|
|
20
|
+
const [rs, gs, bs] = [r, g, b].map(c => {
|
|
21
|
+
c = c / 255;
|
|
22
|
+
return c <= 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
|
|
23
|
+
});
|
|
24
|
+
return 0.2126 * rs + 0.7152 * gs + 0.0722 * bs;
|
|
25
|
+
};
|
|
26
|
+
const getContrastColor = (bgColor) => {
|
|
27
|
+
const luminance = getLuminance(bgColor);
|
|
28
|
+
return luminance > 0.25 ? '#000000' : '#ffffff';
|
|
29
|
+
};
|
|
30
|
+
const applySavedColors = useCallback(() => {
|
|
31
|
+
const primaryColor = localStorage.getItem("primary") || '#0f172b';
|
|
32
|
+
const secondaryColor = localStorage.getItem("secondary") || '#1b2336';
|
|
33
|
+
const tertiaryColor = localStorage.getItem("tertiary") || '#010416';
|
|
34
|
+
const pChartColor = localStorage.getItem("primaryChart") || '#00bc7d';
|
|
35
|
+
const sChartColor = localStorage.getItem("secondaryChart") || '#fd9a00';
|
|
36
|
+
const tChartColor = localStorage.getItem("tertiaryChart") || '#ad46ff';
|
|
37
|
+
document.documentElement.style.setProperty('--background', primaryColor);
|
|
38
|
+
document.documentElement.style.setProperty('--secondary', secondaryColor);
|
|
39
|
+
document.documentElement.style.setProperty('--card', secondaryColor);
|
|
40
|
+
document.documentElement.style.setProperty('--popover', secondaryColor);
|
|
41
|
+
document.documentElement.style.setProperty('--muted', secondaryColor);
|
|
42
|
+
document.documentElement.style.setProperty('--sidebar', secondaryColor);
|
|
43
|
+
document.documentElement.style.setProperty('--btn-secondary', secondaryColor);
|
|
44
|
+
document.documentElement.style.setProperty('--accent', tertiaryColor);
|
|
45
|
+
document.documentElement.style.setProperty('--sidebar-primary', tertiaryColor);
|
|
46
|
+
document.documentElement.style.setProperty('--sidebar-accent', tertiaryColor);
|
|
47
|
+
document.documentElement.style.setProperty('--foreground', getContrastColor(primaryColor));
|
|
48
|
+
document.documentElement.style.setProperty('--secondary-foreground', getContrastColor(secondaryColor));
|
|
49
|
+
document.documentElement.style.setProperty('--card-foreground', getContrastColor(secondaryColor));
|
|
50
|
+
document.documentElement.style.setProperty('--popover-foreground', getContrastColor(secondaryColor));
|
|
51
|
+
document.documentElement.style.setProperty('--muted-foreground', getContrastColor(secondaryColor));
|
|
52
|
+
document.documentElement.style.setProperty('--sidebar-foreground', getContrastColor(secondaryColor));
|
|
53
|
+
document.documentElement.style.setProperty('--accent-foreground', getContrastColor(tertiaryColor));
|
|
54
|
+
document.documentElement.style.setProperty('--sidebar-primary-foreground', getContrastColor(tertiaryColor));
|
|
55
|
+
document.documentElement.style.setProperty('--sidebar-accent-foreground', getContrastColor(tertiaryColor));
|
|
56
|
+
document.documentElement.style.setProperty('--chart-1', pChartColor);
|
|
57
|
+
document.documentElement.style.setProperty('--chart-2', sChartColor);
|
|
58
|
+
document.documentElement.style.setProperty('--chart-3', tChartColor);
|
|
59
|
+
document.documentElement.style.setProperty('--chart-4', pChartColor);
|
|
60
|
+
document.documentElement.style.setProperty('--chart-5', sChartColor);
|
|
61
|
+
}, []);
|
|
62
|
+
const resetColors = useCallback(() => {
|
|
63
|
+
document.documentElement.style.removeProperty('--background');
|
|
64
|
+
document.documentElement.style.removeProperty('--secondary');
|
|
65
|
+
document.documentElement.style.removeProperty('--card');
|
|
66
|
+
document.documentElement.style.removeProperty('--popover');
|
|
67
|
+
document.documentElement.style.removeProperty('--muted');
|
|
68
|
+
document.documentElement.style.removeProperty('--sidebar');
|
|
69
|
+
document.documentElement.style.removeProperty('--btn-secondary');
|
|
70
|
+
document.documentElement.style.removeProperty('--accent');
|
|
71
|
+
document.documentElement.style.removeProperty('--sidebar-primary');
|
|
72
|
+
document.documentElement.style.removeProperty('--sidebar-accent');
|
|
73
|
+
document.documentElement.style.removeProperty('--foreground');
|
|
74
|
+
document.documentElement.style.removeProperty('--secondary-foreground');
|
|
75
|
+
document.documentElement.style.removeProperty('--card-foreground');
|
|
76
|
+
document.documentElement.style.removeProperty('--popover-foreground');
|
|
77
|
+
document.documentElement.style.removeProperty('--muted-foreground');
|
|
78
|
+
document.documentElement.style.removeProperty('--sidebar-foreground');
|
|
79
|
+
document.documentElement.style.removeProperty('--accent-foreground');
|
|
80
|
+
document.documentElement.style.removeProperty('--sidebar-primary-foreground');
|
|
81
|
+
document.documentElement.style.removeProperty('--sidebar-accent-foreground');
|
|
82
|
+
document.documentElement.style.removeProperty('--chart-1');
|
|
83
|
+
document.documentElement.style.removeProperty('--chart-2');
|
|
84
|
+
document.documentElement.style.removeProperty('--chart-3');
|
|
85
|
+
document.documentElement.style.removeProperty('--chart-4');
|
|
86
|
+
document.documentElement.style.removeProperty('--chart-5');
|
|
87
|
+
}, []);
|
|
88
|
+
useEffect(() => {
|
|
89
|
+
if (mounted && activeTheme === "blue-dark") {
|
|
90
|
+
document.documentElement.classList.add("blue-dark");
|
|
91
|
+
applySavedColors();
|
|
92
|
+
}
|
|
93
|
+
}, [mounted, activeTheme, applySavedColors]);
|
|
94
|
+
const setThemeSafe = useCallback((value) => {
|
|
95
|
+
setTheme(value);
|
|
96
|
+
if (value === "light" || value === "dark") {
|
|
97
|
+
document.documentElement.classList.remove("blue-dark");
|
|
98
|
+
resetColors();
|
|
99
|
+
}
|
|
100
|
+
if (value === "blue-dark") {
|
|
101
|
+
document.documentElement.classList.add("blue-dark");
|
|
102
|
+
applySavedColors();
|
|
103
|
+
}
|
|
104
|
+
}, [setTheme, applySavedColors, resetColors]);
|
|
105
|
+
if (!mounted)
|
|
106
|
+
return null;
|
|
107
|
+
const triggerIcon = (() => {
|
|
108
|
+
if (activeTheme === "blue-dark")
|
|
109
|
+
return _jsx(Waves, { className: "h-5 w-5" });
|
|
110
|
+
if (activeTheme === "dark")
|
|
111
|
+
return _jsx(Moon, { className: "h-5 w-5" });
|
|
112
|
+
if (activeTheme === "light")
|
|
113
|
+
return _jsx(Sun, { className: "h-5 w-5" });
|
|
114
|
+
return _jsx(Laptop, { className: "h-5 w-5" });
|
|
115
|
+
})();
|
|
116
|
+
const isActive = (value) => activeTheme === value;
|
|
117
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { variant: "outline", size: "icon", "aria-label": "Change theme", title: `Theme: ${theme === "system" ? `system (${resolvedTheme})` : theme}`, children: triggerIcon }) }), _jsxs(DropdownMenuContent, { align: "end", sideOffset: 8, children: [_jsxs(DropdownMenuItem, { onClick: () => setThemeSafe("light"), className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(Sun, { className: "mr-2 h-4 w-4" }), " Light"] }), isActive("light") && _jsx(Check, { className: "h-4 w-4" })] }), _jsxs(DropdownMenuItem, { onClick: () => setThemeSafe("dark"), className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(Moon, { className: "mr-2 h-4 w-4" }), " Dark"] }), isActive("dark") && _jsx(Check, { className: "h-4 w-4" })] }), _jsxs(DropdownMenuItem, { onClick: () => setThemeSafe("blue-dark"), className: "flex items-center justify-between gap-2", children: [_jsxs("div", { className: "flex items-center", children: [_jsx(Waves, { className: "mr-2 h-4 w-4" }), " Custom"] }), isActive("blue-dark") && _jsx(Check, { className: "h-4 w-4" })] })] })] }));
|
|
10
118
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function UploadTab(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect } from "react";
|
|
4
|
+
import { UploadIcon, X, Send } from "lucide-react";
|
|
5
|
+
import { Button } from "../../shadcn/button";
|
|
6
|
+
import { Input } from "../../shadcn/input";
|
|
7
|
+
import { Label } from "../../shadcn/label";
|
|
8
|
+
import { Progress } from "../../shadcn/progress";
|
|
9
|
+
import { useForm } from "react-hook-form";
|
|
10
|
+
import axios from "axios";
|
|
11
|
+
import { Form, FormField, FormItem, FormControl, FormMessage, } from "../../shadcn/form";
|
|
12
|
+
import { NoDataComponent } from "../no-data";
|
|
13
|
+
export function UploadTab() {
|
|
14
|
+
const form = useForm({
|
|
15
|
+
defaultValues: {
|
|
16
|
+
text: "",
|
|
17
|
+
fileNames: [],
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
const [inputValue, setInputValue] = useState("");
|
|
21
|
+
const [texts, setTexts] = useState([]);
|
|
22
|
+
const [fileNames, setFileNames] = useState([]); // Updated type
|
|
23
|
+
const [formattedDate, setFormattedDate] = useState("");
|
|
24
|
+
const [noFilesUploaded, setNoFilesUploaded] = useState(true);
|
|
25
|
+
const isUploading = fileNames.some((file) => file.progress < 100);
|
|
26
|
+
const simulateFileUpload = async (idx, file) => {
|
|
27
|
+
const formData = new FormData();
|
|
28
|
+
formData.append("file", file.file); // Use the actual file object
|
|
29
|
+
try {
|
|
30
|
+
const response = await axios.post("UPLOAD_ENDPOINT_URL", formData, {
|
|
31
|
+
onUploadProgress: (progressEvent) => {
|
|
32
|
+
const progress = Math.round((progressEvent.loaded * 100) / (progressEvent.total || 1));
|
|
33
|
+
setFileNames((prev) => prev.map((f, i) => (i === idx ? Object.assign(Object.assign({}, f), { progress }) : f)));
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
setFileNames((prev) => prev.map((f, i) => i === idx ? Object.assign(Object.assign({}, f), { url: response.data.url, progress: 100 }) : f));
|
|
37
|
+
}
|
|
38
|
+
catch (error) {
|
|
39
|
+
console.error("Upload failed:", error);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
useEffect(() => {
|
|
43
|
+
const currentDate = new Date();
|
|
44
|
+
const day = String(currentDate.getDate()).padStart(2, "0");
|
|
45
|
+
const month = String(currentDate.getMonth() + 1).padStart(2, "0");
|
|
46
|
+
const year = currentDate.getFullYear();
|
|
47
|
+
setFormattedDate(`${day}-${month}-${year}`);
|
|
48
|
+
}, []);
|
|
49
|
+
useEffect(() => {
|
|
50
|
+
fileNames.forEach((file, idx) => {
|
|
51
|
+
if (file.progress === 0) {
|
|
52
|
+
simulateFileUpload(idx, file);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}, [fileNames]);
|
|
56
|
+
const handleAddText = () => {
|
|
57
|
+
if (inputValue.trim() || fileNames.length > 0) {
|
|
58
|
+
const newEntry = {
|
|
59
|
+
text: inputValue.trim(),
|
|
60
|
+
fileNames: fileNames.map((file) => file.name),
|
|
61
|
+
};
|
|
62
|
+
setTexts([newEntry, ...texts]);
|
|
63
|
+
setInputValue("");
|
|
64
|
+
setFileNames([]);
|
|
65
|
+
setNoFilesUploaded(false);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const handleFileUpload = (e) => {
|
|
69
|
+
if (e.target.files) {
|
|
70
|
+
const uploadedFiles = Array.from(e.target.files).map((file) => ({
|
|
71
|
+
name: file.name,
|
|
72
|
+
url: "",
|
|
73
|
+
progress: 0,
|
|
74
|
+
file,
|
|
75
|
+
}));
|
|
76
|
+
setFileNames((prev) => [...prev, ...uploadedFiles]); // Type now matches correctly
|
|
77
|
+
setNoFilesUploaded(false);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
const removeFile = (index) => {
|
|
81
|
+
const updatedFiles = fileNames.filter((_, idx) => idx !== index);
|
|
82
|
+
setFileNames(updatedFiles);
|
|
83
|
+
if (updatedFiles.length === 0 && texts.length === 0) {
|
|
84
|
+
setNoFilesUploaded(true);
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
return (_jsx(_Fragment, { children: _jsxs("div", { className: "flex flex-col h-full w-full gap-3", children: [_jsxs("div", { className: "flex-grow overflow-auto flex flex-col-reverse gap-2", children: [noFilesUploaded && _jsx(NoDataComponent, { text: "No files uploaded" }), fileNames.length > 0 && (_jsxs("div", { className: "p-2 my-1 rounded-md border", children: [_jsx("p", { className: "font-bold", children: "Selected Files:" }), fileNames.map((file, idx) => (_jsxs("div", { className: "flex flex-col mb-2", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsx("a", { href: file.url, download: file.name, className: "text-sm text-blue-600 underline cursor-pointer", children: file.name }), _jsx("button", { onClick: () => removeFile(idx), className: "text-red-500 hover:text-red-800", children: _jsx(X, { className: "w-4 h-4" }) })] }), _jsx(Progress, { value: file.progress }), _jsxs("p", { className: "text-xs text-gray-500", children: [file.progress, "% uploaded"] })] }, idx)))] })), texts.map((entry, index) => (_jsxs("div", { className: "border-b text-sm pb-2", children: [entry.fileNames.map((fileName, idx) => {
|
|
88
|
+
var _a;
|
|
89
|
+
return (_jsx("p", { children: _jsx("a", { href: ((_a = fileNames.find((file) => file.name === fileName)) === null || _a === void 0 ? void 0 : _a.url) ||
|
|
90
|
+
"#", download: fileName, className: "text-sm text-blue-500 underline cursor-pointer", children: fileName }) }, idx));
|
|
91
|
+
}), _jsx("p", { children: entry.text || "(No Text)" }), _jsxs("div", { className: "flex justify-between", children: [_jsx("p", { children: "John Doe" }), _jsx("p", { children: formattedDate })] })] }, index)))] }), _jsx(Form, Object.assign({}, form, { children: _jsx("form", { onSubmit: form.handleSubmit(() => handleAddText()), children: _jsx("div", { className: "flex flex-col", children: _jsxs("div", { className: "flex items-center justify-center gap-2", children: [_jsx("div", { className: "flex-1", children: _jsx(FormField, { name: "text", render: ({ field }) => (_jsxs(FormItem, { children: [_jsx(FormControl, { children: _jsx(Input, { id: "text-input", type: "text", value: inputValue, onChange: (e) => setInputValue(e.target.value), placeholder: "Type something..." }) }), _jsx(FormMessage, {})] })) }) }), _jsxs("div", { className: "flex items-center gap-2", children: [_jsx(Label, { htmlFor: "file-upload", className: "sr-only", children: "Upload Files" }), _jsx(Button, { variant: "outline", asChild: true, children: _jsx("label", { htmlFor: "file-upload", className: "cursor-pointer", children: _jsx(UploadIcon, { className: "w-5 h-5" }) }) }), _jsx(Input, { id: "file-upload", type: "file", multiple: true, onChange: handleFileUpload, className: "hidden" })] }), _jsx(Button, { variant: "outline", type: "submit", disabled: isUploading, children: _jsx(Send, {}) })] }) }) }) }))] }) }));
|
|
92
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -34,6 +34,14 @@ export * from "./shadcn/tabs";
|
|
|
34
34
|
export * from "./shadcn/textarea";
|
|
35
35
|
export * from "./shadcn/tooltip";
|
|
36
36
|
export * from "./shadcn/workflow";
|
|
37
|
+
export * from "./shadcn/aspect-ratio";
|
|
38
|
+
export * from "./shadcn/breadcrumb";
|
|
39
|
+
export * from "./shadcn/collapsible";
|
|
40
|
+
export * from "./shadcn/drawer";
|
|
41
|
+
export * from "./shadcn/form";
|
|
42
|
+
export * from "./shadcn/input-otp";
|
|
43
|
+
export * from "./shadcn/toggle-group";
|
|
44
|
+
export * from "./shadcn/toggle";
|
|
37
45
|
export { ActionMenu } from "./ikoncomponents/action-menu";
|
|
38
46
|
export type { ActionMenuProps, ExtraActionParams } from "./ikoncomponents/action-menu/type";
|
|
39
47
|
export { CustomAlertDialog } from "./ikoncomponents/alert-dialog";
|
|
@@ -73,6 +81,39 @@ export { FrameworkItemDropdown } from "./ikoncomponents/twolevel-dropdown";
|
|
|
73
81
|
export type { FrameworkEntry, TreeNode, ParentEntry, ProcessedFrameworkData } from "./ikoncomponents/twolevel-dropdown";
|
|
74
82
|
export { Widgets } from "./ikoncomponents/widgets";
|
|
75
83
|
export type { WidgetProps, WidgetsFunctionProps } from "./ikoncomponents/widgets/type";
|
|
84
|
+
export { BreadcrumbProvider, useBreadcrumb } from "./ikoncomponents/app-breadcrumb/BreadcrumbProvider";
|
|
85
|
+
export type { BreadcrumbItemProps } from "./ikoncomponents/app-breadcrumb/BreadcrumbProvider";
|
|
86
|
+
export { AppBreadcrumb, RenderAppBreadcrumb } from "./ikoncomponents/app-breadcrumb";
|
|
87
|
+
export { FormComboboxInput } from "./ikoncomponents/form-fields/combobox-input";
|
|
88
|
+
export { FormComboboxInputWithValue } from "./ikoncomponents/form-fields/combobox-input-value";
|
|
89
|
+
export { FormDateInput } from "./ikoncomponents/form-fields/date-input";
|
|
90
|
+
export { FormFileInput } from "./ikoncomponents/form-fields/file-input";
|
|
91
|
+
export { FormInput } from "./ikoncomponents/form-fields/input";
|
|
92
|
+
export { dFormMultiComboboxInput } from "./ikoncomponents/form-fields/multi-combobox-input";
|
|
93
|
+
export { FormOtpInput } from "./ikoncomponents/form-fields/otp-input";
|
|
94
|
+
export { FormPhoneInput } from "./ikoncomponents/form-fields/phone-input";
|
|
95
|
+
export { FormTextarea } from "./ikoncomponents/form-fields/textarea";
|
|
96
|
+
export type { FormFieldProps, FormInputProps, FormTextareaProps, FormDateInputProps, FormComboboxInputProps, FormComboboxItemProps } from "./ikoncomponents/form-fields/types";
|
|
97
|
+
export { GradeTableLoader } from "./ikoncomponents/skeleton-loader/skeleton-table";
|
|
98
|
+
export type { GradeTableLoaderProps } from "./ikoncomponents/skeleton-loader/skeleton-table";
|
|
99
|
+
export { SkeletonWidget } from "./ikoncomponents/skeleton-loader/skeleton-widget";
|
|
100
|
+
export { UploadTab } from "./ikoncomponents/upload-tab";
|
|
101
|
+
export { AppSidebar } from "./ikoncomponents/main-layout/app-sidebar";
|
|
102
|
+
export { Footer } from "./ikoncomponents/main-layout/footer";
|
|
103
|
+
export { Header } from "./ikoncomponents/main-layout/header";
|
|
104
|
+
export type { Account, Software } from "./ikoncomponents/main-layout/main-sidebar";
|
|
105
|
+
export { MainSidebar } from "./ikoncomponents/main-layout/main-sidebar";
|
|
106
|
+
export { NavMain } from "./ikoncomponents/main-layout/nav-main";
|
|
107
|
+
export type { SidebarNavSubItem, SidebarNavItem, SidebarNavContextType } from "./ikoncomponents/main-layout/SidebarNavContext";
|
|
108
|
+
export { SidebarNavProvider, useSidebarNav } from "./ikoncomponents/main-layout/SidebarNavContext";
|
|
109
|
+
export { MainLayout } from "./ikoncomponents/main-layout";
|
|
76
110
|
export { ThemeProvider } from "./utils/theme-provider";
|
|
111
|
+
export { RadiusProvider, useRadius } from "./utils/border-radius-provider";
|
|
112
|
+
export { FontProvider, useFont } from "./utils/font-provider";
|
|
77
113
|
export { cn } from "./utils/cn";
|
|
114
|
+
export type { CookieSessionOptionsProps } from "./utils/session/cookieSession";
|
|
115
|
+
export { setCookieSession, getCookieSession, clearCookieSession, clearAllCookieSession } from "./utils/session/cookieSession";
|
|
116
|
+
export { getValidAccessToken, refreshAccessToken, logOut } from "./utils/token-management";
|
|
117
|
+
export type { AccessTokenOptionsProps } from "./utils/token-management";
|
|
118
|
+
export type { TokenResponse } from "./utils/token-management/types";
|
|
78
119
|
export { useIsMobile } from "./hooks/use-mobile";
|
package/dist/index.js
CHANGED
|
@@ -34,6 +34,14 @@ export * from "./shadcn/tabs";
|
|
|
34
34
|
export * from "./shadcn/textarea";
|
|
35
35
|
export * from "./shadcn/tooltip";
|
|
36
36
|
export * from "./shadcn/workflow";
|
|
37
|
+
export * from "./shadcn/aspect-ratio";
|
|
38
|
+
export * from "./shadcn/breadcrumb";
|
|
39
|
+
export * from "./shadcn/collapsible";
|
|
40
|
+
export * from "./shadcn/drawer";
|
|
41
|
+
export * from "./shadcn/form";
|
|
42
|
+
export * from "./shadcn/input-otp";
|
|
43
|
+
export * from "./shadcn/toggle-group";
|
|
44
|
+
export * from "./shadcn/toggle";
|
|
37
45
|
export { ActionMenu } from "./ikoncomponents/action-menu";
|
|
38
46
|
export { CustomAlertDialog } from "./ikoncomponents/alert-dialog";
|
|
39
47
|
export { TextButton, TextButtonWithTooltip, IconTextButton, IconTextButtonWithTooltip, IconButton, IconButtonWithTooltip } from "./ikoncomponents/buttons";
|
|
@@ -65,6 +73,31 @@ export { TitleProgress } from "./ikoncomponents/title-progress";
|
|
|
65
73
|
export { TooltipComponent } from "./ikoncomponents/tooltip";
|
|
66
74
|
export { FrameworkItemDropdown } from "./ikoncomponents/twolevel-dropdown";
|
|
67
75
|
export { Widgets } from "./ikoncomponents/widgets";
|
|
76
|
+
export { BreadcrumbProvider, useBreadcrumb } from "./ikoncomponents/app-breadcrumb/BreadcrumbProvider";
|
|
77
|
+
export { AppBreadcrumb, RenderAppBreadcrumb } from "./ikoncomponents/app-breadcrumb";
|
|
78
|
+
export { FormComboboxInput } from "./ikoncomponents/form-fields/combobox-input";
|
|
79
|
+
export { FormComboboxInputWithValue } from "./ikoncomponents/form-fields/combobox-input-value";
|
|
80
|
+
export { FormDateInput } from "./ikoncomponents/form-fields/date-input";
|
|
81
|
+
export { FormFileInput } from "./ikoncomponents/form-fields/file-input";
|
|
82
|
+
export { FormInput } from "./ikoncomponents/form-fields/input";
|
|
83
|
+
export { dFormMultiComboboxInput } from "./ikoncomponents/form-fields/multi-combobox-input";
|
|
84
|
+
export { FormOtpInput } from "./ikoncomponents/form-fields/otp-input";
|
|
85
|
+
export { FormPhoneInput } from "./ikoncomponents/form-fields/phone-input";
|
|
86
|
+
export { FormTextarea } from "./ikoncomponents/form-fields/textarea";
|
|
87
|
+
export { GradeTableLoader } from "./ikoncomponents/skeleton-loader/skeleton-table";
|
|
88
|
+
export { SkeletonWidget } from "./ikoncomponents/skeleton-loader/skeleton-widget";
|
|
89
|
+
export { UploadTab } from "./ikoncomponents/upload-tab";
|
|
90
|
+
export { AppSidebar } from "./ikoncomponents/main-layout/app-sidebar";
|
|
91
|
+
export { Footer } from "./ikoncomponents/main-layout/footer";
|
|
92
|
+
export { Header } from "./ikoncomponents/main-layout/header";
|
|
93
|
+
export { MainSidebar } from "./ikoncomponents/main-layout/main-sidebar";
|
|
94
|
+
export { NavMain } from "./ikoncomponents/main-layout/nav-main";
|
|
95
|
+
export { SidebarNavProvider, useSidebarNav } from "./ikoncomponents/main-layout/SidebarNavContext";
|
|
96
|
+
export { MainLayout } from "./ikoncomponents/main-layout";
|
|
68
97
|
export { ThemeProvider } from "./utils/theme-provider";
|
|
98
|
+
export { RadiusProvider, useRadius } from "./utils/border-radius-provider";
|
|
99
|
+
export { FontProvider, useFont } from "./utils/font-provider";
|
|
69
100
|
export { cn } from "./utils/cn";
|
|
101
|
+
export { setCookieSession, getCookieSession, clearCookieSession, clearAllCookieSession } from "./utils/session/cookieSession";
|
|
102
|
+
export { getValidAccessToken, refreshAccessToken, logOut } from "./utils/token-management";
|
|
70
103
|
export { useIsMobile } from "./hooks/use-mobile";
|