@inf-monkeys-tech/monkeys-design 0.4.47 → 0.4.49

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.
@@ -204,6 +204,7 @@ interface NavigationLayoutProps {
204
204
  defaultMode?: NavigationMode;
205
205
  defaultSidebarCollapsed?: boolean;
206
206
  expandedSidebarWidth?: string;
207
+ expandSidebarLabel?: string;
207
208
  flush?: boolean;
208
209
  headbarActions?: ReactNode;
209
210
  headbarLayout?: HeadbarLayout;
@@ -214,12 +215,14 @@ interface NavigationLayoutProps {
214
215
  onNavigate?: (itemId: string) => void;
215
216
  onSidebarCollapsedChange?: (collapsed: boolean) => void;
216
217
  renderHeadbarExtra?: ReactNode;
218
+ collapseSidebarLabel?: string;
219
+ sidebarCollapsed?: boolean;
217
220
  sidebarAccountMenu?: ReactNode;
218
221
  sidebarFooter?: ReactNode;
219
222
  sidebarHeader?: ReactNode;
220
223
  switchToHeadbarLabel?: string;
221
224
  switchToSidebarLabel?: string;
222
225
  }
223
- declare function NavigationLayout({ activeItemId, activeRootId, allowModeSwitch, accountMenu, children, className, collapsedSidebarAccountMenu, collapsedSidebarWidth, defaultMode, defaultSidebarCollapsed, expandedSidebarWidth, flush, headbarActions, headbarLayout, logo, mode, navItems, onModeChange, onNavigate, onSidebarCollapsedChange, renderHeadbarExtra, sidebarAccountMenu, sidebarFooter, sidebarHeader, switchToHeadbarLabel, switchToSidebarLabel, }: NavigationLayoutProps): react_jsx_runtime.JSX.Element;
226
+ declare function NavigationLayout({ activeItemId, activeRootId, allowModeSwitch, accountMenu, children, className, collapsedSidebarAccountMenu, collapsedSidebarWidth, defaultMode, defaultSidebarCollapsed, expandedSidebarWidth, expandSidebarLabel, flush, headbarActions, headbarLayout, logo, mode, navItems, onModeChange, onNavigate, onSidebarCollapsedChange, renderHeadbarExtra, collapseSidebarLabel, sidebarCollapsed: controlledSidebarCollapsed, sidebarAccountMenu, sidebarFooter, sidebarHeader, switchToHeadbarLabel, switchToSidebarLabel, }: NavigationLayoutProps): react_jsx_runtime.JSX.Element;
224
227
 
225
228
  export { AppHeader, type AppHeaderLogo, type AppHeaderProps, type AppHeaderUser, AppLayout, type AppLayoutProps, AppSidebar, type AppSidebarProps, type HeadbarLayout, type HeadbarLayoutMode, type HeadbarMenuRadius, type HeadbarNavPosition, type HeaderTab, type LayoutNavItem, NavButton, type NavButtonProps, NavigationLayout, type NavigationLayoutProps, type NavigationMode, type SidebarAccount, type SidebarNavItem, UserAccountMenu, type UserAccountMenuClassNames, type UserAccountMenuItem, type UserAccountMenuProps, type UserAccountMenuRadius, type UserAccountMenuSelectorConfig, type UserAccountMenuSelectorOption, type UserAccountMenuSide, type UserAccountMenuTriggerVariant, type UserAccountMenuUser, cn };
@@ -204,6 +204,7 @@ interface NavigationLayoutProps {
204
204
  defaultMode?: NavigationMode;
205
205
  defaultSidebarCollapsed?: boolean;
206
206
  expandedSidebarWidth?: string;
207
+ expandSidebarLabel?: string;
207
208
  flush?: boolean;
208
209
  headbarActions?: ReactNode;
209
210
  headbarLayout?: HeadbarLayout;
@@ -214,12 +215,14 @@ interface NavigationLayoutProps {
214
215
  onNavigate?: (itemId: string) => void;
215
216
  onSidebarCollapsedChange?: (collapsed: boolean) => void;
216
217
  renderHeadbarExtra?: ReactNode;
218
+ collapseSidebarLabel?: string;
219
+ sidebarCollapsed?: boolean;
217
220
  sidebarAccountMenu?: ReactNode;
218
221
  sidebarFooter?: ReactNode;
219
222
  sidebarHeader?: ReactNode;
220
223
  switchToHeadbarLabel?: string;
221
224
  switchToSidebarLabel?: string;
222
225
  }
223
- declare function NavigationLayout({ activeItemId, activeRootId, allowModeSwitch, accountMenu, children, className, collapsedSidebarAccountMenu, collapsedSidebarWidth, defaultMode, defaultSidebarCollapsed, expandedSidebarWidth, flush, headbarActions, headbarLayout, logo, mode, navItems, onModeChange, onNavigate, onSidebarCollapsedChange, renderHeadbarExtra, sidebarAccountMenu, sidebarFooter, sidebarHeader, switchToHeadbarLabel, switchToSidebarLabel, }: NavigationLayoutProps): react_jsx_runtime.JSX.Element;
226
+ declare function NavigationLayout({ activeItemId, activeRootId, allowModeSwitch, accountMenu, children, className, collapsedSidebarAccountMenu, collapsedSidebarWidth, defaultMode, defaultSidebarCollapsed, expandedSidebarWidth, expandSidebarLabel, flush, headbarActions, headbarLayout, logo, mode, navItems, onModeChange, onNavigate, onSidebarCollapsedChange, renderHeadbarExtra, collapseSidebarLabel, sidebarCollapsed: controlledSidebarCollapsed, sidebarAccountMenu, sidebarFooter, sidebarHeader, switchToHeadbarLabel, switchToSidebarLabel, }: NavigationLayoutProps): react_jsx_runtime.JSX.Element;
224
227
 
225
228
  export { AppHeader, type AppHeaderLogo, type AppHeaderProps, type AppHeaderUser, AppLayout, type AppLayoutProps, AppSidebar, type AppSidebarProps, type HeadbarLayout, type HeadbarLayoutMode, type HeadbarMenuRadius, type HeadbarNavPosition, type HeaderTab, type LayoutNavItem, NavButton, type NavButtonProps, NavigationLayout, type NavigationLayoutProps, type NavigationMode, type SidebarAccount, type SidebarNavItem, UserAccountMenu, type UserAccountMenuClassNames, type UserAccountMenuItem, type UserAccountMenuProps, type UserAccountMenuRadius, type UserAccountMenuSelectorConfig, type UserAccountMenuSelectorOption, type UserAccountMenuSide, type UserAccountMenuTriggerVariant, type UserAccountMenuUser, cn };
@@ -4100,6 +4100,7 @@ function NavigationLayout({
4100
4100
  defaultMode = "headbar",
4101
4101
  defaultSidebarCollapsed = false,
4102
4102
  expandedSidebarWidth = NAVIGATION_LAYOUT_SIDEBAR_EXPANDED_WIDTH,
4103
+ expandSidebarLabel = "Expand sidebar",
4103
4104
  flush = false,
4104
4105
  headbarActions,
4105
4106
  headbarLayout,
@@ -4110,6 +4111,8 @@ function NavigationLayout({
4110
4111
  onNavigate,
4111
4112
  onSidebarCollapsedChange,
4112
4113
  renderHeadbarExtra,
4114
+ collapseSidebarLabel = "Collapse sidebar",
4115
+ sidebarCollapsed: controlledSidebarCollapsed,
4113
4116
  sidebarAccountMenu,
4114
4117
  sidebarFooter,
4115
4118
  sidebarHeader,
@@ -4117,10 +4120,12 @@ function NavigationLayout({
4117
4120
  switchToSidebarLabel = "Switch to sidebar"
4118
4121
  }) {
4119
4122
  const [uncontrolledMode, setUncontrolledMode] = react.useState(defaultMode);
4120
- const [sidebarCollapsed, setSidebarCollapsed] = react.useState(defaultSidebarCollapsed);
4123
+ const [uncontrolledSidebarCollapsed, setUncontrolledSidebarCollapsed] = react.useState(defaultSidebarCollapsed);
4121
4124
  const [revealRequest, setRevealRequest] = react.useState(null);
4122
4125
  const isModeControlled = mode !== void 0;
4126
+ const isSidebarCollapsedControlled = controlledSidebarCollapsed !== void 0;
4123
4127
  const navigationMode = isModeControlled ? mode : uncontrolledMode;
4128
+ const sidebarCollapsed = isSidebarCollapsedControlled ? controlledSidebarCollapsed : uncontrolledSidebarCollapsed;
4124
4129
  const isHeadbarMode = navigationMode === "headbar";
4125
4130
  const sidebarWidth = sidebarCollapsed ? collapsedSidebarWidth : expandedSidebarWidth;
4126
4131
  react.useEffect(() => {
@@ -4128,6 +4133,11 @@ function NavigationLayout({
4128
4133
  setUncontrolledMode(defaultMode);
4129
4134
  }
4130
4135
  }, [defaultMode, isModeControlled]);
4136
+ react.useEffect(() => {
4137
+ if (!isSidebarCollapsedControlled) {
4138
+ setUncontrolledSidebarCollapsed(defaultSidebarCollapsed);
4139
+ }
4140
+ }, [defaultSidebarCollapsed, isSidebarCollapsedControlled]);
4131
4141
  const setNavigationMode = (nextMode) => {
4132
4142
  if (!isModeControlled) {
4133
4143
  setUncontrolledMode(nextMode);
@@ -4135,7 +4145,9 @@ function NavigationLayout({
4135
4145
  onModeChange?.(nextMode);
4136
4146
  };
4137
4147
  const setCollapsed = (collapsed) => {
4138
- setSidebarCollapsed(collapsed);
4148
+ if (!isSidebarCollapsedControlled) {
4149
+ setUncontrolledSidebarCollapsed(collapsed);
4150
+ }
4139
4151
  onSidebarCollapsedChange?.(collapsed);
4140
4152
  };
4141
4153
  const navigationActions = [];
@@ -4152,7 +4164,7 @@ function NavigationLayout({
4152
4164
  }
4153
4165
  navigationActions.push({
4154
4166
  id: "toggle-sidebar",
4155
- label: sidebarCollapsed ? "Expand sidebar" : "Collapse sidebar",
4167
+ label: sidebarCollapsed ? expandSidebarLabel : collapseSidebarLabel,
4156
4168
  onClick: () => setCollapsed(!sidebarCollapsed),
4157
4169
  icon: /* @__PURE__ */ jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-[18px] w-[18px]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
4158
4170
  /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
@@ -4163,7 +4175,10 @@ function NavigationLayout({
4163
4175
  const sidebar = isHeadbarMode ? null : /* @__PURE__ */ jsxRuntime.jsx(
4164
4176
  "div",
4165
4177
  {
4166
- className: "relative h-full min-h-0 shrink-0 overflow-hidden transition-[width] duration-260",
4178
+ className: cn2(
4179
+ "relative h-full min-h-0 shrink-0 transition-[width] duration-260",
4180
+ sidebarCollapsed ? "z-20 overflow-visible" : "z-10 overflow-hidden"
4181
+ ),
4167
4182
  style: { width: sidebarWidth, transitionTimingFunction: NAVIGATION_LAYOUT_TRANSITION_TIMING },
4168
4183
  children: /* @__PURE__ */ jsxRuntime.jsx(
4169
4184
  Sidebar,