ikoncomponents 1.1.5 → 1.1.7
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/hooks/use-mobile.js +2 -38
- package/dist/ikoncomponents/action-menu/index.js +15 -18
- package/dist/ikoncomponents/action-menu/type.js +1 -2
- package/dist/ikoncomponents/alert-dialog/index.js +6 -10
- package/dist/ikoncomponents/buttons/index.js +32 -23
- package/dist/ikoncomponents/combobox-input/index.js +14 -16
- package/dist/ikoncomponents/combobox-input/type.js +1 -2
- package/dist/ikoncomponents/data-table/datatable-column-filter/index.js +13 -16
- package/dist/ikoncomponents/data-table/datatable-faceted-filter/index.js +22 -58
- package/dist/ikoncomponents/data-table/datatable-filter-menu/index.js +18 -21
- package/dist/ikoncomponents/data-table/datatable-pagination/index.js +10 -13
- package/dist/ikoncomponents/data-table/datatable-toolbar/index.js +17 -19
- package/dist/ikoncomponents/data-table/function.js +4 -7
- package/dist/ikoncomponents/data-table/index.js +81 -116
- package/dist/ikoncomponents/data-table/type.js +1 -2
- package/dist/ikoncomponents/e-chart/index.js +32 -37
- package/dist/ikoncomponents/file-input/index.js +20 -11
- package/dist/ikoncomponents/glowing-effect/index.js +16 -18
- package/dist/ikoncomponents/icon/index.js +16 -40
- package/dist/ikoncomponents/loading-spinner/index.js +16 -8
- package/dist/ikoncomponents/multi-combobox/index.js +31 -30
- package/dist/ikoncomponents/no-data/index.js +4 -7
- package/dist/ikoncomponents/page-wrapper/index.js +5 -8
- package/dist/ikoncomponents/password-strength-meter/index.js +6 -13
- package/dist/ikoncomponents/phone-input/index.js +30 -54
- package/dist/ikoncomponents/resource-spreadsheet/index.js +11 -48
- package/dist/ikoncomponents/search-input/index.js +18 -9
- package/dist/ikoncomponents/sheet/index.js +5 -8
- package/dist/ikoncomponents/simple-widget/index.js +8 -11
- package/dist/ikoncomponents/tabs/index.js +20 -22
- package/dist/ikoncomponents/tabs/type.js +1 -2
- package/dist/ikoncomponents/theme-toggle-btn/index.js +8 -11
- package/dist/ikoncomponents/title-progress/index.js +4 -7
- package/dist/ikoncomponents/tooltip/index.js +4 -7
- package/dist/ikoncomponents/twolevel-dropdown/index.js +20 -53
- package/dist/ikoncomponents/widgets/index.js +10 -13
- package/dist/ikoncomponents/widgets/type.js +1 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +70 -123
- package/dist/shadcn/accordion.js +28 -51
- package/dist/shadcn/alert-dialog.js +60 -70
- package/dist/shadcn/alert.d.ts +1 -1
- package/dist/shadcn/alert.js +25 -15
- package/dist/shadcn/avatar.js +24 -47
- package/dist/shadcn/badge.d.ts +1 -1
- package/dist/shadcn/badge.js +21 -13
- package/dist/shadcn/button.d.ts +1 -1
- package/dist/shadcn/button.js +21 -13
- package/dist/shadcn/calendar.js +42 -97
- package/dist/shadcn/card.js +35 -25
- package/dist/shadcn/checkbox.js +19 -42
- package/dist/shadcn/command.js +53 -43
- package/dist/shadcn/date-input.js +25 -60
- package/dist/shadcn/date-range-picker.js +14 -18
- package/dist/shadcn/dialog.js +56 -79
- package/dist/shadcn/dropdown-menu.js +61 -84
- package/dist/shadcn/hover-card.js +24 -47
- package/dist/shadcn/input.js +17 -7
- package/dist/shadcn/label.js +18 -41
- package/dist/shadcn/navigation-menu.d.ts +1 -1
- package/dist/shadcn/navigation-menu.js +43 -68
- package/dist/shadcn/popover.js +27 -50
- package/dist/shadcn/progress.js +19 -42
- package/dist/shadcn/radio-group.js +23 -45
- package/dist/shadcn/scroll-area.js +22 -45
- package/dist/shadcn/select.js +58 -81
- package/dist/shadcn/separator.js +18 -41
- package/dist/shadcn/sheet.js +52 -73
- package/dist/shadcn/sidebar.d.ts +1 -1
- package/dist/shadcn/sidebar.js +113 -141
- package/dist/shadcn/skeleton.js +17 -7
- package/dist/shadcn/slider.js +19 -42
- package/dist/shadcn/sonner.js +20 -11
- package/dist/shadcn/switch.js +18 -41
- package/dist/shadcn/table.js +46 -36
- package/dist/shadcn/tabs.js +27 -50
- package/dist/shadcn/textarea.js +17 -7
- package/dist/shadcn/tooltip.js +27 -50
- package/dist/shadcn/workflow.js +8 -8
- package/dist/styles.css +3 -0
- package/dist/utils/cn.js +4 -7
- package/dist/utils/theme-provider/index.js +16 -7
- package/package.json +2 -1
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
function Tabs({ children, tabArray, pathName, tabListClass = "", tabListInnerClass = "", tabListButtonClass = "", tabContentClass = "", headerEndComponent, onTabChange, isSeperatePage = false, }) {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Tabs as TabsComp, TabsContent, TabsList, TabsTrigger, } from "../../shadcn/tabs";
|
|
4
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../../shadcn/dropdown-menu";
|
|
5
|
+
import { EllipsisVertical } from "lucide-react";
|
|
6
|
+
import { TextButton } from "../buttons";
|
|
7
|
+
import { Card } from "../../shadcn/card";
|
|
8
|
+
import { useEffect, useState } from "react";
|
|
9
|
+
import { useIsMobile } from "../../hooks/use-mobile";
|
|
10
|
+
export function Tabs({ children, tabArray, pathName, tabListClass = "", tabListInnerClass = "", tabListButtonClass = "", tabContentClass = "", headerEndComponent, onTabChange, isSeperatePage = false, }) {
|
|
11
|
+
var _a, _b;
|
|
14
12
|
// const pathName = usePathname();
|
|
15
|
-
const [itemToDisplay, setItemToDisplay] =
|
|
16
|
-
const isMobile =
|
|
17
|
-
const [visibleTabs, setVisibleTabs] =
|
|
18
|
-
const [groupedTabs, setGroupedTabs] =
|
|
19
|
-
const [activeTab, setActiveTab] = (
|
|
20
|
-
|
|
13
|
+
const [itemToDisplay, setItemToDisplay] = useState(5);
|
|
14
|
+
const isMobile = useIsMobile();
|
|
15
|
+
const [visibleTabs, setVisibleTabs] = useState([]);
|
|
16
|
+
const [groupedTabs, setGroupedTabs] = useState([]);
|
|
17
|
+
const [activeTab, setActiveTab] = useState(((_a = tabArray.find((tab) => tab.default)) === null || _a === void 0 ? void 0 : _a.tabId) || ((_b = tabArray[0]) === null || _b === void 0 ? void 0 : _b.tabId) || "");
|
|
18
|
+
useEffect(() => {
|
|
21
19
|
setItemToDisplay(isMobile ? 2 : 5);
|
|
22
20
|
}, [isMobile]);
|
|
23
|
-
|
|
21
|
+
useEffect(() => {
|
|
24
22
|
if (pathName && isSeperatePage) {
|
|
25
23
|
const lastPath = pathName.split("/").pop() || "";
|
|
26
24
|
setActiveTab(lastPath);
|
|
27
25
|
}
|
|
28
26
|
}, [pathName, isSeperatePage]);
|
|
29
|
-
|
|
27
|
+
useEffect(() => {
|
|
30
28
|
setVisibleTabs(tabArray.slice(0, itemToDisplay));
|
|
31
29
|
setGroupedTabs(tabArray.slice(itemToDisplay));
|
|
32
30
|
}, [tabArray, itemToDisplay]);
|
|
33
31
|
const handleTabChange = (tabId) => {
|
|
34
32
|
setActiveTab(tabId);
|
|
35
|
-
onTabChange
|
|
33
|
+
onTabChange === null || onTabChange === void 0 ? void 0 : onTabChange(tabId);
|
|
36
34
|
};
|
|
37
35
|
const handleGroupedTabSelect = (tab) => {
|
|
38
36
|
setVisibleTabs((prev) => {
|
|
@@ -48,5 +46,5 @@ function Tabs({ children, tabArray, pathName, tabListClass = "", tabListInnerCla
|
|
|
48
46
|
});
|
|
49
47
|
handleTabChange(tab.tabId);
|
|
50
48
|
};
|
|
51
|
-
return ((
|
|
49
|
+
return (_jsxs(TabsComp, { value: activeTab, onValueChange: handleTabChange, className: "w-full h-full flex flex-col", children: [_jsxs(TabsList, { className: `flex justify-between items-center ${tabListClass}`, children: [_jsxs("div", { className: `flex w-full ${tabListInnerClass}`, children: [visibleTabs.map((tab) => (_jsx(TabsTrigger, { value: tab.tabId, className: tabListButtonClass, children: tab.tabName }, tab.tabId))), groupedTabs.length > 0 && (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(TextButton, { variant: "outline", size: 'smIcon', className: "mt-1", children: _jsx(EllipsisVertical, {}) }) }), _jsx(DropdownMenuContent, { children: groupedTabs.map((tab) => (_jsx(DropdownMenuItem, { onClick: () => handleGroupedTabSelect(tab), children: tab.tabName }, tab.tabId))) })] }))] }), headerEndComponent && _jsx("div", { children: headerEndComponent })] }), children ? (_jsx(TabsContent, { value: activeTab, className: `mt-3 flex-grow overflow-auto h-full w-full ${tabContentClass}`, children: _jsx(Card, { className: "h-full w-full p-3", children: children }) })) : (tabArray.map((tab) => (_jsx(TabsContent, { value: tab.tabId, className: `mt-3 flex-grow overflow-auto h-full w-full ${tabContentClass}`, children: _jsx(Card, { className: "h-full w-full p-3", children: tab === null || tab === void 0 ? void 0 : tab.tabContent }) }, tab.tabId))))] }));
|
|
52
50
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
const { theme, setTheme } = (0, next_themes_1.useTheme)();
|
|
12
|
-
return ((0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenu, { children: [(0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuTrigger, { asChild: true, children: (0, jsx_runtime_1.jsxs)(button_1.Button, { variant: "outline", size: "icon", children: [theme === "light" && ((0, jsx_runtime_1.jsx)(lucide_react_1.Sun, { className: "h-[1.2rem] w-[1.2rem] transition-all" })), theme === "dark" && ((0, jsx_runtime_1.jsx)(lucide_react_1.Moon, { className: "h-[1.2rem] w-[1.2rem] transition-all" })), theme === "keross" && ((0, jsx_runtime_1.jsx)(lucide_react_1.Waves, { className: "h-[1.2rem] w-[1.2rem] transition-all" })), (0, jsx_runtime_1.jsx)("span", { className: "sr-only", children: "Toggle theme" })] }) }), (0, jsx_runtime_1.jsxs)(dropdown_menu_1.DropdownMenuContent, { align: "end", children: [(0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuItem, { onClick: () => setTheme("light"), children: "Light" }), (0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuItem, { onClick: () => setTheme("dark"), children: "Dark" }), (0, jsx_runtime_1.jsx)(dropdown_menu_1.DropdownMenuItem, { onClick: () => setTheme("keross"), children: "Keross" })] })] }));
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Waves, Moon, Sun } from "lucide-react";
|
|
4
|
+
import { useTheme } from "next-themes";
|
|
5
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger, } from "../../shadcn/dropdown-menu";
|
|
6
|
+
import { Button } from "../../shadcn/button";
|
|
7
|
+
export function ThemeToggleBtn() {
|
|
8
|
+
const { theme, setTheme } = useTheme();
|
|
9
|
+
return (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", size: "icon", children: [theme === "light" && (_jsx(Sun, { className: "h-[1.2rem] w-[1.2rem] transition-all" })), theme === "dark" && (_jsx(Moon, { className: "h-[1.2rem] w-[1.2rem] transition-all" })), theme === "keross" && (_jsx(Waves, { className: "h-[1.2rem] w-[1.2rem] transition-all" })), _jsx("span", { className: "sr-only", children: "Toggle theme" })] }) }), _jsxs(DropdownMenuContent, { align: "end", children: [_jsx(DropdownMenuItem, { onClick: () => setTheme("light"), children: "Light" }), _jsx(DropdownMenuItem, { onClick: () => setTheme("dark"), children: "Dark" }), _jsx(DropdownMenuItem, { onClick: () => setTheme("keross"), children: "Keross" })] })] }));
|
|
13
10
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const progress_1 = require("../../shadcn/progress");
|
|
6
|
-
function TitleProgress({ title, value, valueText, isPercent = true, className, titleClassName, valueClassName, progressClassName }) {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Progress } from "../../shadcn/progress";
|
|
3
|
+
export function TitleProgress({ title, value, valueText, isPercent = true, className, titleClassName, valueClassName, progressClassName }) {
|
|
7
4
|
let finalValue = value.toFixed(2);
|
|
8
5
|
const parts = finalValue.split('.');
|
|
9
6
|
if (parts[1] === '00') {
|
|
10
7
|
finalValue = parts[0];
|
|
11
8
|
}
|
|
12
|
-
return ((
|
|
9
|
+
return (_jsxs("div", { className: 'w-full ' + (className !== null && className !== void 0 ? className : ''), children: [_jsxs("div", { className: 'flex items-center justify-between gap-4', children: [_jsx("div", { className: 'text-muted-foreground text-sm ' + (titleClassName !== null && titleClassName !== void 0 ? titleClassName : ''), children: title }), _jsx("div", { className: 'text-sm ' + (valueClassName !== null && valueClassName !== void 0 ? valueClassName : ''), children: valueText !== null && valueText !== void 0 ? valueText : `${finalValue}${isPercent ? '%' : ''}` })] }), _jsx(Progress, { value: value, className: 'w-full mt-2 ' + (progressClassName !== null && progressClassName !== void 0 ? progressClassName : '') })] }));
|
|
13
10
|
}
|
|
@@ -1,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const tooltip_1 = require("../../shadcn/tooltip");
|
|
6
|
-
function TooltipComponent({ tooltipContent, children }) {
|
|
7
|
-
return ((0, jsx_runtime_1.jsx)(tooltip_1.TooltipProvider, { children: (0, jsx_runtime_1.jsxs)(tooltip_1.Tooltip, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.TooltipTrigger, { asChild: true, children: children }), (0, jsx_runtime_1.jsx)(tooltip_1.TooltipContent, { children: tooltipContent })] }) }));
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Tooltip as TooltipComp, TooltipContent, TooltipProvider, TooltipTrigger } from "../../shadcn/tooltip";
|
|
3
|
+
export function TooltipComponent({ tooltipContent, children }) {
|
|
4
|
+
return (_jsx(TooltipProvider, { children: _jsxs(TooltipComp, { children: [_jsx(TooltipTrigger, { asChild: true, children: children }), _jsx(TooltipContent, { children: tooltipContent })] }) }));
|
|
8
5
|
}
|
|
@@ -1,48 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
if (k2 === undefined) k2 = k;
|
|
12
|
-
o[k2] = m[k];
|
|
13
|
-
}));
|
|
14
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
-
}) : function(o, v) {
|
|
17
|
-
o["default"] = v;
|
|
18
|
-
});
|
|
19
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
-
var ownKeys = function(o) {
|
|
21
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
-
var ar = [];
|
|
23
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
-
return ar;
|
|
25
|
-
};
|
|
26
|
-
return ownKeys(o);
|
|
27
|
-
};
|
|
28
|
-
return function (mod) {
|
|
29
|
-
if (mod && mod.__esModule) return mod;
|
|
30
|
-
var result = {};
|
|
31
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
-
__setModuleDefault(result, mod);
|
|
33
|
-
return result;
|
|
34
|
-
};
|
|
35
|
-
})();
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
exports.FrameworkItemDropdown = FrameworkItemDropdown;
|
|
38
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
39
|
-
const React = __importStar(require("react"));
|
|
40
|
-
const lucide_react_1 = require("lucide-react");
|
|
41
|
-
const cn_1 = require("../../utils/cn");
|
|
42
|
-
const button_1 = require("../../shadcn/button");
|
|
43
|
-
const command_1 = require("../../shadcn/command");
|
|
44
|
-
const popover_1 = require("../../shadcn/popover");
|
|
45
|
-
function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "Select items...", searchPlaceholder = "Search...", className, }) {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { ChevronsUpDown } from "lucide-react";
|
|
5
|
+
import { cn } from "../../utils/cn";
|
|
6
|
+
import { Button } from "../../shadcn/button";
|
|
7
|
+
import { Command, CommandEmpty, CommandInput, CommandItem, CommandList, } from "../../shadcn/command";
|
|
8
|
+
import { Popover, PopoverContent, PopoverTrigger } from "../../shadcn/popover";
|
|
9
|
+
export function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "Select items...", searchPlaceholder = "Search...", className, }) {
|
|
46
10
|
const [open, setOpen] = React.useState(false);
|
|
47
11
|
const [searchQuery, setSearchQuery] = React.useState("");
|
|
48
12
|
const { flatTree, itemMap } = processedData;
|
|
@@ -73,15 +37,16 @@ function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "
|
|
|
73
37
|
return state;
|
|
74
38
|
}, [value, flatTree, itemMap]);
|
|
75
39
|
const handleSelect = (item) => {
|
|
40
|
+
var _a, _b, _c;
|
|
76
41
|
const newSelectedIds = new Set(value);
|
|
77
42
|
const currentState = selectionState.get(item.id);
|
|
78
43
|
const shouldBeChecked = !(currentState === "checked" || currentState === "indeterminate");
|
|
79
44
|
const descendants = new Set();
|
|
80
|
-
const queue = [...(itemMap[item.id]
|
|
45
|
+
const queue = [...(((_a = itemMap[item.id]) === null || _a === void 0 ? void 0 : _a.childrenIds) || [])];
|
|
81
46
|
while (queue.length > 0) {
|
|
82
47
|
const currentId = queue.shift();
|
|
83
48
|
descendants.add(currentId);
|
|
84
|
-
const children = itemMap[currentId]
|
|
49
|
+
const children = ((_b = itemMap[currentId]) === null || _b === void 0 ? void 0 : _b.childrenIds) || [];
|
|
85
50
|
children.forEach((childId) => queue.push(childId));
|
|
86
51
|
}
|
|
87
52
|
if (shouldBeChecked) {
|
|
@@ -92,7 +57,7 @@ function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "
|
|
|
92
57
|
newSelectedIds.delete(item.id);
|
|
93
58
|
descendants.forEach((id) => newSelectedIds.delete(id));
|
|
94
59
|
}
|
|
95
|
-
let parentId = itemMap[item.id]
|
|
60
|
+
let parentId = (_c = itemMap[item.id]) === null || _c === void 0 ? void 0 : _c.parentId;
|
|
96
61
|
while (parentId) {
|
|
97
62
|
const parentInfo = itemMap[parentId];
|
|
98
63
|
if (parentInfo && parentInfo.childrenIds.length > 0) {
|
|
@@ -104,7 +69,7 @@ function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "
|
|
|
104
69
|
newSelectedIds.delete(parentId);
|
|
105
70
|
}
|
|
106
71
|
}
|
|
107
|
-
parentId = parentInfo
|
|
72
|
+
parentId = parentInfo === null || parentInfo === void 0 ? void 0 : parentInfo.parentId;
|
|
108
73
|
}
|
|
109
74
|
onChange(Array.from(newSelectedIds));
|
|
110
75
|
};
|
|
@@ -125,9 +90,10 @@ function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "
|
|
|
125
90
|
// Step 2: collect ancestors and descendants
|
|
126
91
|
const expandedIds = new Set(matchedIds);
|
|
127
92
|
const addAncestors = (id) => {
|
|
93
|
+
var _a;
|
|
128
94
|
let current = id;
|
|
129
95
|
while (current) {
|
|
130
|
-
const parentId = itemMap[current]
|
|
96
|
+
const parentId = (_a = itemMap[current]) === null || _a === void 0 ? void 0 : _a.parentId;
|
|
131
97
|
if (parentId && !expandedIds.has(parentId)) {
|
|
132
98
|
expandedIds.add(parentId);
|
|
133
99
|
current = parentId;
|
|
@@ -138,7 +104,8 @@ function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "
|
|
|
138
104
|
}
|
|
139
105
|
};
|
|
140
106
|
const addDescendants = (id) => {
|
|
141
|
-
|
|
107
|
+
var _a;
|
|
108
|
+
const children = ((_a = itemMap[id]) === null || _a === void 0 ? void 0 : _a.childrenIds) || [];
|
|
142
109
|
for (const childId of children) {
|
|
143
110
|
if (!expandedIds.has(childId)) {
|
|
144
111
|
expandedIds.add(childId);
|
|
@@ -159,7 +126,7 @@ function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "
|
|
|
159
126
|
return !nodeInfo || nodeInfo.childrenIds.length === 0;
|
|
160
127
|
});
|
|
161
128
|
if (leafNodeIds.length === 0) {
|
|
162
|
-
return (
|
|
129
|
+
return _jsx("span", { className: "text-muted-foreground", children: placeholder });
|
|
163
130
|
}
|
|
164
131
|
if (leafNodeIds.length === 1) {
|
|
165
132
|
const item = flatTree.find((i) => i.id === leafNodeIds[0]);
|
|
@@ -167,10 +134,10 @@ function FrameworkItemDropdown({ processedData, value, onChange, placeholder = "
|
|
|
167
134
|
}
|
|
168
135
|
return `${leafNodeIds.length} items selected`;
|
|
169
136
|
};
|
|
170
|
-
return ((
|
|
137
|
+
return (_jsxs(Popover, { open: open, onOpenChange: setOpen, children: [_jsx(PopoverTrigger, { asChild: true, children: _jsxs(Button, { variant: "outline", role: "combobox", "aria-expanded": open, className: cn("w-full justify-between transition-all duration-150 ease-in-out border hover:border-primary hover:shadow-sm bg-secondary cursor-pointer", className), children: [_jsx("span", { className: "truncate", children: getSelectedLabel() }), _jsx(ChevronsUpDown, { className: cn("ml-2 h-4 w-4 shrink-0 transition-transform duration-200", open && "rotate-180") })] }) }), _jsx(PopoverContent, { className: "w-[--radix-popover-trigger-width] p-0 max-h-[400px] overflow-y-auto", children: _jsxs(Command, { children: [_jsx(CommandInput, { placeholder: searchPlaceholder, value: searchQuery, onValueChange: setSearchQuery }), _jsxs(CommandList, { className: "transition-all duration-200 ease-in-out", children: [_jsx(CommandEmpty, { children: "No results found." }), filteredItems.map((item) => (_jsxs(CommandItem, { value: `${item.index} ${item.title} ${item.description}`, onSelect: () => handleSelect(item), className: "flex items-start cursor-pointer gap-2", style: { paddingLeft: `${item.level * 1.5 + 0.75}rem` }, children: [_jsx("input", { type: "checkbox", className: "mt-1 h-4 w-4 accent-primary border rounded", checked: selectionState.get(item.id) === "checked", ref: (el) => {
|
|
171
138
|
if (el) {
|
|
172
139
|
el.indeterminate =
|
|
173
140
|
selectionState.get(item.id) === "indeterminate";
|
|
174
141
|
}
|
|
175
|
-
}, readOnly: true }), (
|
|
142
|
+
}, readOnly: true }), _jsxs("div", { className: "flex flex-col", children: [_jsxs("div", { className: "flex items-center space-x-2", children: [_jsx("span", { className: "text-xs font-mono text-muted-foreground bg-muted px-1.5 py-0.5 rounded", children: item.index }), _jsx("span", { className: "font-medium", children: item.title })] }), _jsx("p", { className: "text-sm text-muted-foreground", children: item.description })] })] }, item.id)))] })] }) })] }));
|
|
176
143
|
}
|
|
@@ -1,17 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
'use client';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const button_1 = require("../../shadcn/button");
|
|
9
|
-
function Widgets({ widgetData }) {
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Icon } from "../icon";
|
|
4
|
+
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../shadcn/tooltip";
|
|
5
|
+
import { Button } from "../../shadcn/button";
|
|
6
|
+
export function Widgets({ widgetData }) {
|
|
10
7
|
const firstRowWidgets = widgetData.slice(0, 4);
|
|
11
8
|
const secondRowWidgets = widgetData.slice(4);
|
|
12
|
-
return ((
|
|
13
|
-
(
|
|
14
|
-
(
|
|
15
|
-
(
|
|
16
|
-
(
|
|
9
|
+
return (_jsxs("div", { className: "flex flex-col gap-2", children: [_jsx("div", { className: "flex flex-col md:flex-row gap-2", children: firstRowWidgets.map((widget) => (_jsxs("div", { className: "flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary", children: [_jsxs("div", { className: "flex flex-col", children: [_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { className: "cursor-default select-text", children: _jsx("p", { className: "font-medium max-w-[240px] truncate", children: widget.widgetText }) }), _jsx(TooltipContent, { children: _jsx("p", { children: widget.widgetText }) })] }) }), _jsx("div", { children: widget.onButtonClickfunc ?
|
|
10
|
+
_jsx(Button, { className: "px-0", variant: "link", onClick: () => { var _a; return (_a = widget.onButtonClickfunc) === null || _a === void 0 ? void 0 : _a.call(widget, { id: widget.id }); }, children: widget.widgetNumber }) :
|
|
11
|
+
_jsx("p", { className: "inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md", children: widget.widgetNumber }) })] }), _jsx("div", { className: "flex justify-end items-center", children: widget.iconName && _jsx(Icon, { name: widget.iconName }) })] }, widget.id))) }), secondRowWidgets.length > 0 && (_jsx("div", { className: "flex flex-col md:flex-row gap-2", children: secondRowWidgets.map((widget) => (_jsxs("div", { className: "flex flex-1 flex-row justify-between border rounded-md p-2 border-l-4 border-l-primary", children: [_jsxs("div", { className: "flex flex-col", children: [_jsx(TooltipProvider, { children: _jsxs(Tooltip, { children: [_jsx(TooltipTrigger, { className: "cursor-default select-text", children: _jsx("p", { className: "font-medium max-w-[240px] truncate", children: widget.widgetText }) }), _jsx(TooltipContent, { children: _jsx("p", { children: widget.widgetText }) })] }) }), _jsx("div", { children: widget.onButtonClickfunc ?
|
|
12
|
+
_jsx(Button, { className: "px-0", variant: "link", onClick: () => { var _a; return (_a = widget.onButtonClickfunc) === null || _a === void 0 ? void 0 : _a.call(widget, { id: widget.id }); }, children: widget.widgetNumber }) :
|
|
13
|
+
_jsx("p", { className: "inline-flex items-center justify-center px-0 py-2 text-sm font-medium border border-transparent rounded-md", children: widget.widgetNumber }) })] }), _jsx("div", { className: "flex justify-end items-center", children: widget.iconName && _jsx(Icon, { name: widget.iconName }) })] }, widget.id))) }))] }));
|
|
17
14
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -73,6 +73,6 @@ export { FrameworkItemDropdown } from "./ikoncomponents/twolevel-dropdown";
|
|
|
73
73
|
export type { FrameworkEntry, TreeNode, ParentEntry, ProcessedFrameworkData } from "./ikoncomponents/twolevel-dropdown";
|
|
74
74
|
export { Widgets } from "./ikoncomponents/widgets";
|
|
75
75
|
export type { WidgetProps, WidgetsFunctionProps } from "./ikoncomponents/widgets/type";
|
|
76
|
-
export
|
|
77
|
-
export
|
|
78
|
-
export
|
|
76
|
+
export { ThemeProvider } from "./utils/theme-provider";
|
|
77
|
+
export { cn } from "./utils/cn";
|
|
78
|
+
export { useIsMobile } from "./hooks/use-mobile";
|
package/dist/index.js
CHANGED
|
@@ -1,123 +1,70 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
var datatable_filter_menu_1 = require("./ikoncomponents/data-table/datatable-filter-menu");
|
|
72
|
-
Object.defineProperty(exports, "DataTableFilterMenu", { enumerable: true, get: function () { return datatable_filter_menu_1.DataTableFilterMenu; } });
|
|
73
|
-
var datatable_pagination_1 = require("./ikoncomponents/data-table/datatable-pagination");
|
|
74
|
-
Object.defineProperty(exports, "DataTablePagination", { enumerable: true, get: function () { return datatable_pagination_1.DataTablePagination; } });
|
|
75
|
-
var datatable_toolbar_1 = require("./ikoncomponents/data-table/datatable-toolbar");
|
|
76
|
-
Object.defineProperty(exports, "DataTableToolbar", { enumerable: true, get: function () { return datatable_toolbar_1.DataTableToolbar; } });
|
|
77
|
-
var function_1 = require("./ikoncomponents/data-table/function");
|
|
78
|
-
Object.defineProperty(exports, "getDataTableColumnTitle", { enumerable: true, get: function () { return function_1.getDataTableColumnTitle; } });
|
|
79
|
-
var data_table_1 = require("./ikoncomponents/data-table");
|
|
80
|
-
Object.defineProperty(exports, "DataTable", { enumerable: true, get: function () { return data_table_1.DataTable; } });
|
|
81
|
-
var e_chart_1 = require("./ikoncomponents/e-chart");
|
|
82
|
-
Object.defineProperty(exports, "EChart", { enumerable: true, get: function () { return e_chart_1.EChart; } });
|
|
83
|
-
var file_input_1 = require("./ikoncomponents/file-input");
|
|
84
|
-
Object.defineProperty(exports, "FileInput", { enumerable: true, get: function () { return file_input_1.FileInput; } });
|
|
85
|
-
var glowing_effect_1 = require("./ikoncomponents/glowing-effect");
|
|
86
|
-
Object.defineProperty(exports, "GlowingEffect", { enumerable: true, get: function () { return glowing_effect_1.GlowingEffect; } });
|
|
87
|
-
var icon_1 = require("./ikoncomponents/icon");
|
|
88
|
-
Object.defineProperty(exports, "Icon", { enumerable: true, get: function () { return icon_1.Icon; } });
|
|
89
|
-
var loading_spinner_1 = require("./ikoncomponents/loading-spinner");
|
|
90
|
-
Object.defineProperty(exports, "LoadingSpinner", { enumerable: true, get: function () { return loading_spinner_1.LoadingSpinner; } });
|
|
91
|
-
var multi_combobox_1 = require("./ikoncomponents/multi-combobox");
|
|
92
|
-
Object.defineProperty(exports, "MultiCombobox", { enumerable: true, get: function () { return multi_combobox_1.MultiCombobox; } });
|
|
93
|
-
var no_data_1 = require("./ikoncomponents/no-data");
|
|
94
|
-
Object.defineProperty(exports, "NoDataComponent", { enumerable: true, get: function () { return no_data_1.NoDataComponent; } });
|
|
95
|
-
var page_wrapper_1 = require("./ikoncomponents/page-wrapper");
|
|
96
|
-
Object.defineProperty(exports, "PageWrapper", { enumerable: true, get: function () { return page_wrapper_1.PageWrapper; } });
|
|
97
|
-
var password_strength_meter_1 = require("./ikoncomponents/password-strength-meter");
|
|
98
|
-
Object.defineProperty(exports, "PasswordStrengthMeter", { enumerable: true, get: function () { return password_strength_meter_1.PasswordStrengthMeter; } });
|
|
99
|
-
var phone_input_1 = require("./ikoncomponents/phone-input");
|
|
100
|
-
Object.defineProperty(exports, "PhoneInput", { enumerable: true, get: function () { return phone_input_1.PhoneInput; } });
|
|
101
|
-
var resource_spreadsheet_1 = require("./ikoncomponents/resource-spreadsheet");
|
|
102
|
-
Object.defineProperty(exports, "ResourceTable", { enumerable: true, get: function () { return resource_spreadsheet_1.ResourceTable; } });
|
|
103
|
-
var search_input_1 = require("./ikoncomponents/search-input");
|
|
104
|
-
Object.defineProperty(exports, "SearchInput", { enumerable: true, get: function () { return search_input_1.SearchInput; } });
|
|
105
|
-
var sheet_1 = require("./ikoncomponents/sheet");
|
|
106
|
-
Object.defineProperty(exports, "SheetComponent", { enumerable: true, get: function () { return sheet_1.SheetComponent; } });
|
|
107
|
-
var simple_widget_1 = require("./ikoncomponents/simple-widget");
|
|
108
|
-
Object.defineProperty(exports, "SimpleWidget", { enumerable: true, get: function () { return simple_widget_1.SimpleWidget; } });
|
|
109
|
-
var tabs_1 = require("./ikoncomponents/tabs");
|
|
110
|
-
Object.defineProperty(exports, "Tabs", { enumerable: true, get: function () { return tabs_1.Tabs; } });
|
|
111
|
-
var theme_toggle_btn_1 = require("./ikoncomponents/theme-toggle-btn");
|
|
112
|
-
Object.defineProperty(exports, "ThemeToggleBtn", { enumerable: true, get: function () { return theme_toggle_btn_1.ThemeToggleBtn; } });
|
|
113
|
-
var title_progress_1 = require("./ikoncomponents/title-progress");
|
|
114
|
-
Object.defineProperty(exports, "TitleProgress", { enumerable: true, get: function () { return title_progress_1.TitleProgress; } });
|
|
115
|
-
var tooltip_1 = require("./ikoncomponents/tooltip");
|
|
116
|
-
Object.defineProperty(exports, "TooltipComponent", { enumerable: true, get: function () { return tooltip_1.TooltipComponent; } });
|
|
117
|
-
var twolevel_dropdown_1 = require("./ikoncomponents/twolevel-dropdown");
|
|
118
|
-
Object.defineProperty(exports, "FrameworkItemDropdown", { enumerable: true, get: function () { return twolevel_dropdown_1.FrameworkItemDropdown; } });
|
|
119
|
-
var widgets_1 = require("./ikoncomponents/widgets");
|
|
120
|
-
Object.defineProperty(exports, "Widgets", { enumerable: true, get: function () { return widgets_1.Widgets; } });
|
|
121
|
-
__exportStar(require("./utils/theme-provider"), exports);
|
|
122
|
-
__exportStar(require("./utils/cn"), exports);
|
|
123
|
-
__exportStar(require("./hooks/use-mobile"), exports);
|
|
1
|
+
import "./styles.css"; // just imports, no processing
|
|
2
|
+
export * from "./shadcn/accordion";
|
|
3
|
+
export * from "./shadcn/alert-dialog";
|
|
4
|
+
export * from "./shadcn/alert";
|
|
5
|
+
export * from "./shadcn/avatar";
|
|
6
|
+
export * from "./shadcn/badge";
|
|
7
|
+
export * from "./shadcn/button";
|
|
8
|
+
export * from "./shadcn/calendar";
|
|
9
|
+
export * from "./shadcn/card";
|
|
10
|
+
export * from "./shadcn/checkbox";
|
|
11
|
+
export * from "./shadcn/command";
|
|
12
|
+
export * from "./shadcn/date-input";
|
|
13
|
+
export * from "./shadcn/date-range-picker";
|
|
14
|
+
export * from "./shadcn/dialog";
|
|
15
|
+
export * from "./shadcn/dropdown-menu";
|
|
16
|
+
export * from "./shadcn/hover-card";
|
|
17
|
+
export * from "./shadcn/input";
|
|
18
|
+
export * from "./shadcn/label";
|
|
19
|
+
export * from "./shadcn/navigation-menu";
|
|
20
|
+
export * from "./shadcn/popover";
|
|
21
|
+
export * from "./shadcn/progress";
|
|
22
|
+
export * from "./shadcn/radio-group";
|
|
23
|
+
export * from "./shadcn/scroll-area";
|
|
24
|
+
export * from "./shadcn/select";
|
|
25
|
+
export * from "./shadcn/separator";
|
|
26
|
+
export * from "./shadcn/sheet";
|
|
27
|
+
export * from "./shadcn/sidebar";
|
|
28
|
+
export * from "./shadcn/skeleton";
|
|
29
|
+
export * from "./shadcn/slider";
|
|
30
|
+
export * from "./shadcn/sonner";
|
|
31
|
+
export * from "./shadcn/switch";
|
|
32
|
+
export * from "./shadcn/table";
|
|
33
|
+
export * from "./shadcn/tabs";
|
|
34
|
+
export * from "./shadcn/textarea";
|
|
35
|
+
export * from "./shadcn/tooltip";
|
|
36
|
+
export * from "./shadcn/workflow";
|
|
37
|
+
export { ActionMenu } from "./ikoncomponents/action-menu";
|
|
38
|
+
export { CustomAlertDialog } from "./ikoncomponents/alert-dialog";
|
|
39
|
+
export { TextButton, TextButtonWithTooltip, IconTextButton, IconTextButtonWithTooltip, IconButton, IconButtonWithTooltip } from "./ikoncomponents/buttons";
|
|
40
|
+
export { ComboboxInput } from "./ikoncomponents/combobox-input";
|
|
41
|
+
export { DataTableColumnFilter } from "./ikoncomponents/data-table/datatable-column-filter";
|
|
42
|
+
export { DataTableFacetedFilter } from "./ikoncomponents/data-table/datatable-faceted-filter";
|
|
43
|
+
export { DataTableFilterMenu } from "./ikoncomponents/data-table/datatable-filter-menu";
|
|
44
|
+
export { DataTablePagination } from "./ikoncomponents/data-table/datatable-pagination";
|
|
45
|
+
export { DataTableToolbar } from "./ikoncomponents/data-table/datatable-toolbar";
|
|
46
|
+
export { getDataTableColumnTitle } from "./ikoncomponents/data-table/function";
|
|
47
|
+
export { DataTable } from "./ikoncomponents/data-table";
|
|
48
|
+
export { EChart } from "./ikoncomponents/e-chart";
|
|
49
|
+
export { FileInput } from "./ikoncomponents/file-input";
|
|
50
|
+
export { GlowingEffect } from "./ikoncomponents/glowing-effect";
|
|
51
|
+
export { Icon } from "./ikoncomponents/icon";
|
|
52
|
+
export { LoadingSpinner } from "./ikoncomponents/loading-spinner";
|
|
53
|
+
export { MultiCombobox } from "./ikoncomponents/multi-combobox";
|
|
54
|
+
export { NoDataComponent } from "./ikoncomponents/no-data";
|
|
55
|
+
export { PageWrapper } from "./ikoncomponents/page-wrapper";
|
|
56
|
+
export { PasswordStrengthMeter } from "./ikoncomponents/password-strength-meter";
|
|
57
|
+
export { PhoneInput } from "./ikoncomponents/phone-input";
|
|
58
|
+
export { ResourceTable } from "./ikoncomponents/resource-spreadsheet";
|
|
59
|
+
export { SearchInput } from "./ikoncomponents/search-input";
|
|
60
|
+
export { SheetComponent } from "./ikoncomponents/sheet";
|
|
61
|
+
export { SimpleWidget } from "./ikoncomponents/simple-widget";
|
|
62
|
+
export { Tabs } from "./ikoncomponents/tabs";
|
|
63
|
+
export { ThemeToggleBtn } from "./ikoncomponents/theme-toggle-btn";
|
|
64
|
+
export { TitleProgress } from "./ikoncomponents/title-progress";
|
|
65
|
+
export { TooltipComponent } from "./ikoncomponents/tooltip";
|
|
66
|
+
export { FrameworkItemDropdown } from "./ikoncomponents/twolevel-dropdown";
|
|
67
|
+
export { Widgets } from "./ikoncomponents/widgets";
|
|
68
|
+
export { ThemeProvider } from "./utils/theme-provider";
|
|
69
|
+
export { cn } from "./utils/cn";
|
|
70
|
+
export { useIsMobile } from "./hooks/use-mobile";
|