organify-ui 0.2.9 → 0.2.11
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/index.d.ts +3 -1
- package/dist/index.js +19 -5
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -452,6 +452,8 @@ interface DockSidebarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
452
452
|
expanded?: boolean;
|
|
453
453
|
/** Callback when expanded state changes */
|
|
454
454
|
onExpandedChange?: (expanded: boolean) => void;
|
|
455
|
+
/** Whether hover should expand/collapse the sidebar */
|
|
456
|
+
hoverExpand?: boolean;
|
|
455
457
|
/** Render custom link element (for Next.js Link etc.) */
|
|
456
458
|
renderLink?: (props: {
|
|
457
459
|
href: string;
|
|
@@ -460,7 +462,7 @@ interface DockSidebarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
460
462
|
onClick?: () => void;
|
|
461
463
|
}) => React.ReactNode;
|
|
462
464
|
}
|
|
463
|
-
declare function DockSidebar({ items, bottomItems, header, expanded, onExpandedChange, renderLink, className, ...props }: DockSidebarProps): react_jsx_runtime.JSX.Element;
|
|
465
|
+
declare function DockSidebar({ items, bottomItems, header, expanded, onExpandedChange, hoverExpand, renderLink, className, ...props }: DockSidebarProps): react_jsx_runtime.JSX.Element;
|
|
464
466
|
declare namespace DockSidebar {
|
|
465
467
|
var displayName: string;
|
|
466
468
|
}
|
package/dist/index.js
CHANGED
|
@@ -759,8 +759,10 @@ function DockSidebar({
|
|
|
759
759
|
header,
|
|
760
760
|
expanded = false,
|
|
761
761
|
onExpandedChange,
|
|
762
|
+
hoverExpand = false,
|
|
762
763
|
renderLink,
|
|
763
764
|
className,
|
|
765
|
+
// Destructure hoverExpand out so it doesn't leak to DOM via ...props
|
|
764
766
|
...props
|
|
765
767
|
}) {
|
|
766
768
|
const handleToggle = () => onExpandedChange?.(!expanded);
|
|
@@ -771,8 +773,8 @@ function DockSidebar({
|
|
|
771
773
|
sidebarVariants({ state: expanded ? "expanded" : "collapsed" }),
|
|
772
774
|
className
|
|
773
775
|
),
|
|
774
|
-
onMouseEnter: () => onExpandedChange?.(true),
|
|
775
|
-
onMouseLeave: () => onExpandedChange?.(false),
|
|
776
|
+
onMouseEnter: () => hoverExpand && onExpandedChange?.(true),
|
|
777
|
+
onMouseLeave: () => hoverExpand && onExpandedChange?.(false),
|
|
776
778
|
...props,
|
|
777
779
|
children: [
|
|
778
780
|
/* @__PURE__ */ jsxs("div", { className: cn("flex items-center px-3 h-16 border-b border-glass-border", expanded ? "justify-between" : "justify-center"), children: [
|
|
@@ -785,10 +787,22 @@ function DockSidebar({
|
|
|
785
787
|
"aria-label": expanded ? "Collapse sidebar" : "Expand sidebar",
|
|
786
788
|
className: cn(
|
|
787
789
|
"flex h-7 w-7 items-center justify-center rounded-sm",
|
|
788
|
-
"text-org-text-muted transition-all hover:bg-glass-highlight hover:text-org-text"
|
|
789
|
-
!expanded && "hidden"
|
|
790
|
+
"text-org-text-muted transition-all hover:bg-glass-highlight hover:text-org-text"
|
|
790
791
|
),
|
|
791
|
-
children: /* @__PURE__ */ jsx(
|
|
792
|
+
children: /* @__PURE__ */ jsx(
|
|
793
|
+
"svg",
|
|
794
|
+
{
|
|
795
|
+
width: "16",
|
|
796
|
+
height: "16",
|
|
797
|
+
viewBox: "0 0 16 16",
|
|
798
|
+
fill: "none",
|
|
799
|
+
className: cn(
|
|
800
|
+
"transition-transform duration-[400ms]",
|
|
801
|
+
expanded ? "rotate-0" : "rotate-180"
|
|
802
|
+
),
|
|
803
|
+
children: /* @__PURE__ */ jsx("path", { d: "M10 12L6 8L10 4", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
804
|
+
}
|
|
805
|
+
)
|
|
792
806
|
}
|
|
793
807
|
)
|
|
794
808
|
] }),
|