ikoncomponents 1.3.0 → 1.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ikoncomponents/activity-sheet/index.js +2 -2
- package/dist/ikoncomponents/big-calendar/big-calender-toolbar/index.js +2 -2
- package/dist/ikoncomponents/main-layout/footer.js +2 -1
- package/dist/ikoncomponents/main-layout/header.js +4 -3
- package/dist/ikoncomponents/main-layout/main-sidebar.d.ts +17 -5
- package/dist/ikoncomponents/main-layout/main-sidebar.js +13 -5
- package/dist/ikoncomponents/tabs/index.d.ts +1 -1
- package/dist/ikoncomponents/tabs/index.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/styles.css +7 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AlignJustify } from "lucide-react";
|
|
4
|
-
import {
|
|
4
|
+
import { CustomTabs } from "../tabs";
|
|
5
5
|
import { NoDataComponent } from "../no-data";
|
|
6
6
|
import { UploadTab } from "../upload-tab";
|
|
7
7
|
import { SheetComponent } from "../sheet";
|
|
@@ -19,5 +19,5 @@ export function ActivitySheet({ activityLogs = [] }) {
|
|
|
19
19
|
tabContent: _jsx(UploadTab, {})
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
|
-
return (_jsx(SheetComponent, { buttonText: "", buttonIcon: _jsx(AlignJustify, {}), sheetTitle: "", sheetContent: _jsx(
|
|
22
|
+
return (_jsx(SheetComponent, { buttonText: "", buttonIcon: _jsx(AlignJustify, {}), sheetTitle: "", sheetContent: _jsx(CustomTabs, { tabArray: tabArray, tabListClass: '' }), closeButton: true }));
|
|
23
23
|
}
|
|
@@ -20,7 +20,7 @@ export default function BigCalenderToolbar({ onNavigate, onView, label, extraToo
|
|
|
20
20
|
default:
|
|
21
21
|
break;
|
|
22
22
|
}
|
|
23
|
-
}, children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "PREV", children: _jsx(ChevronLeft, { size: 16 }) }), _jsx(ToggleGroupItem, { className:
|
|
23
|
+
}, children: [_jsx(ToggleGroupItem, { className: "rounded-e-none", value: "PREV", children: _jsx(ChevronLeft, { size: 16 }) }), _jsx(ToggleGroupItem, { className: "rounded-none border-x", value: "NEXT", children: _jsx(ChevronRight, { size: 16 }) }), _jsx(ToggleGroupItem, { className: "rounded-s-none", value: "TODAY", children: "Today" })] }), _jsx("span", { className: "rbc-toolbar-label", children: label }), _jsxs("div", { className: "flex flex-row gap-2", children: [_jsxs(ToggleGroup, { type: "single", variant: 'outline', value: calViewsValue, onValueChange: (value) => {
|
|
24
24
|
setValue(value);
|
|
25
25
|
switch (value) {
|
|
26
26
|
case "DAY":
|
|
@@ -35,5 +35,5 @@ export default function BigCalenderToolbar({ onNavigate, onView, label, extraToo
|
|
|
35
35
|
default:
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
|
-
}, children: [_jsx(ToggleGroupItem, { className:
|
|
38
|
+
}, children: [_jsx(ToggleGroupItem, { className: 'rounded-e-none', value: "MONTH", children: "Month" }), _jsx(ToggleGroupItem, { className: 'rounded-none border-x-0', value: "WEEK", children: "Week" }), _jsx(ToggleGroupItem, { className: "rounded-s-none", value: "DAY", children: "Day" })] }), extraTools === null || extraTools === void 0 ? void 0 : extraTools.map((tool, index) => _jsx(Fragment, { children: tool }, index))] })] }) }));
|
|
39
39
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Copyright } from "lucide-react";
|
|
2
3
|
export function Footer() {
|
|
3
|
-
return (_jsx("footer", { className: "ml-12 flex border-t px-4 py-2 justify-center lg:justify-start", children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx("span", { children: "Powered By" }), _jsx("a", { href: "https://keross.com", target: "_blank", children: "Keross" }), _jsx("span", { className: "", children: "|" }), _jsx("span", { id: "txtCopyrightYear", className: "", children: new Date().getFullYear() })] }) }));
|
|
4
|
+
return (_jsx("footer", { className: "ml-12 flex border-t px-4 py-2 justify-center lg:justify-start", children: _jsxs("div", { className: "flex gap-2 items-center", children: [_jsx(Copyright, {}), _jsx("span", { children: "Powered By" }), _jsx("a", { href: "https://keross.com", target: "_blank", children: "Keross" }), _jsx("span", { className: "", children: "|" }), _jsx("span", { id: "txtCopyrightYear", className: "", children: new Date().getFullYear() })] }) }));
|
|
4
5
|
}
|
|
@@ -3,12 +3,13 @@ import { AppBreadcrumb } from "../app-breadcrumb";
|
|
|
3
3
|
import { ThemeToggleBtn } from "../theme-toggle-btn";
|
|
4
4
|
import { Separator } from "../../shadcn/separator";
|
|
5
5
|
import { SidebarTrigger } from "../../shadcn/sidebar";
|
|
6
|
-
import { Bell,
|
|
7
|
-
import {
|
|
6
|
+
import { Bell, Play } from "lucide-react";
|
|
7
|
+
import { IconButtonWithTooltip, IconTextButton } from "../buttons";
|
|
8
8
|
import { useSidebarNav } from "./SidebarNavContext";
|
|
9
|
+
import Link from "next/link";
|
|
9
10
|
export function Header() {
|
|
10
11
|
const { navItems } = useSidebarNav();
|
|
11
12
|
return (_jsx("header", { className: "ml-12 flex h-12 border-b shrink-0 items-center gap-2 transition-[width,height] ease-linear group-has-data-[collapsible=icon]/sidebar-wrapper:h-12", children: _jsxs("div", { className: "flex items-center justify-between gap-2 px-4 w-full", children: [_jsxs("div", { className: "flex items-center gap-2", children: [(!navItems || navItems.length === 0) ? _jsx("div", {}) : _jsx(SidebarTrigger, { className: "-ml-1" }), (!navItems || navItems.length === 0) ?
|
|
12
13
|
_jsx("div", {}) :
|
|
13
|
-
_jsx(Separator, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }), _jsx(AppBreadcrumb, {})] }), _jsxs("div", { className: "ml-auto flex gap-4", children: [_jsx(
|
|
14
|
+
_jsx(Separator, { orientation: "vertical", className: "mr-2 data-[orientation=vertical]:h-4" }), _jsx(AppBreadcrumb, {})] }), _jsxs("div", { className: "ml-auto flex gap-4", children: [_jsx(IconButtonWithTooltip, { className: "px-2!", tooltipContent: "Notifications", children: _jsx(Bell, {}) }), _jsx(ThemeToggleBtn, {}), _jsx(Link, { href: "/app-store", children: _jsxs(IconTextButton, { variant: "default", children: [_jsx(Play, {}), "App Store"] }) })] })] }) }));
|
|
14
15
|
}
|
|
@@ -12,11 +12,23 @@ export interface Account {
|
|
|
12
12
|
export interface Software {
|
|
13
13
|
softwareId: string;
|
|
14
14
|
softwareName: string;
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
15
|
+
displayName: string;
|
|
16
|
+
softwareDescription: string;
|
|
17
|
+
softwareVersion: string;
|
|
18
|
+
softwareOwner: string;
|
|
19
|
+
softwareDeveloper: string;
|
|
20
|
+
softwareManager: string;
|
|
21
|
+
softwareVisibility: "PUBLIC" | "PRIVATE";
|
|
22
|
+
softwareStatus: string;
|
|
23
|
+
repoName: string;
|
|
24
|
+
active: boolean;
|
|
25
|
+
price: number;
|
|
26
|
+
currency: string | null;
|
|
27
|
+
logoResourceId: string | null;
|
|
28
|
+
icon: string | null;
|
|
29
|
+
link: string | null;
|
|
30
|
+
category: string | null;
|
|
31
|
+
videoResources: any[];
|
|
20
32
|
}
|
|
21
33
|
export interface User {
|
|
22
34
|
userId: string;
|
|
@@ -11,6 +11,7 @@ import axios from 'axios';
|
|
|
11
11
|
import { redirect } from 'next/navigation';
|
|
12
12
|
import Link from 'next/link';
|
|
13
13
|
import { jwtDecode } from "jwt-decode";
|
|
14
|
+
import { Icon } from '../icon';
|
|
14
15
|
export const MainSidebar = ({ baseUrl }) => {
|
|
15
16
|
const [user, setUser] = React.useState();
|
|
16
17
|
const [accounts, setAccounts] = React.useState([]);
|
|
@@ -24,6 +25,12 @@ export const MainSidebar = ({ baseUrl }) => {
|
|
|
24
25
|
.toUpperCase()
|
|
25
26
|
.slice(0, 2);
|
|
26
27
|
};
|
|
28
|
+
function toPascalCase(icon) {
|
|
29
|
+
return icon
|
|
30
|
+
.split("-")
|
|
31
|
+
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
|
32
|
+
.join("");
|
|
33
|
+
}
|
|
27
34
|
React.useEffect(() => {
|
|
28
35
|
const fetchUser = async () => {
|
|
29
36
|
try {
|
|
@@ -58,7 +65,7 @@ export const MainSidebar = ({ baseUrl }) => {
|
|
|
58
65
|
const fetchSubscribedSoftwares = async () => {
|
|
59
66
|
try {
|
|
60
67
|
const accessToken = await getValidAccessToken();
|
|
61
|
-
const response = await axios.get(`${baseUrl}/platform/software/accessible/
|
|
68
|
+
const response = await axios.get(`${baseUrl}/platform/software/accessible/account`, {
|
|
62
69
|
headers: {
|
|
63
70
|
Authorization: `Bearer ${accessToken}`,
|
|
64
71
|
},
|
|
@@ -75,10 +82,11 @@ export const MainSidebar = ({ baseUrl }) => {
|
|
|
75
82
|
}, []);
|
|
76
83
|
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: () => {
|
|
77
84
|
setSelectedAccount(account);
|
|
78
|
-
}, 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-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
85
|
+
}, 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-1", children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: 'h-8 w-8', children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: "/home", children: [_jsx(Home, { className: "h-8 w-8" }), _jsx("span", { className: "sr-only", children: "Home" })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: "Home" })] }, "home") }), _jsx("nav", { className: "flex flex-col gap-1 flex-1", children: softwares.map((software) => {
|
|
86
|
+
var _a, _b;
|
|
87
|
+
const hasIcon = Boolean(software.icon && software.icon.trim() !== "");
|
|
88
|
+
return (_jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: "h-8 w-8", children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: (_a = software.link) !== null && _a !== void 0 ? _a : "#", children: [hasIcon ? (_jsx(Icon, { name: toPascalCase((_b = software.icon) !== null && _b !== void 0 ? _b : ''), className: "h-8 w-8" })) : (_jsx(FolderCode, { className: "h-8 w-8" })), _jsx("span", { className: "sr-only", children: software.softwareName })] }) }) }), _jsx(TooltipContent, { side: "right", sideOffset: 5, children: software.softwareName })] }, software.softwareName));
|
|
89
|
+
}) }), _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { asChild: true, className: 'h-8 w-8', 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-8 w-8" }), _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-8 w-8', children: _jsx(Button, { variant: "ghost", size: "icon", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: "/favourites", children: [_jsx(Heart, { className: "h-8 w-8" }), _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-8 w-8', children: _jsx(Button, { variant: "ghost", className: "h-10 w-10", asChild: true, children: _jsxs(Link, { href: "/settings", children: [_jsx(Settings, { className: "h-8 w-8" }), _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", children: _jsx(CircleUserRound, { className: "h-8 w-8" }) }) }), _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: [_jsx(CircleUserRound, { className: "h-8 w-8" }), _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 === null || user === void 0 ? void 0 : user.userName }), _jsx("p", { className: "text-xs text-muted-foreground truncate", children: user === null || user === void 0 ? void 0 : user.userEmail }), _jsx("p", { className: "text-sm text-muted-foreground font-semibold", children: selectedAccount === null || selectedAccount === void 0 ? void 0 : selectedAccount.accountName })] })] }), _jsx(DropdownMenuSeparator, { className: "my-0" }), _jsxs(DropdownMenuItem, { onClick: async () => {
|
|
82
90
|
await clearAllCookieSession();
|
|
83
91
|
redirect("/login.html");
|
|
84
92
|
}, 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" })] })] })] })] }) }));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { TabProps } from "./type";
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function CustomTabs({ children, tabArray, pathName, tabListClass, tabListInnerClass, tabListButtonClass, tabContentClass, headerEndComponent, onTabChange, isSeperatePage, }: TabProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,7 +7,7 @@ import { TextButton } from "../buttons";
|
|
|
7
7
|
import { Card } from "../../shadcn/card";
|
|
8
8
|
import { useEffect, useState } from "react";
|
|
9
9
|
import { useIsMobile } from "../../hooks/use-mobile";
|
|
10
|
-
export function
|
|
10
|
+
export function CustomTabs({ children, tabArray, pathName, tabListClass = "", tabListInnerClass = "", tabListButtonClass = "", tabContentClass = "", headerEndComponent, onTabChange, isSeperatePage = false, }) {
|
|
11
11
|
var _a, _b;
|
|
12
12
|
// const pathName = usePathname();
|
|
13
13
|
const [itemToDisplay, setItemToDisplay] = useState(5);
|
package/dist/index.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export { PhoneInput } from "./ikoncomponents/phone-input";
|
|
|
74
74
|
export { SearchInput } from "./ikoncomponents/search-input";
|
|
75
75
|
export { SheetComponent } from "./ikoncomponents/sheet";
|
|
76
76
|
export { SimpleWidget } from "./ikoncomponents/simple-widget";
|
|
77
|
-
export {
|
|
77
|
+
export { CustomTabs } from "./ikoncomponents/tabs";
|
|
78
78
|
export type { TabArray, TabProps } from "./ikoncomponents/tabs/type";
|
|
79
79
|
export { ThemeToggleBtn } from "./ikoncomponents/theme-toggle-btn";
|
|
80
80
|
export { TitleProgress } from "./ikoncomponents/title-progress";
|
package/dist/index.js
CHANGED
|
@@ -68,7 +68,7 @@ export { PhoneInput } from "./ikoncomponents/phone-input";
|
|
|
68
68
|
export { SearchInput } from "./ikoncomponents/search-input";
|
|
69
69
|
export { SheetComponent } from "./ikoncomponents/sheet";
|
|
70
70
|
export { SimpleWidget } from "./ikoncomponents/simple-widget";
|
|
71
|
-
export {
|
|
71
|
+
export { CustomTabs } from "./ikoncomponents/tabs";
|
|
72
72
|
export { ThemeToggleBtn } from "./ikoncomponents/theme-toggle-btn";
|
|
73
73
|
export { TitleProgress } from "./ikoncomponents/title-progress";
|
|
74
74
|
export { TooltipComponent } from "./ikoncomponents/tooltip";
|
package/dist/styles.css
CHANGED
|
@@ -1184,6 +1184,10 @@
|
|
|
1184
1184
|
border-style: var(--tw-border-style) !important;
|
|
1185
1185
|
border-width: 2px !important;
|
|
1186
1186
|
}
|
|
1187
|
+
.border-x {
|
|
1188
|
+
border-inline-style: var(--tw-border-style);
|
|
1189
|
+
border-inline-width: 1px;
|
|
1190
|
+
}
|
|
1187
1191
|
.border-x-0 {
|
|
1188
1192
|
border-inline-style: var(--tw-border-style);
|
|
1189
1193
|
border-inline-width: 0px;
|
|
@@ -1463,6 +1467,9 @@
|
|
|
1463
1467
|
.px-2 {
|
|
1464
1468
|
padding-inline: calc(var(--spacing) * 2);
|
|
1465
1469
|
}
|
|
1470
|
+
.px-2\! {
|
|
1471
|
+
padding-inline: calc(var(--spacing) * 2) !important;
|
|
1472
|
+
}
|
|
1466
1473
|
.px-2\.5 {
|
|
1467
1474
|
padding-inline: calc(var(--spacing) * 2.5);
|
|
1468
1475
|
}
|