ikoncomponents 1.7.4 → 1.7.5
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.
|
@@ -9,7 +9,6 @@ import { useEffect, useState } from "react";
|
|
|
9
9
|
import { useIsMobile } from "../../hooks/use-mobile";
|
|
10
10
|
export function CustomTabs({ children, tabArray, pathName, tabListClass = "", tabListInnerClass = "", tabListButtonClass = "", tabContentClass = "", headerEndComponent, onTabChange, isSeperatePage = false, }) {
|
|
11
11
|
var _a, _b;
|
|
12
|
-
// const pathName = usePathname();
|
|
13
12
|
const [itemToDisplay, setItemToDisplay] = useState(5);
|
|
14
13
|
const isMobile = useIsMobile();
|
|
15
14
|
const [visibleTabs, setVisibleTabs] = useState([]);
|
|
@@ -46,5 +45,26 @@ export function CustomTabs({ children, tabArray, pathName, tabListClass = "", ta
|
|
|
46
45
|
});
|
|
47
46
|
handleTabChange(tab.tabId);
|
|
48
47
|
};
|
|
49
|
-
return (_jsxs(TabsComp, { value: activeTab, onValueChange: handleTabChange, className: "w-full h-full flex flex-col", children: [_jsxs(
|
|
48
|
+
return (_jsxs(TabsComp, { value: activeTab, onValueChange: handleTabChange, className: "w-full h-full flex flex-col", children: [_jsxs("div", { className: `flex items-center justify-between ${tabListClass}`, children: [_jsx(TabsList, { className: `
|
|
49
|
+
h-auto bg-transparent p-0 border-0
|
|
50
|
+
flex items-center
|
|
51
|
+
`, children: _jsxs("div", { className: `
|
|
52
|
+
flex items-center gap-0.5
|
|
53
|
+
border border-border rounded-lg p-1
|
|
54
|
+
${tabListInnerClass}
|
|
55
|
+
`, children: [visibleTabs.map((tab) => (_jsxs(TabsTrigger, { value: tab.tabId, className: `
|
|
56
|
+
flex items-center gap-1.5
|
|
57
|
+
px-3 py-1.5 h-auto
|
|
58
|
+
text-sm font-medium rounded-md
|
|
59
|
+
text-muted-foreground
|
|
60
|
+
border border-transparent
|
|
61
|
+
bg-transparent shadow-none
|
|
62
|
+
hover:text-foreground hover:bg-muted
|
|
63
|
+
data-[state=active]:bg-accent
|
|
64
|
+
data-[state=active]:text-foreground
|
|
65
|
+
data-[state=active]:border-border
|
|
66
|
+
data-[state=active]:shadow-none
|
|
67
|
+
transition-all duration-150
|
|
68
|
+
${tabListButtonClass}
|
|
69
|
+
`, children: [tab.icon && (_jsx("span", { className: "size-4 flex items-center justify-center shrink-0", children: tab.icon })), tab.tabName] }, tab.tabId))), groupedTabs.length > 0 && (_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(TextButton, { variant: "ghost", size: "smIcon", children: _jsx(EllipsisVertical, { className: "size-4" }) }) }), _jsx(DropdownMenuContent, { align: "end", children: groupedTabs.map((tab) => (_jsxs(DropdownMenuItem, { onClick: () => handleGroupedTabSelect(tab), className: "flex items-center gap-2", children: [tab.icon && (_jsx("span", { className: "size-4 flex items-center justify-center shrink-0", children: tab.icon })), 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))))] }));
|
|
50
70
|
}
|
package/dist/styles.css
CHANGED
|
@@ -927,6 +927,9 @@
|
|
|
927
927
|
.w-\[220px\] {
|
|
928
928
|
width: 220px;
|
|
929
929
|
}
|
|
930
|
+
.w-\[400px\] {
|
|
931
|
+
width: 400px;
|
|
932
|
+
}
|
|
930
933
|
.w-auto {
|
|
931
934
|
width: auto;
|
|
932
935
|
}
|
|
@@ -4201,11 +4204,32 @@
|
|
|
4201
4204
|
}
|
|
4202
4205
|
}
|
|
4203
4206
|
}
|
|
4207
|
+
.data-\[state\=active\]\:border-border {
|
|
4208
|
+
&[data-state="active"] {
|
|
4209
|
+
border-color: var(--border);
|
|
4210
|
+
}
|
|
4211
|
+
}
|
|
4212
|
+
.data-\[state\=active\]\:bg-accent {
|
|
4213
|
+
&[data-state="active"] {
|
|
4214
|
+
background-color: var(--accent);
|
|
4215
|
+
}
|
|
4216
|
+
}
|
|
4204
4217
|
.data-\[state\=active\]\:bg-background {
|
|
4205
4218
|
&[data-state="active"] {
|
|
4206
4219
|
background-color: var(--background);
|
|
4207
4220
|
}
|
|
4208
4221
|
}
|
|
4222
|
+
.data-\[state\=active\]\:text-foreground {
|
|
4223
|
+
&[data-state="active"] {
|
|
4224
|
+
color: var(--foreground);
|
|
4225
|
+
}
|
|
4226
|
+
}
|
|
4227
|
+
.data-\[state\=active\]\:shadow-none {
|
|
4228
|
+
&[data-state="active"] {
|
|
4229
|
+
--tw-shadow: 0 0 #0000;
|
|
4230
|
+
box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4209
4233
|
.data-\[state\=active\]\:shadow-sm {
|
|
4210
4234
|
&[data-state="active"] {
|
|
4211
4235
|
--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / 0.1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / 0.1));
|