@a2v2ai/uikit 0.0.27 → 0.0.28
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/Sidebar/Sidebar.d.ts +1 -0
- package/Sidebar/Sidebar.js +2 -2
- package/package.json +1 -1
package/Sidebar/Sidebar.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ declare const sidebarMenuItemVariants: (props?: ({
|
|
|
27
27
|
export interface SidebarMenuItemProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof sidebarMenuItemVariants> {
|
|
28
28
|
icon?: React.ReactNode;
|
|
29
29
|
label: string;
|
|
30
|
+
labelClassName?: string;
|
|
30
31
|
badge?: React.ReactNode;
|
|
31
32
|
hasChildren?: boolean;
|
|
32
33
|
expanded?: boolean;
|
package/Sidebar/Sidebar.js
CHANGED
|
@@ -109,7 +109,7 @@ const sidebarMenuItemVariants = (0, class_variance_authority_1.cva)("flex items-
|
|
|
109
109
|
},
|
|
110
110
|
});
|
|
111
111
|
exports.sidebarMenuItemVariants = sidebarMenuItemVariants;
|
|
112
|
-
const SidebarMenuItem = React.forwardRef(({ className, icon, label, badge, active, hasChildren, expanded, onExpandedChange, children, onClick, ...props }, ref) => {
|
|
112
|
+
const SidebarMenuItem = React.forwardRef(({ className, icon, label, labelClassName, badge, active, hasChildren, expanded, onExpandedChange, children, onClick, ...props }, ref) => {
|
|
113
113
|
const { collapsed } = useSidebar();
|
|
114
114
|
const [internalExpanded, setInternalExpanded] = React.useState(expanded ?? false);
|
|
115
115
|
const isExpanded = expanded !== undefined ? expanded : internalExpanded;
|
|
@@ -124,7 +124,7 @@ const SidebarMenuItem = React.forwardRef(({ className, icon, label, badge, activ
|
|
|
124
124
|
if (collapsed) {
|
|
125
125
|
return ((0, jsx_runtime_1.jsx)("div", { ref: ref, "data-slot": "sidebar-menu-item", className: (0, utils_1.cn)("flex items-center justify-center size-9 rounded-lg cursor-pointer transition-colors mx-auto", active ? "bg-grey-100 text-grey-900" : "text-grey-600 hover:bg-grey-50", className), onClick: onClick, ...props, children: icon && (0, jsx_runtime_1.jsx)("span", { className: "size-4", children: icon }) }));
|
|
126
126
|
}
|
|
127
|
-
return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "sidebar-menu-item-wrapper", children: [(0, jsx_runtime_1.jsxs)("div", { ref: ref, "data-slot": "sidebar-menu-item", className: (0, utils_1.cn)(sidebarMenuItemVariants({ active }), className), onClick: handleClick, ...props, children: [icon && (0, jsx_runtime_1.jsx)("span", { className: "size-4 shrink-0", children: icon }), (0, jsx_runtime_1.jsx)("span", { className: "flex-1 truncate", children: label }), badge && (0, jsx_runtime_1.jsx)("span", { className: "shrink-0", children: badge }), hasChildren && ((0, jsx_runtime_1.jsx)("span", { className: "size-4 shrink-0 text-grey-400", children: isExpanded ? (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "size-4" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "size-4" }) }))] }), hasChildren && isExpanded && children && ((0, jsx_runtime_1.jsx)("div", { className: "ml-6 mt-1 flex flex-col", children: children }))] }));
|
|
127
|
+
return ((0, jsx_runtime_1.jsxs)("div", { "data-slot": "sidebar-menu-item-wrapper", children: [(0, jsx_runtime_1.jsxs)("div", { ref: ref, "data-slot": "sidebar-menu-item", className: (0, utils_1.cn)(sidebarMenuItemVariants({ active }), className), onClick: handleClick, ...props, children: [icon && (0, jsx_runtime_1.jsx)("span", { className: "size-4 shrink-0", children: icon }), (0, jsx_runtime_1.jsx)("span", { className: (0, utils_1.cn)("flex-1 truncate", labelClassName), children: label }), badge && (0, jsx_runtime_1.jsx)("span", { className: "shrink-0", children: badge }), hasChildren && ((0, jsx_runtime_1.jsx)("span", { className: "size-4 shrink-0 text-grey-400", children: isExpanded ? (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronDown, { className: "size-4" }) : (0, jsx_runtime_1.jsx)(lucide_react_1.ChevronRight, { className: "size-4" }) }))] }), hasChildren && isExpanded && children && ((0, jsx_runtime_1.jsx)("div", { className: "ml-6 mt-1 flex flex-col", children: children }))] }));
|
|
128
128
|
});
|
|
129
129
|
exports.SidebarMenuItem = SidebarMenuItem;
|
|
130
130
|
SidebarMenuItem.displayName = "SidebarMenuItem";
|