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

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.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import React, { forwardRef, useRef, useState, useEffect, useId, useMemo, createContext, useContext, useLayoutEffect, Children, isValidElement, useCallback, Fragment as Fragment$1 } from 'react';
2
2
  import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
3
3
  import * as ContextMenu from '@radix-ui/react-context-menu';
4
- import * as DropdownMenu3 from '@radix-ui/react-dropdown-menu';
4
+ import * as DropdownMenu5 from '@radix-ui/react-dropdown-menu';
5
5
  import { useSensors, useSensor, PointerSensor, DndContext, DragOverlay, useDroppable, useDraggable } from '@dnd-kit/core';
6
6
  import '@dnd-kit/sortable';
7
7
  import '@dnd-kit/utilities';
@@ -1251,7 +1251,7 @@ var require_lodash = __commonJS({
1251
1251
  if (typeof func != "function") {
1252
1252
  throw new TypeError2(FUNC_ERROR_TEXT);
1253
1253
  }
1254
- return setTimeout(function() {
1254
+ return setTimeout2(function() {
1255
1255
  func.apply(undefined2, args);
1256
1256
  }, wait);
1257
1257
  }
@@ -2051,7 +2051,7 @@ var require_lodash = __commonJS({
2051
2051
  end = end === undefined2 ? length : end;
2052
2052
  return !start && end >= length ? array : baseSlice(array, start, end);
2053
2053
  }
2054
- var clearTimeout = ctxClearTimeout || function(id) {
2054
+ var clearTimeout2 = ctxClearTimeout || function(id) {
2055
2055
  return root.clearTimeout(id);
2056
2056
  };
2057
2057
  function cloneBuffer(buffer, isDeep) {
@@ -3102,7 +3102,7 @@ var require_lodash = __commonJS({
3102
3102
  return object[key];
3103
3103
  }
3104
3104
  var setData = shortOut(baseSetData);
3105
- var setTimeout = ctxSetTimeout || function(func, wait) {
3105
+ var setTimeout2 = ctxSetTimeout || function(func, wait) {
3106
3106
  return root.setTimeout(func, wait);
3107
3107
  };
3108
3108
  var setToString = shortOut(baseSetToString);
@@ -3894,7 +3894,7 @@ var require_lodash = __commonJS({
3894
3894
  }
3895
3895
  function leadingEdge(time) {
3896
3896
  lastInvokeTime = time;
3897
- timerId = setTimeout(timerExpired, wait);
3897
+ timerId = setTimeout2(timerExpired, wait);
3898
3898
  return leading ? invokeFunc(time) : result2;
3899
3899
  }
3900
3900
  function remainingWait(time) {
@@ -3910,7 +3910,7 @@ var require_lodash = __commonJS({
3910
3910
  if (shouldInvoke(time)) {
3911
3911
  return trailingEdge(time);
3912
3912
  }
3913
- timerId = setTimeout(timerExpired, remainingWait(time));
3913
+ timerId = setTimeout2(timerExpired, remainingWait(time));
3914
3914
  }
3915
3915
  function trailingEdge(time) {
3916
3916
  timerId = undefined2;
@@ -3922,7 +3922,7 @@ var require_lodash = __commonJS({
3922
3922
  }
3923
3923
  function cancel() {
3924
3924
  if (timerId !== undefined2) {
3925
- clearTimeout(timerId);
3925
+ clearTimeout2(timerId);
3926
3926
  }
3927
3927
  lastInvokeTime = 0;
3928
3928
  lastArgs = lastCallTime = lastThis = timerId = undefined2;
@@ -3940,13 +3940,13 @@ var require_lodash = __commonJS({
3940
3940
  return leadingEdge(lastCallTime);
3941
3941
  }
3942
3942
  if (maxing) {
3943
- clearTimeout(timerId);
3944
- timerId = setTimeout(timerExpired, wait);
3943
+ clearTimeout2(timerId);
3944
+ timerId = setTimeout2(timerExpired, wait);
3945
3945
  return invokeFunc(lastCallTime);
3946
3946
  }
3947
3947
  }
3948
3948
  if (timerId === undefined2) {
3949
- timerId = setTimeout(timerExpired, wait);
3949
+ timerId = setTimeout2(timerExpired, wait);
3950
3950
  }
3951
3951
  return result2;
3952
3952
  }
@@ -14769,8 +14769,8 @@ function DataExplorerSelect({
14769
14769
  /* @__PURE__ */ jsx("span", { children: label }),
14770
14770
  /* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: selected?.label ?? placeholder })
14771
14771
  ] }) : selected?.label ?? label ?? placeholder;
14772
- return /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
14773
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
14772
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Root, { children: [
14773
+ /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
14774
14774
  "button",
14775
14775
  {
14776
14776
  type: "button",
@@ -14798,8 +14798,8 @@ function DataExplorerSelect({
14798
14798
  ]
14799
14799
  }
14800
14800
  ) }),
14801
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx(
14802
- DropdownMenu3.Content,
14801
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsx(
14802
+ DropdownMenu5.Content,
14803
14803
  {
14804
14804
  align,
14805
14805
  sideOffset,
@@ -14807,7 +14807,7 @@ function DataExplorerSelect({
14807
14807
  style: theme.styles.menuContent,
14808
14808
  onClick: (event) => event.stopPropagation(),
14809
14809
  children: /* @__PURE__ */ jsx(
14810
- DropdownMenu3.RadioGroup,
14810
+ DropdownMenu5.RadioGroup,
14811
14811
  {
14812
14812
  value,
14813
14813
  onValueChange: (nextValue) => {
@@ -14815,7 +14815,7 @@ function DataExplorerSelect({
14815
14815
  void onValueChange?.(nextValue);
14816
14816
  },
14817
14817
  children: options.map((option) => /* @__PURE__ */ jsxs(
14818
- DropdownMenu3.RadioItem,
14818
+ DropdownMenu5.RadioItem,
14819
14819
  {
14820
14820
  value: option.value,
14821
14821
  title: option.title,
@@ -14861,9 +14861,9 @@ function renderMenuItem(action, context, theme, className) {
14861
14861
  const disabled = (resolveDataExplorerValue(action.disabled, context) ?? false) || (resolveDataExplorerValue(action.loading, context) ?? false);
14862
14862
  const active = resolveDataExplorerValue(action.active, context) ?? false;
14863
14863
  return /* @__PURE__ */ jsxs("div", { children: [
14864
- action.separatorBefore ? /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator }) : null,
14864
+ action.separatorBefore ? /* @__PURE__ */ jsx(DropdownMenu5.Separator, { className: theme.slots.menuSeparator }) : null,
14865
14865
  /* @__PURE__ */ jsxs(
14866
- DropdownMenu3.Item,
14866
+ DropdownMenu5.Item,
14867
14867
  {
14868
14868
  title: action.title,
14869
14869
  disabled,
@@ -14884,7 +14884,7 @@ function renderMenuItem(action, context, theme, className) {
14884
14884
  ]
14885
14885
  }
14886
14886
  ),
14887
- action.separatorAfter ? /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator }) : null
14887
+ action.separatorAfter ? /* @__PURE__ */ jsx(DropdownMenu5.Separator, { className: theme.slots.menuSeparator }) : null
14888
14888
  ] }, action.id);
14889
14889
  }
14890
14890
  function renderMenuAction(action, context, theme, classNames, appearance) {
@@ -14893,8 +14893,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
14893
14893
  const visibleItems = (action.items ?? []).filter(
14894
14894
  (item) => resolveDataExplorerValue(item.visible, context) ?? true
14895
14895
  );
14896
- return /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
14897
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
14896
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Root, { children: [
14897
+ /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
14898
14898
  DataExplorerButton,
14899
14899
  {
14900
14900
  title: action.title,
@@ -14910,8 +14910,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
14910
14910
  className: classNames?.action
14911
14911
  }
14912
14912
  ) }),
14913
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsxs(
14914
- DropdownMenu3.Content,
14913
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsxs(
14914
+ DropdownMenu5.Content,
14915
14915
  {
14916
14916
  align: action.align ?? "end",
14917
14917
  sideOffset: action.sideOffset ?? 6,
@@ -14920,8 +14920,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
14920
14920
  onClick: (event) => event.stopPropagation(),
14921
14921
  children: [
14922
14922
  action.menuLabel ? /* @__PURE__ */ jsxs(Fragment, { children: [
14923
- /* @__PURE__ */ jsx(DropdownMenu3.Label, { className: theme.slots.menuLabel, children: action.menuLabel }),
14924
- /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator })
14923
+ /* @__PURE__ */ jsx(DropdownMenu5.Label, { className: theme.slots.menuLabel, children: action.menuLabel }),
14924
+ /* @__PURE__ */ jsx(DropdownMenu5.Separator, { className: theme.slots.menuSeparator })
14925
14925
  ] }) : null,
14926
14926
  visibleItems.map(
14927
14927
  (item) => renderMenuItem(item, context, theme, classNames?.menuItem)
@@ -15744,8 +15744,8 @@ function DataExplorerDisplayActionMenu({
15744
15744
  if (visibleActions.length === 0) {
15745
15745
  return null;
15746
15746
  }
15747
- return /* @__PURE__ */ jsx("span", { className: cn2("inline-flex", classNames?.root), children: /* @__PURE__ */ jsxs(DropdownMenu3.Root, { open, onOpenChange: setOpen, children: [
15748
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
15747
+ return /* @__PURE__ */ jsx("span", { className: cn2("inline-flex", classNames?.root), children: /* @__PURE__ */ jsxs(DropdownMenu5.Root, { open, onOpenChange: setOpen, children: [
15748
+ /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
15749
15749
  "button",
15750
15750
  {
15751
15751
  type: "button",
@@ -15762,8 +15762,8 @@ function DataExplorerDisplayActionMenu({
15762
15762
  ]
15763
15763
  }
15764
15764
  ) }),
15765
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsxs(
15766
- DropdownMenu3.Content,
15765
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsxs(
15766
+ DropdownMenu5.Content,
15767
15767
  {
15768
15768
  align,
15769
15769
  sideOffset,
@@ -15776,7 +15776,7 @@ function DataExplorerDisplayActionMenu({
15776
15776
  children: [
15777
15777
  label ? /* @__PURE__ */ jsxs(Fragment, { children: [
15778
15778
  /* @__PURE__ */ jsx(
15779
- DropdownMenu3.Label,
15779
+ DropdownMenu5.Label,
15780
15780
  {
15781
15781
  className: cn2(
15782
15782
  theme.slots.menuLabel,
@@ -15786,7 +15786,7 @@ function DataExplorerDisplayActionMenu({
15786
15786
  }
15787
15787
  ),
15788
15788
  /* @__PURE__ */ jsx(
15789
- DropdownMenu3.Separator,
15789
+ DropdownMenu5.Separator,
15790
15790
  {
15791
15791
  className: cn2(
15792
15792
  theme.slots.menuSeparator,
@@ -15800,7 +15800,7 @@ function DataExplorerDisplayActionMenu({
15800
15800
  if (action.render) {
15801
15801
  return /* @__PURE__ */ jsxs("div", { children: [
15802
15802
  action.separatorBefore ? /* @__PURE__ */ jsx(
15803
- DropdownMenu3.Separator,
15803
+ DropdownMenu5.Separator,
15804
15804
  {
15805
15805
  className: cn2(
15806
15806
  theme.slots.menuSeparator,
@@ -15810,7 +15810,7 @@ function DataExplorerDisplayActionMenu({
15810
15810
  ) : null,
15811
15811
  action.render(context),
15812
15812
  action.separatorAfter ? /* @__PURE__ */ jsx(
15813
- DropdownMenu3.Separator,
15813
+ DropdownMenu5.Separator,
15814
15814
  {
15815
15815
  className: cn2(
15816
15816
  theme.slots.menuSeparator,
@@ -15822,7 +15822,7 @@ function DataExplorerDisplayActionMenu({
15822
15822
  }
15823
15823
  return /* @__PURE__ */ jsxs("div", { children: [
15824
15824
  action.separatorBefore ? /* @__PURE__ */ jsx(
15825
- DropdownMenu3.Separator,
15825
+ DropdownMenu5.Separator,
15826
15826
  {
15827
15827
  className: cn2(
15828
15828
  "-mx-1 my-1 h-px bg-border",
@@ -15831,7 +15831,7 @@ function DataExplorerDisplayActionMenu({
15831
15831
  }
15832
15832
  ) : null,
15833
15833
  /* @__PURE__ */ jsxs(
15834
- DropdownMenu3.Item,
15834
+ DropdownMenu5.Item,
15835
15835
  {
15836
15836
  title: action.title,
15837
15837
  disabled,
@@ -15882,7 +15882,7 @@ function DataExplorerDisplayActionMenu({
15882
15882
  }
15883
15883
  ),
15884
15884
  action.separatorAfter ? /* @__PURE__ */ jsx(
15885
- DropdownMenu3.Separator,
15885
+ DropdownMenu5.Separator,
15886
15886
  {
15887
15887
  className: cn2(
15888
15888
  theme.slots.menuSeparator,
@@ -17956,8 +17956,8 @@ function DataExplorerViewTree({
17956
17956
  return resolveDataExplorerValue(action.visible, payload) ?? true;
17957
17957
  });
17958
17958
  if (visibleActions.length === 0) return null;
17959
- return /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
17960
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
17959
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Root, { children: [
17960
+ /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
17961
17961
  "button",
17962
17962
  {
17963
17963
  type: "button",
@@ -17972,8 +17972,8 @@ function DataExplorerViewTree({
17972
17972
  children: /* @__PURE__ */ jsx(MoreIcon2, {})
17973
17973
  }
17974
17974
  ) }),
17975
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx(
17976
- DropdownMenu3.Content,
17975
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsx(
17976
+ DropdownMenu5.Content,
17977
17977
  {
17978
17978
  align: "end",
17979
17979
  sideOffset: 6,
@@ -17988,9 +17988,9 @@ function DataExplorerViewTree({
17988
17988
  return /* @__PURE__ */ jsx("div", { children: action.render(payload) }, action.id);
17989
17989
  }
17990
17990
  return /* @__PURE__ */ jsxs("div", { children: [
17991
- action.separatorBefore ? /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator }) : null,
17991
+ action.separatorBefore ? /* @__PURE__ */ jsx(DropdownMenu5.Separator, { className: theme.slots.menuSeparator }) : null,
17992
17992
  /* @__PURE__ */ jsxs(
17993
- DropdownMenu3.Item,
17993
+ DropdownMenu5.Item,
17994
17994
  {
17995
17995
  title: action.title,
17996
17996
  disabled,
@@ -18012,7 +18012,7 @@ function DataExplorerViewTree({
18012
18012
  ]
18013
18013
  }
18014
18014
  ),
18015
- action.separatorAfter ? /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: theme.slots.menuSeparator }) : null
18015
+ action.separatorAfter ? /* @__PURE__ */ jsx(DropdownMenu5.Separator, { className: theme.slots.menuSeparator }) : null
18016
18016
  ] }, action.id);
18017
18017
  })
18018
18018
  }
@@ -20796,6 +20796,277 @@ function LoginPage({
20796
20796
  }
20797
20797
  );
20798
20798
  }
20799
+ var defaultAppearance = {
20800
+ preset: "admin",
20801
+ density: "compact",
20802
+ radius: "lg",
20803
+ border: "subtle",
20804
+ background: "soft"
20805
+ };
20806
+ var radiusClassNames = {
20807
+ default: "rounded-md",
20808
+ none: "rounded-none",
20809
+ sm: "rounded-sm",
20810
+ md: "rounded-md",
20811
+ lg: "rounded-lg",
20812
+ xl: "rounded-xl",
20813
+ full: "rounded-full"
20814
+ };
20815
+ function CheckIcon4() {
20816
+ return /* @__PURE__ */ jsx(
20817
+ "svg",
20818
+ {
20819
+ "aria-hidden": "true",
20820
+ className: "h-3 w-3",
20821
+ viewBox: "0 0 24 24",
20822
+ fill: "none",
20823
+ stroke: "currentColor",
20824
+ strokeWidth: "2.25",
20825
+ strokeLinecap: "round",
20826
+ strokeLinejoin: "round",
20827
+ children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" })
20828
+ }
20829
+ );
20830
+ }
20831
+ function MoreIcon3() {
20832
+ return /* @__PURE__ */ jsxs(
20833
+ "svg",
20834
+ {
20835
+ "aria-hidden": "true",
20836
+ className: "h-4 w-4",
20837
+ viewBox: "0 0 24 24",
20838
+ fill: "none",
20839
+ stroke: "currentColor",
20840
+ strokeWidth: "2",
20841
+ strokeLinecap: "round",
20842
+ strokeLinejoin: "round",
20843
+ children: [
20844
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "1" }),
20845
+ /* @__PURE__ */ jsx("circle", { cx: "19", cy: "12", r: "1" }),
20846
+ /* @__PURE__ */ jsx("circle", { cx: "5", cy: "12", r: "1" })
20847
+ ]
20848
+ }
20849
+ );
20850
+ }
20851
+ function getInitials2(name) {
20852
+ if (!name) return "U";
20853
+ const words = name.trim().split(/\s+/).filter(Boolean);
20854
+ if (!words.length) return "U";
20855
+ if (words.length === 1) return words[0].slice(0, 2).toUpperCase();
20856
+ return words.slice(0, 2).map((word) => word[0]).join("").toUpperCase();
20857
+ }
20858
+ function renderIcon(icon, className) {
20859
+ if (!icon) return null;
20860
+ return /* @__PURE__ */ jsx("span", { className: cn("inline-flex h-4 w-4 shrink-0 items-center justify-center", className), children: icon });
20861
+ }
20862
+ function getCurrentOptionLabel(selector) {
20863
+ return selector.options.find((option) => option.value === selector.value)?.label ?? selector.value;
20864
+ }
20865
+ function UserAccountMenuSelector({
20866
+ classNames,
20867
+ menuRadius,
20868
+ selector
20869
+ }) {
20870
+ if (selector.visible === false || selector.options.length === 0) return null;
20871
+ const radiusClass = radiusClassNames[menuRadius];
20872
+ const currentLabel = getCurrentOptionLabel(selector);
20873
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Sub, { children: [
20874
+ /* @__PURE__ */ jsxs(
20875
+ DropdownMenu5.SubTrigger,
20876
+ {
20877
+ disabled: selector.disabled,
20878
+ className: cn(
20879
+ "relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
20880
+ radiusClass,
20881
+ classNames?.subTrigger
20882
+ ),
20883
+ children: [
20884
+ renderIcon(selector.icon),
20885
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: selector.label }),
20886
+ /* @__PURE__ */ jsx("span", { className: "ml-auto min-w-0 max-w-[7rem] truncate text-xs text-[hsl(var(--muted-foreground))]", children: currentLabel })
20887
+ ]
20888
+ }
20889
+ ),
20890
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsx(
20891
+ DropdownMenu5.SubContent,
20892
+ {
20893
+ sideOffset: 8,
20894
+ className: cn(
20895
+ "z-50 min-w-40 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
20896
+ radiusClass,
20897
+ selector.contentWidthClassName,
20898
+ classNames?.subContent
20899
+ ),
20900
+ children: /* @__PURE__ */ jsx(DropdownMenu5.RadioGroup, { value: selector.value, onValueChange: selector.onChange, children: selector.options.map((option) => /* @__PURE__ */ jsxs(
20901
+ DropdownMenu5.RadioItem,
20902
+ {
20903
+ value: option.value,
20904
+ disabled: option.disabled,
20905
+ className: cn(
20906
+ "relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 pl-8 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
20907
+ radiusClass,
20908
+ classNames?.item
20909
+ ),
20910
+ children: [
20911
+ /* @__PURE__ */ jsx(DropdownMenu5.ItemIndicator, { className: "absolute left-2 inline-flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsx(CheckIcon4, {}) }),
20912
+ renderIcon(option.icon, classNames?.itemIcon),
20913
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: option.label })
20914
+ ]
20915
+ },
20916
+ option.value
20917
+ )) })
20918
+ }
20919
+ ) })
20920
+ ] });
20921
+ }
20922
+ function UserAccountMenu({
20923
+ align = "end",
20924
+ appearance = defaultAppearance,
20925
+ ariaLabel,
20926
+ className,
20927
+ classNames,
20928
+ contentWidthClassName = "w-56",
20929
+ fallbackName = "User",
20930
+ items = [],
20931
+ menuRadius = "default",
20932
+ selectors = [],
20933
+ side = "bottom",
20934
+ sideOffset = 8,
20935
+ triggerEndIcon,
20936
+ triggerTitle,
20937
+ triggerVariant = "avatar",
20938
+ user
20939
+ }) {
20940
+ const displayName = user.name?.trim() || fallbackName;
20941
+ const initials = user.initials ?? getInitials2(displayName);
20942
+ const radiusClass = radiusClassNames[menuRadius];
20943
+ const visibleSelectors = selectors.filter(
20944
+ (selector) => selector.visible !== false && selector.options.length > 0
20945
+ );
20946
+ const visibleItems = items.filter((item) => item.visible !== false);
20947
+ const hasMenuBody = visibleSelectors.length > 0 || visibleItems.length > 0;
20948
+ const avatar = /* @__PURE__ */ jsx(
20949
+ BaseAvatar,
20950
+ {
20951
+ appearance,
20952
+ alt: user.avatarAlt ?? displayName,
20953
+ className: cn("h-8 w-8", classNames?.avatar),
20954
+ initials,
20955
+ name: displayName,
20956
+ size: "sm",
20957
+ src: user.avatarUrl
20958
+ }
20959
+ );
20960
+ const isProfileTrigger = triggerVariant === "profile";
20961
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Root, { children: [
20962
+ /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
20963
+ BaseButton,
20964
+ {
20965
+ appearance,
20966
+ ariaLabel: ariaLabel ?? displayName,
20967
+ className: cn(
20968
+ isProfileTrigger ? "h-auto w-full justify-start rounded-lg border-transparent bg-transparent px-2 py-2 text-left shadow-none transition-all hover:bg-[hsl(var(--muted))]/60" : "h-9 w-9 overflow-visible rounded-full border-transparent bg-transparent p-0 shadow-none transition-all hover:ring-2 hover:ring-[hsl(var(--ring))]/20",
20969
+ className,
20970
+ classNames?.root,
20971
+ classNames?.trigger
20972
+ ),
20973
+ classNames: {
20974
+ icon: "h-8 w-8",
20975
+ label: isProfileTrigger ? "min-w-0 flex-1 text-left" : void 0
20976
+ },
20977
+ endIcon: isProfileTrigger ? triggerEndIcon ?? /* @__PURE__ */ jsx(MoreIcon3, {}) : void 0,
20978
+ icon: avatar,
20979
+ iconOnly: !isProfileTrigger,
20980
+ label: isProfileTrigger ? /* @__PURE__ */ jsxs("span", { className: "flex min-w-0 flex-col items-start", children: [
20981
+ /* @__PURE__ */ jsx("span", { className: "max-w-full truncate text-sm font-medium leading-none text-[hsl(var(--foreground))]", children: displayName }),
20982
+ user.secondaryText ? /* @__PURE__ */ jsx("span", { className: "mt-1 max-w-full truncate text-xs leading-none text-[hsl(var(--muted-foreground))]", children: user.secondaryText }) : null
20983
+ ] }) : void 0,
20984
+ title: triggerTitle ?? displayName,
20985
+ tone: "muted"
20986
+ }
20987
+ ) }),
20988
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsxs(
20989
+ DropdownMenu5.Content,
20990
+ {
20991
+ align,
20992
+ side,
20993
+ sideOffset,
20994
+ className: cn(
20995
+ "z-50 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
20996
+ contentWidthClassName,
20997
+ radiusClass,
20998
+ classNames?.content
20999
+ ),
21000
+ children: [
21001
+ /* @__PURE__ */ jsx(DropdownMenu5.Label, { className: cn("px-2 py-1.5 font-normal", classNames?.label), children: /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
21002
+ avatar,
21003
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col", children: [
21004
+ /* @__PURE__ */ jsx("span", { className: cn("truncate text-sm font-medium leading-none", classNames?.userName), children: displayName }),
21005
+ user.secondaryText ? /* @__PURE__ */ jsx(
21006
+ "span",
21007
+ {
21008
+ className: cn(
21009
+ "truncate pt-1 text-xs leading-none text-[hsl(var(--muted-foreground))]",
21010
+ classNames?.secondaryText
21011
+ ),
21012
+ children: user.secondaryText
21013
+ }
21014
+ ) : null
21015
+ ] })
21016
+ ] }) }),
21017
+ hasMenuBody ? /* @__PURE__ */ jsx(
21018
+ DropdownMenu5.Separator,
21019
+ {
21020
+ className: cn("my-1 h-px bg-[hsl(var(--border))]", classNames?.separator)
21021
+ }
21022
+ ) : null,
21023
+ visibleSelectors.map((selector, index) => /* @__PURE__ */ jsx(
21024
+ UserAccountMenuSelector,
21025
+ {
21026
+ classNames,
21027
+ menuRadius,
21028
+ selector
21029
+ },
21030
+ selector.id ?? `selector-${index}`
21031
+ )),
21032
+ visibleSelectors.length > 0 && visibleItems.length > 0 ? /* @__PURE__ */ jsx(
21033
+ DropdownMenu5.Separator,
21034
+ {
21035
+ className: cn("my-1 h-px bg-[hsl(var(--border))]", classNames?.separator)
21036
+ }
21037
+ ) : null,
21038
+ visibleItems.map((item) => /* @__PURE__ */ jsxs("div", { children: [
21039
+ item.separatorBefore ? /* @__PURE__ */ jsx(
21040
+ DropdownMenu5.Separator,
21041
+ {
21042
+ className: cn("my-1 h-px bg-[hsl(var(--border))]", classNames?.separator)
21043
+ }
21044
+ ) : null,
21045
+ /* @__PURE__ */ jsxs(
21046
+ DropdownMenu5.Item,
21047
+ {
21048
+ disabled: item.disabled,
21049
+ onSelect: item.onSelect,
21050
+ className: cn(
21051
+ "relative flex cursor-pointer select-none items-center gap-2 px-2 py-2 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[disabled]:pointer-events-none data-[disabled]:opacity-50",
21052
+ radiusClass,
21053
+ item.tone === "danger" && "text-[hsl(var(--destructive))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",
21054
+ classNames?.item,
21055
+ item.tone === "danger" && classNames?.dangerItem
21056
+ ),
21057
+ children: [
21058
+ renderIcon(item.icon, classNames?.itemIcon),
21059
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
21060
+ item.shortcut ? /* @__PURE__ */ jsx("span", { className: "ml-3 shrink-0 text-xs text-[hsl(var(--muted-foreground))]", children: item.shortcut }) : null
21061
+ ]
21062
+ }
21063
+ )
21064
+ ] }, item.id))
21065
+ ]
21066
+ }
21067
+ ) })
21068
+ ] });
21069
+ }
20799
21070
  function cn3(...inputs) {
20800
21071
  return inputs.filter(Boolean).join(" ");
20801
21072
  }
@@ -20876,27 +21147,27 @@ function AppHeader({
20876
21147
  (!tabs || tabs.length === 0) && /* @__PURE__ */ jsx("div", { className: "flex-1" }),
20877
21148
  /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-4", children: [
20878
21149
  extra,
20879
- user && /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
20880
- /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: "flex h-8 w-8 items-center justify-center rounded-full hover:ring-2 hover:ring-[hsl(var(--ring))]/20 transition-all overflow-hidden focus-visible:outline-none", children: user.photo ? /* @__PURE__ */ jsx("img", { src: user.photo, alt: user.name, className: "h-8 w-8 rounded-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium", children: user.name ? getUserInitials(user.name) : "U" }) }) }),
20881
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsxs(
20882
- DropdownMenu3.Content,
21150
+ user && /* @__PURE__ */ jsxs(DropdownMenu5.Root, { children: [
21151
+ /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsx("button", { className: "flex h-8 w-8 items-center justify-center rounded-full hover:ring-2 hover:ring-[hsl(var(--ring))]/20 transition-all overflow-hidden focus-visible:outline-none", children: user.photo ? /* @__PURE__ */ jsx("img", { src: user.photo, alt: user.name, className: "h-8 w-8 rounded-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium", children: user.name ? getUserInitials(user.name) : "U" }) }) }),
21152
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsxs(
21153
+ DropdownMenu5.Content,
20883
21154
  {
20884
21155
  className: "z-50 w-52 rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
20885
21156
  sideOffset: 5,
20886
21157
  align: "end",
20887
21158
  children: [
20888
- /* @__PURE__ */ jsxs(DropdownMenu3.Label, { className: "flex items-center gap-2 px-2 py-1.5 font-normal", children: [
21159
+ /* @__PURE__ */ jsxs(DropdownMenu5.Label, { className: "flex items-center gap-2 px-2 py-1.5 font-normal", children: [
20889
21160
  user.photo ? /* @__PURE__ */ jsx("img", { src: user.photo, alt: user.name, className: "h-8 w-8 rounded-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "flex h-8 w-8 items-center justify-center rounded-full bg-[hsl(var(--muted))] text-xs font-medium", children: user.name ? getUserInitials(user.name) : "U" }),
20890
21161
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
20891
21162
  /* @__PURE__ */ jsx("span", { className: "text-sm font-medium leading-none", children: user.name }),
20892
21163
  user.email && /* @__PURE__ */ jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))] leading-none mt-1", children: user.email })
20893
21164
  ] })
20894
21165
  ] }),
20895
- /* @__PURE__ */ jsx(DropdownMenu3.Separator, { className: "h-px bg-[hsl(var(--border))] my-1" }),
20896
- /* @__PURE__ */ jsxs(DropdownMenu3.Group, { children: [
21166
+ /* @__PURE__ */ jsx(DropdownMenu5.Separator, { className: "h-px bg-[hsl(var(--border))] my-1" }),
21167
+ /* @__PURE__ */ jsxs(DropdownMenu5.Group, { children: [
20897
21168
  userMenuItems,
20898
21169
  /* @__PURE__ */ jsxs(
20899
- DropdownMenu3.Item,
21170
+ DropdownMenu5.Item,
20900
21171
  {
20901
21172
  className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm text-[hsl(var(--destructive))] outline-none transition-colors hover:bg-[hsl(var(--accent))]",
20902
21173
  onSelect: () => onLogout?.(),
@@ -21072,9 +21343,9 @@ function AppLayout({ header, sidebar, children, flush = false, className }) {
21072
21343
  "flex h-screen flex-col gap-[var(--global-spacing,0.75rem)] overflow-hidden p-[var(--global-spacing,0.75rem)]",
21073
21344
  className
21074
21345
  ), style: { backgroundColor: "hsl(var(--muted))" }, children: [
21075
- header,
21346
+ header ? header : null,
21076
21347
  /* @__PURE__ */ jsxs("div", { className: "flex flex-1 gap-[var(--global-spacing,0.75rem)] overflow-hidden min-h-0", children: [
21077
- sidebar,
21348
+ sidebar ? sidebar : null,
21078
21349
  /* @__PURE__ */ jsx("main", { className: cn3(
21079
21350
  "flex-1 min-h-0 overflow-hidden rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))]",
21080
21351
  !flush && "overflow-y-auto"
@@ -21082,6 +21353,705 @@ function AppLayout({ header, sidebar, children, flush = false, className }) {
21082
21353
  ] })
21083
21354
  ] });
21084
21355
  }
21356
+ var NAVIGATION_LAYOUT_SIDEBAR_EXPANDED_WIDTH = "13.7rem";
21357
+ var NAVIGATION_LAYOUT_SIDEBAR_COLLAPSED_WIDTH = "4.25rem";
21358
+ var NAVIGATION_LAYOUT_TRANSITION_TIMING = "cubic-bezier(0.22, 1, 0.36, 1)";
21359
+ var NAVIGATION_LAYOUT_HEADBAR_DEFAULT_HEIGHT_PX = 72;
21360
+ var NAVIGATION_LAYOUT_HEADBAR_MIN_HEIGHT_PX = 56;
21361
+ var NAVIGATION_LAYOUT_HEADBAR_MAX_HEIGHT_PX = 120;
21362
+ var NAVIGATION_LAYOUT_HEADBAR_COMPACT_HEIGHT_THRESHOLD_PX = 64;
21363
+ var NAVIGATION_LAYOUT_HEADBAR_BOXED_VERTICAL_PADDING_PX = 12;
21364
+ var NAVIGATION_LAYOUT_HEADBAR_COMPACT_VERTICAL_PADDING_PX = 8;
21365
+ var NAVIGATION_LAYOUT_HEADBAR_LOGO_DEFAULT_SIZE_PX = 44;
21366
+ var NAVIGATION_LAYOUT_HEADBAR_LOGO_COMPACT_SIZE_PX = 36;
21367
+ var NAVIGATION_LAYOUT_DEFAULT_APPEARANCE = {
21368
+ preset: "admin",
21369
+ density: "compact",
21370
+ radius: "lg",
21371
+ border: "subtle",
21372
+ background: "soft"
21373
+ };
21374
+ var NAVIGATION_LAYOUT_MENU_RADIUS_CLASS_MAP = {
21375
+ none: { all: "rounded-none", left: "!rounded-none", right: "!rounded-none" },
21376
+ sm: { all: "rounded-sm", left: "!rounded-l-sm !rounded-r-none", right: "!rounded-l-none !rounded-r-sm" },
21377
+ md: { all: "rounded-md", left: "!rounded-l-md !rounded-r-none", right: "!rounded-l-none !rounded-r-md" },
21378
+ lg: { all: "rounded-lg", left: "!rounded-l-lg !rounded-r-none", right: "!rounded-l-none !rounded-r-lg" },
21379
+ xl: { all: "rounded-xl", left: "!rounded-l-xl !rounded-r-none", right: "!rounded-l-none !rounded-r-xl" },
21380
+ full: { all: "rounded-full", left: "!rounded-l-full !rounded-r-none", right: "!rounded-l-none !rounded-r-full" }
21381
+ };
21382
+ function clampHeadbarHeight(value) {
21383
+ if (typeof value !== "number" || !Number.isFinite(value)) return NAVIGATION_LAYOUT_HEADBAR_DEFAULT_HEIGHT_PX;
21384
+ return Math.min(NAVIGATION_LAYOUT_HEADBAR_MAX_HEIGHT_PX, Math.max(NAVIGATION_LAYOUT_HEADBAR_MIN_HEIGHT_PX, Math.round(value)));
21385
+ }
21386
+ function getHeadbarVerticalPaddingPx(heightPx) {
21387
+ return heightPx <= NAVIGATION_LAYOUT_HEADBAR_COMPACT_HEIGHT_THRESHOLD_PX ? NAVIGATION_LAYOUT_HEADBAR_COMPACT_VERTICAL_PADDING_PX : NAVIGATION_LAYOUT_HEADBAR_BOXED_VERTICAL_PADDING_PX;
21388
+ }
21389
+ function getHeadbarLogoSizePx(heightPx) {
21390
+ return heightPx <= NAVIGATION_LAYOUT_HEADBAR_COMPACT_HEIGHT_THRESHOLD_PX ? NAVIGATION_LAYOUT_HEADBAR_LOGO_COMPACT_SIZE_PX : NAVIGATION_LAYOUT_HEADBAR_LOGO_DEFAULT_SIZE_PX;
21391
+ }
21392
+ function getHeadbarMenuRadiusClass(menuRadius = "default", part = "all") {
21393
+ if (menuRadius === "default") {
21394
+ if (part === "left") return "rounded-l-lg rounded-r-none";
21395
+ if (part === "right") return "rounded-l-none rounded-r-lg";
21396
+ return "rounded-lg";
21397
+ }
21398
+ return NAVIGATION_LAYOUT_MENU_RADIUS_CLASS_MAP[menuRadius][part];
21399
+ }
21400
+ function getHeadbarFrameClass(layoutMode = "boxed") {
21401
+ return layoutMode === "full-bleed" ? "relative z-40 grid w-full shrink-0 grid-cols-[minmax(0,1fr)_minmax(0,max-content)_minmax(0,1fr)] items-center gap-4 rounded-none border-b border-x-0 border-t-0 border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]" : "relative z-40 grid w-full shrink-0 grid-cols-[minmax(0,1fr)_minmax(0,max-content)_minmax(0,1fr)] items-center gap-4 rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-[var(--global-spacing,0.75rem)]";
21402
+ }
21403
+ function getHeadbarFrameStyle(layoutMode = "boxed", heightPx) {
21404
+ const verticalPaddingPx = getHeadbarVerticalPaddingPx(heightPx);
21405
+ const style = {
21406
+ height: `${heightPx}px`,
21407
+ minHeight: `${heightPx}px`,
21408
+ paddingTop: `${verticalPaddingPx}px`,
21409
+ paddingBottom: `${verticalPaddingPx}px`
21410
+ };
21411
+ if (layoutMode === "full-bleed") {
21412
+ style.marginLeft = "calc(var(--global-spacing,0.75rem) * -1)";
21413
+ style.marginRight = "calc(var(--global-spacing,0.75rem) * -1)";
21414
+ style.marginTop = "calc(var(--global-spacing,0.75rem) * -1)";
21415
+ style.width = "calc(100% + (var(--global-spacing,0.75rem) * 2))";
21416
+ }
21417
+ return style;
21418
+ }
21419
+ function getHeadbarNavClass(navPosition = "center") {
21420
+ if (navPosition === "left") return "justify-start";
21421
+ if (navPosition === "right") return "justify-end";
21422
+ return "justify-center";
21423
+ }
21424
+ function findNavigationRootId(items, activeItemId) {
21425
+ for (const item of items) {
21426
+ if (item.id === activeItemId) return item.id;
21427
+ if (item.children?.some((child) => child.id === activeItemId)) return item.id;
21428
+ }
21429
+ return activeItemId;
21430
+ }
21431
+ function getNavigationActionTitle(action) {
21432
+ return action.title || (typeof action.label === "string" ? action.label : void 0);
21433
+ }
21434
+ function NavigationLayoutActionButtons({
21435
+ actions,
21436
+ compact
21437
+ }) {
21438
+ if (!actions.length) return null;
21439
+ if (compact) {
21440
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col items-center gap-2", children: actions.map((action) => {
21441
+ const title = getNavigationActionTitle(action);
21442
+ return /* @__PURE__ */ jsx(
21443
+ BaseTooltip,
21444
+ {
21445
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21446
+ content: action.label,
21447
+ placement: "right",
21448
+ children: /* @__PURE__ */ jsx(
21449
+ BaseButton,
21450
+ {
21451
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21452
+ tone: "muted",
21453
+ iconOnly: true,
21454
+ icon: action.icon,
21455
+ onClick: action.onClick,
21456
+ title,
21457
+ ariaLabel: title,
21458
+ className: cn3(
21459
+ "h-10 w-10 rounded-lg border-transparent text-[hsl(var(--muted-foreground))] shadow-none",
21460
+ "hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]",
21461
+ "active:translate-y-0 active:scale-[0.96]"
21462
+ )
21463
+ }
21464
+ )
21465
+ },
21466
+ action.id
21467
+ );
21468
+ }) });
21469
+ }
21470
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2", children: actions.map((action) => /* @__PURE__ */ jsx(
21471
+ BaseButton,
21472
+ {
21473
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21474
+ tone: "muted",
21475
+ icon: action.icon,
21476
+ label: /* @__PURE__ */ jsx("span", { className: "truncate", children: action.label }),
21477
+ onClick: action.onClick,
21478
+ title: getNavigationActionTitle(action),
21479
+ className: cn3(
21480
+ "h-9 w-full justify-start gap-2.5 rounded-lg border-transparent px-3 text-left text-[13px] text-[hsl(var(--muted-foreground))] shadow-none",
21481
+ "hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]",
21482
+ "active:translate-y-0 active:scale-[0.985]"
21483
+ )
21484
+ },
21485
+ action.id
21486
+ )) });
21487
+ }
21488
+ function SidebarNavigationList({
21489
+ activeItemId,
21490
+ items,
21491
+ onNavigate,
21492
+ revealRequest
21493
+ }) {
21494
+ const navRef = useRef(null);
21495
+ const [expandedByRoot, setExpandedByRoot] = useState({});
21496
+ const toggleRoot = (id) => {
21497
+ setExpandedByRoot((current) => ({
21498
+ ...current,
21499
+ [id]: !current[id]
21500
+ }));
21501
+ };
21502
+ useEffect(() => {
21503
+ if (!revealRequest) return;
21504
+ setExpandedByRoot((current) => ({
21505
+ ...current,
21506
+ [revealRequest.id]: true
21507
+ }));
21508
+ const frameId = window.requestAnimationFrame(() => {
21509
+ const targetElement = navRef.current?.querySelector(
21510
+ `[data-navigation-sidebar-root-id="${CSS.escape(revealRequest.id)}"]`
21511
+ );
21512
+ if (targetElement instanceof HTMLElement) {
21513
+ targetElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
21514
+ }
21515
+ });
21516
+ return () => window.cancelAnimationFrame(frameId);
21517
+ }, [revealRequest]);
21518
+ return /* @__PURE__ */ jsxs("div", { className: "h-full flex-1 overflow-y-auto", style: { scrollbarWidth: "none", msOverflowStyle: "none" }, children: [
21519
+ /* @__PURE__ */ jsx("style", { children: `.monkeys-navigation-sidebar-nav::-webkit-scrollbar { display: none; }` }),
21520
+ /* @__PURE__ */ jsx(
21521
+ "div",
21522
+ {
21523
+ ref: navRef,
21524
+ className: "monkeys-navigation-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",
21525
+ children: items.map((item) => {
21526
+ const isGroup = Boolean(item.children?.length);
21527
+ const isExpanded = Boolean(expandedByRoot[item.id]);
21528
+ const isActive = activeItemId === item.id;
21529
+ if (isGroup) {
21530
+ return /* @__PURE__ */ jsxs("div", { "data-navigation-sidebar-root-id": item.id, children: [
21531
+ /* @__PURE__ */ jsx(
21532
+ NavButton,
21533
+ {
21534
+ icon: item.icon,
21535
+ onClick: () => toggleRoot(item.id),
21536
+ postfix: /* @__PURE__ */ jsx("div", { className: "flex flex-1 justify-end", children: /* @__PURE__ */ jsx(
21537
+ "svg",
21538
+ {
21539
+ xmlns: "http://www.w3.org/2000/svg",
21540
+ width: "16",
21541
+ height: "16",
21542
+ viewBox: "0 0 24 24",
21543
+ fill: "none",
21544
+ stroke: "currentColor",
21545
+ strokeWidth: "2",
21546
+ strokeLinecap: "round",
21547
+ strokeLinejoin: "round",
21548
+ className: "shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",
21549
+ style: { transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)" },
21550
+ children: /* @__PURE__ */ jsx("path", { d: "m9 18 6-6-6-6" })
21551
+ }
21552
+ ) }),
21553
+ children: item.label
21554
+ }
21555
+ ),
21556
+ isExpanded ? /* @__PURE__ */ jsx("div", { className: "mt-1 flex flex-col gap-1", children: item.children?.map((child) => /* @__PURE__ */ jsx(
21557
+ NavButton,
21558
+ {
21559
+ active: activeItemId === child.id,
21560
+ onClick: () => onNavigate?.(child.id),
21561
+ children: child.label
21562
+ },
21563
+ child.id
21564
+ )) }) : null
21565
+ ] }, item.id);
21566
+ }
21567
+ return /* @__PURE__ */ jsx("div", { "data-navigation-sidebar-root-id": item.id, children: /* @__PURE__ */ jsx(NavButton, { active: isActive, icon: item.icon, onClick: () => onNavigate?.(item.id), children: item.label }) }, item.id);
21568
+ })
21569
+ }
21570
+ )
21571
+ ] });
21572
+ }
21573
+ function SidebarBrand({
21574
+ collapsed,
21575
+ logo,
21576
+ title
21577
+ }) {
21578
+ if (!logo) return null;
21579
+ const brandTitle = title ?? logo.title;
21580
+ const logoMark = /* @__PURE__ */ jsx(
21581
+ "div",
21582
+ {
21583
+ className: cn3(
21584
+ "flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",
21585
+ logo.url ? "bg-transparent" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"
21586
+ ),
21587
+ children: logo.url ? /* @__PURE__ */ jsx("img", { src: logo.url, alt: logo.title, className: "h-full w-full object-contain" }) : /* @__PURE__ */ jsx("span", { className: "text-sm font-bold", children: logo.title.charAt(0) })
21588
+ }
21589
+ );
21590
+ if (collapsed) {
21591
+ return /* @__PURE__ */ jsx(
21592
+ BaseTooltip,
21593
+ {
21594
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21595
+ content: brandTitle,
21596
+ placement: "right",
21597
+ children: /* @__PURE__ */ jsx(
21598
+ BaseButton,
21599
+ {
21600
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21601
+ ariaLabel: typeof brandTitle === "string" ? brandTitle : logo.title,
21602
+ className: "h-10 w-10 rounded-lg border-transparent bg-transparent p-0 shadow-none hover:bg-[hsl(var(--muted))]/60",
21603
+ icon: logoMark,
21604
+ iconOnly: true,
21605
+ onClick: logo.onClick,
21606
+ title: typeof brandTitle === "string" ? brandTitle : logo.title,
21607
+ tone: "muted"
21608
+ }
21609
+ )
21610
+ }
21611
+ );
21612
+ }
21613
+ return /* @__PURE__ */ jsx(
21614
+ BaseButton,
21615
+ {
21616
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21617
+ ariaLabel: logo.title,
21618
+ className: "h-auto w-full justify-start gap-3 border-transparent bg-transparent p-0 text-left shadow-none hover:bg-transparent",
21619
+ classNames: { icon: "h-9 w-9" },
21620
+ icon: logoMark,
21621
+ label: /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: brandTitle }),
21622
+ onClick: logo.onClick,
21623
+ title: typeof brandTitle === "string" ? brandTitle : logo.title,
21624
+ tone: "muted"
21625
+ }
21626
+ );
21627
+ }
21628
+ function Sidebar({
21629
+ accountMenu,
21630
+ activeItemId,
21631
+ actions = [],
21632
+ collapsed,
21633
+ collapsedAccountMenu,
21634
+ footer,
21635
+ header,
21636
+ items,
21637
+ logo,
21638
+ onCollapsedChange,
21639
+ onNavigate,
21640
+ onRevealRoot,
21641
+ revealRequest,
21642
+ title
21643
+ }) {
21644
+ if (collapsed) {
21645
+ const activeRootId = findNavigationRootId(items, activeItemId);
21646
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full min-h-0 w-full flex-col rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] p-2 shadow-sm", children: [
21647
+ /* @__PURE__ */ jsx("div", { className: "mb-3 flex shrink-0 justify-center", children: header ?? /* @__PURE__ */ jsx(SidebarBrand, { collapsed: true, logo, title }) }),
21648
+ /* @__PURE__ */ jsx(
21649
+ "div",
21650
+ {
21651
+ className: "flex min-h-0 flex-1 flex-col items-center gap-2 overflow-y-auto pb-3",
21652
+ style: { scrollbarWidth: "none", msOverflowStyle: "none" },
21653
+ children: items.map((item) => {
21654
+ const isActive = activeRootId === item.id;
21655
+ return /* @__PURE__ */ jsx(
21656
+ BaseTooltip,
21657
+ {
21658
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21659
+ content: item.label,
21660
+ placement: "right",
21661
+ children: /* @__PURE__ */ jsx(
21662
+ BaseButton,
21663
+ {
21664
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21665
+ tone: "muted",
21666
+ active: isActive,
21667
+ iconOnly: true,
21668
+ icon: item.icon,
21669
+ onClick: () => {
21670
+ onRevealRoot?.(item.id);
21671
+ onCollapsedChange?.(false);
21672
+ if (item.children?.length) return;
21673
+ onNavigate?.(item.id);
21674
+ },
21675
+ title: typeof item.label === "string" ? item.label : void 0,
21676
+ ariaLabel: typeof item.label === "string" ? item.label : item.id,
21677
+ className: cn3(
21678
+ "h-10 w-10 rounded-lg border text-[hsl(var(--muted-foreground))] shadow-none",
21679
+ "hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.96]",
21680
+ isActive ? "border-[hsl(var(--input))] bg-[hsl(var(--muted))] text-[hsl(var(--foreground))] shadow-sm" : "border-transparent hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]"
21681
+ )
21682
+ }
21683
+ )
21684
+ },
21685
+ item.id
21686
+ );
21687
+ })
21688
+ }
21689
+ ),
21690
+ /* @__PURE__ */ jsxs("div", { className: "-mx-2 mt-2 border-t border-[hsl(var(--input))] bg-[hsl(var(--background))] px-2 pt-2.5 pb-0.5", children: [
21691
+ /* @__PURE__ */ jsx(NavigationLayoutActionButtons, { actions, compact: true }),
21692
+ collapsedAccountMenu ? /* @__PURE__ */ jsx("div", { className: "mt-2 flex justify-center border-t border-[hsl(var(--input))] pt-2", children: collapsedAccountMenu }) : null
21693
+ ] })
21694
+ ] });
21695
+ }
21696
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-full min-h-0 w-full flex-col justify-between gap-0 overflow-y-hidden rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))] px-5 pt-5 pb-1.5", children: [
21697
+ /* @__PURE__ */ jsx("div", { className: "mb-4 shrink-0", children: header ?? /* @__PURE__ */ jsx(SidebarBrand, { logo, title }) }),
21698
+ /* @__PURE__ */ jsx(
21699
+ SidebarNavigationList,
21700
+ {
21701
+ activeItemId,
21702
+ items,
21703
+ onNavigate,
21704
+ revealRequest
21705
+ }
21706
+ ),
21707
+ /* @__PURE__ */ jsxs("div", { className: "-mx-5 mt-2 border-t border-[hsl(var(--input))] bg-[hsl(var(--background))] px-4 pt-2.5 pb-1", children: [
21708
+ /* @__PURE__ */ jsx(NavigationLayoutActionButtons, { actions, compact: false }),
21709
+ footer,
21710
+ accountMenu ? /* @__PURE__ */ jsx("div", { className: "mt-2 border-t border-[hsl(var(--input))] pt-2", children: accountMenu }) : null
21711
+ ] })
21712
+ ] });
21713
+ }
21714
+ function HeadbarChevronIcon({ open }) {
21715
+ return /* @__PURE__ */ jsx(
21716
+ "svg",
21717
+ {
21718
+ "aria-hidden": "true",
21719
+ className: cn3("h-4 w-4 shrink-0 transition-transform duration-200", open && "rotate-180"),
21720
+ viewBox: "0 0 24 24",
21721
+ fill: "none",
21722
+ stroke: "currentColor",
21723
+ strokeWidth: "2",
21724
+ strokeLinecap: "round",
21725
+ strokeLinejoin: "round",
21726
+ children: /* @__PURE__ */ jsx("path", { d: "m6 9 6 6 6-6" })
21727
+ }
21728
+ );
21729
+ }
21730
+ function HeadbarNavMenuItem({
21731
+ activeItemId,
21732
+ isActive,
21733
+ item,
21734
+ label,
21735
+ menuButtonRadiusClass,
21736
+ menuContentRadiusClass,
21737
+ menuItemRadiusClass,
21738
+ onNavigate
21739
+ }) {
21740
+ const [open, setOpen] = useState(false);
21741
+ const closeTimerRef = useRef(null);
21742
+ const clearCloseTimer = () => {
21743
+ if (!closeTimerRef.current) return;
21744
+ clearTimeout(closeTimerRef.current);
21745
+ closeTimerRef.current = null;
21746
+ };
21747
+ const openMenu = () => {
21748
+ clearCloseTimer();
21749
+ setOpen(true);
21750
+ };
21751
+ const scheduleCloseMenu = () => {
21752
+ clearCloseTimer();
21753
+ closeTimerRef.current = setTimeout(() => {
21754
+ setOpen(false);
21755
+ closeTimerRef.current = null;
21756
+ }, 120);
21757
+ };
21758
+ useEffect(() => clearCloseTimer, []);
21759
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Root, { modal: false, open, onOpenChange: setOpen, children: [
21760
+ /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsx(
21761
+ BaseButton,
21762
+ {
21763
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21764
+ tone: "muted",
21765
+ active: isActive || open,
21766
+ icon: item.icon,
21767
+ endIcon: /* @__PURE__ */ jsx(HeadbarChevronIcon, { open }),
21768
+ label: /* @__PURE__ */ jsx("span", { className: "truncate whitespace-nowrap", children: label }),
21769
+ onClick: () => setOpen(true),
21770
+ onMouseEnter: openMenu,
21771
+ onMouseLeave: scheduleCloseMenu,
21772
+ className: cn3(
21773
+ "h-9 max-w-[12rem] border-transparent !bg-transparent px-3 text-sm font-medium shadow-none",
21774
+ menuButtonRadiusClass,
21775
+ isActive || open ? "!bg-[hsl(var(--muted))] text-[hsl(var(--foreground))]" : "text-[hsl(var(--muted-foreground))] hover:!bg-[hsl(var(--muted))]/60 hover:text-[hsl(var(--foreground))]"
21776
+ )
21777
+ }
21778
+ ) }),
21779
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsx(
21780
+ DropdownMenu5.Content,
21781
+ {
21782
+ align: "start",
21783
+ sideOffset: 5,
21784
+ onCloseAutoFocus: (event) => event.preventDefault(),
21785
+ onMouseEnter: openMenu,
21786
+ onMouseLeave: scheduleCloseMenu,
21787
+ className: cn3(
21788
+ "z-50 min-w-56 border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1.5 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
21789
+ menuContentRadiusClass
21790
+ ),
21791
+ children: item.children?.map((child) => /* @__PURE__ */ jsxs(
21792
+ DropdownMenu5.Item,
21793
+ {
21794
+ className: cn3(
21795
+ "relative flex cursor-pointer select-none items-center gap-2.5 px-3 py-2 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))]",
21796
+ menuItemRadiusClass,
21797
+ child.id === activeItemId && "bg-[hsl(var(--muted))] text-[hsl(var(--foreground))]"
21798
+ ),
21799
+ onSelect: () => {
21800
+ setOpen(false);
21801
+ onNavigate?.(child.id);
21802
+ },
21803
+ children: [
21804
+ child.icon ? /* @__PURE__ */ jsx("span", { className: "inline-flex h-4 w-4 shrink-0 items-center justify-center text-[hsl(var(--muted-foreground))]", children: child.icon }) : null,
21805
+ /* @__PURE__ */ jsx("span", { className: "min-w-0 truncate", children: child.headbarLabel ?? child.label })
21806
+ ]
21807
+ },
21808
+ child.id
21809
+ ))
21810
+ }
21811
+ ) })
21812
+ ] });
21813
+ }
21814
+ function HeadbarNav({
21815
+ activeItemId,
21816
+ activeRootId,
21817
+ items,
21818
+ menuRadius,
21819
+ onNavigate
21820
+ }) {
21821
+ const menuButtonRadiusClass = getHeadbarMenuRadiusClass(menuRadius);
21822
+ const menuContentRadiusClass = getHeadbarMenuRadiusClass(menuRadius);
21823
+ const menuItemRadiusClass = getHeadbarMenuRadiusClass(menuRadius);
21824
+ return /* @__PURE__ */ jsx("div", { className: "flex min-w-0 items-center gap-1", children: items.map((item) => {
21825
+ const isActive = activeRootId === item.id || activeItemId === item.id;
21826
+ const label = item.headbarLabel ?? item.label;
21827
+ if (item.children?.length) {
21828
+ return /* @__PURE__ */ jsx(
21829
+ HeadbarNavMenuItem,
21830
+ {
21831
+ activeItemId,
21832
+ isActive,
21833
+ item,
21834
+ label,
21835
+ menuButtonRadiusClass,
21836
+ menuContentRadiusClass,
21837
+ menuItemRadiusClass,
21838
+ onNavigate
21839
+ },
21840
+ item.id
21841
+ );
21842
+ }
21843
+ return /* @__PURE__ */ jsx(
21844
+ BaseButton,
21845
+ {
21846
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21847
+ tone: "muted",
21848
+ active: isActive,
21849
+ icon: item.icon,
21850
+ label: /* @__PURE__ */ jsx("span", { className: "truncate whitespace-nowrap", children: label }),
21851
+ onClick: () => onNavigate?.(item.id),
21852
+ className: cn3(
21853
+ "h-9 max-w-[12rem] border-transparent !bg-transparent px-3 text-sm font-medium shadow-none",
21854
+ menuButtonRadiusClass,
21855
+ isActive ? "!bg-[hsl(var(--muted))] text-[hsl(var(--foreground))]" : "text-[hsl(var(--muted-foreground))] hover:!bg-[hsl(var(--muted))]/60 hover:text-[hsl(var(--foreground))]"
21856
+ )
21857
+ },
21858
+ item.id
21859
+ );
21860
+ }) });
21861
+ }
21862
+ function Headbar({
21863
+ activeItemId,
21864
+ activeRootId,
21865
+ actions,
21866
+ accountMenu,
21867
+ extra,
21868
+ layout,
21869
+ logo,
21870
+ navItems,
21871
+ onNavigate
21872
+ }) {
21873
+ const heightPx = clampHeadbarHeight(layout?.heightPx);
21874
+ const layoutMode = layout?.layoutMode ?? "boxed";
21875
+ const menuRadius = layout?.menuRadius ?? "default";
21876
+ const logoHeightPx = getHeadbarLogoSizePx(heightPx);
21877
+ const frameStyle = getHeadbarFrameStyle(layoutMode, heightPx);
21878
+ const showBrandTitle = Boolean(layout?.brandTitle);
21879
+ return /* @__PURE__ */ jsxs("header", { className: getHeadbarFrameClass(layoutMode), style: frameStyle, children: [
21880
+ /* @__PURE__ */ jsx("div", { className: "flex min-w-0 items-center justify-start", children: logo ? /* @__PURE__ */ jsx(
21881
+ BaseButton,
21882
+ {
21883
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21884
+ tone: "muted",
21885
+ icon: /* @__PURE__ */ jsx(
21886
+ "div",
21887
+ {
21888
+ className: cn3(
21889
+ "flex items-center justify-center overflow-hidden rounded-lg",
21890
+ logo.url ? "w-auto max-w-[min(22rem,30vw)] bg-transparent" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"
21891
+ ),
21892
+ style: logo.url ? { height: logoHeightPx } : { width: logoHeightPx, height: logoHeightPx },
21893
+ children: logo.url ? /* @__PURE__ */ jsx("img", { src: logo.url, alt: logo.title, className: "block h-full w-auto object-contain" }) : /* @__PURE__ */ jsx("span", { className: "text-base font-bold", children: logo.title.charAt(0) })
21894
+ }
21895
+ ),
21896
+ label: showBrandTitle ? /* @__PURE__ */ jsx("span", { className: "truncate whitespace-nowrap text-base font-medium text-[hsl(var(--foreground))]", children: layout?.brandTitle }) : null,
21897
+ ariaLabel: logo.title,
21898
+ title: logo.title,
21899
+ className: "h-auto min-w-0 justify-start border-transparent bg-transparent p-0 shadow-none hover:bg-transparent",
21900
+ classNames: logo.url ? { icon: "!h-auto !w-auto shrink-0" } : void 0,
21901
+ onClick: logo.onClick
21902
+ }
21903
+ ) : null }),
21904
+ /* @__PURE__ */ jsx("div", { className: cn3("flex min-w-0 items-center", getHeadbarNavClass(layout?.navPosition)), children: /* @__PURE__ */ jsx("div", { className: "no-scrollbar flex max-w-full min-w-0 items-center overflow-x-auto overscroll-x-contain", children: /* @__PURE__ */ jsx(
21905
+ HeadbarNav,
21906
+ {
21907
+ activeItemId,
21908
+ activeRootId,
21909
+ items: navItems,
21910
+ menuRadius,
21911
+ onNavigate
21912
+ }
21913
+ ) }) }),
21914
+ /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center justify-end gap-3", children: [
21915
+ actions,
21916
+ extra,
21917
+ accountMenu
21918
+ ] })
21919
+ ] });
21920
+ }
21921
+ function NavigationLayout({
21922
+ activeItemId,
21923
+ activeRootId,
21924
+ allowModeSwitch = false,
21925
+ accountMenu,
21926
+ children,
21927
+ className,
21928
+ collapsedSidebarAccountMenu,
21929
+ collapsedSidebarWidth = NAVIGATION_LAYOUT_SIDEBAR_COLLAPSED_WIDTH,
21930
+ defaultMode = "headbar",
21931
+ defaultSidebarCollapsed = false,
21932
+ expandedSidebarWidth = NAVIGATION_LAYOUT_SIDEBAR_EXPANDED_WIDTH,
21933
+ flush = false,
21934
+ headbarActions,
21935
+ headbarLayout,
21936
+ logo,
21937
+ mode,
21938
+ navItems,
21939
+ onModeChange,
21940
+ onNavigate,
21941
+ onSidebarCollapsedChange,
21942
+ renderHeadbarExtra,
21943
+ sidebarAccountMenu,
21944
+ sidebarFooter,
21945
+ sidebarHeader,
21946
+ switchToHeadbarLabel = "Switch to headbar",
21947
+ switchToSidebarLabel = "Switch to sidebar"
21948
+ }) {
21949
+ const [uncontrolledMode, setUncontrolledMode] = useState(defaultMode);
21950
+ const [sidebarCollapsed, setSidebarCollapsed] = useState(defaultSidebarCollapsed);
21951
+ const [revealRequest, setRevealRequest] = useState(null);
21952
+ const isModeControlled = mode !== void 0;
21953
+ const navigationMode = isModeControlled ? mode : uncontrolledMode;
21954
+ const isHeadbarMode = navigationMode === "headbar";
21955
+ const sidebarWidth = sidebarCollapsed ? collapsedSidebarWidth : expandedSidebarWidth;
21956
+ useEffect(() => {
21957
+ if (!isModeControlled) {
21958
+ setUncontrolledMode(defaultMode);
21959
+ }
21960
+ }, [defaultMode, isModeControlled]);
21961
+ const setNavigationMode = (nextMode) => {
21962
+ if (!isModeControlled) {
21963
+ setUncontrolledMode(nextMode);
21964
+ }
21965
+ onModeChange?.(nextMode);
21966
+ };
21967
+ const setCollapsed = (collapsed) => {
21968
+ setSidebarCollapsed(collapsed);
21969
+ onSidebarCollapsedChange?.(collapsed);
21970
+ };
21971
+ const navigationActions = [];
21972
+ if (allowModeSwitch) {
21973
+ navigationActions.push({
21974
+ id: "toggle-headbar",
21975
+ label: switchToHeadbarLabel,
21976
+ onClick: () => setNavigationMode("headbar"),
21977
+ icon: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-[18px] w-[18px] rotate-180", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
21978
+ /* @__PURE__ */ jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
21979
+ /* @__PURE__ */ jsx("path", { d: "M3 9h18" })
21980
+ ] })
21981
+ });
21982
+ }
21983
+ navigationActions.push({
21984
+ id: "toggle-sidebar",
21985
+ label: sidebarCollapsed ? "Expand sidebar" : "Collapse sidebar",
21986
+ onClick: () => setCollapsed(!sidebarCollapsed),
21987
+ icon: /* @__PURE__ */ 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: [
21988
+ /* @__PURE__ */ jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
21989
+ /* @__PURE__ */ jsx("path", { d: "M9 3v18" }),
21990
+ /* @__PURE__ */ jsx("path", { d: sidebarCollapsed ? "m14 9 3 3-3 3" : "m16 15-3-3 3-3" })
21991
+ ] })
21992
+ });
21993
+ const sidebar = isHeadbarMode ? null : /* @__PURE__ */ jsx(
21994
+ "div",
21995
+ {
21996
+ className: "relative h-full min-h-0 shrink-0 overflow-hidden transition-[width] duration-260",
21997
+ style: { width: sidebarWidth, transitionTimingFunction: NAVIGATION_LAYOUT_TRANSITION_TIMING },
21998
+ children: /* @__PURE__ */ jsx(
21999
+ Sidebar,
22000
+ {
22001
+ accountMenu: sidebarAccountMenu ?? accountMenu,
22002
+ activeItemId,
22003
+ actions: navigationActions,
22004
+ collapsed: sidebarCollapsed,
22005
+ collapsedAccountMenu: collapsedSidebarAccountMenu ?? accountMenu,
22006
+ footer: sidebarFooter,
22007
+ header: sidebarHeader,
22008
+ items: navItems,
22009
+ logo,
22010
+ onCollapsedChange: setCollapsed,
22011
+ onNavigate,
22012
+ onRevealRoot: (rootId) => setRevealRequest((prev) => ({ id: rootId, nonce: (prev?.nonce ?? 0) + 1 })),
22013
+ revealRequest,
22014
+ title: headbarLayout?.brandTitle
22015
+ }
22016
+ )
22017
+ }
22018
+ );
22019
+ const header = isHeadbarMode ? /* @__PURE__ */ jsx(
22020
+ Headbar,
22021
+ {
22022
+ activeItemId,
22023
+ activeRootId: activeRootId ?? findNavigationRootId(navItems, activeItemId),
22024
+ actions: allowModeSwitch ? /* @__PURE__ */ jsxs(Fragment, { children: [
22025
+ headbarActions,
22026
+ /* @__PURE__ */ jsx(
22027
+ BaseButton,
22028
+ {
22029
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
22030
+ tone: "muted",
22031
+ icon: /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4 shrink-0", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", strokeLinecap: "round", strokeLinejoin: "round", children: [
22032
+ /* @__PURE__ */ jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
22033
+ /* @__PURE__ */ jsx("path", { d: "M9 3v18" }),
22034
+ /* @__PURE__ */ jsx("path", { d: "m14 9 3 3-3 3" })
22035
+ ] }),
22036
+ label: /* @__PURE__ */ jsx("span", { className: "truncate whitespace-nowrap", children: switchToSidebarLabel }),
22037
+ onClick: () => setNavigationMode("sidebar"),
22038
+ className: cn3(
22039
+ "h-auto min-w-0 shrink px-3 py-2 text-sm font-medium text-[hsl(var(--muted-foreground))] shadow-none hover:border-[hsl(var(--input))]/70 hover:bg-[hsl(var(--muted))]/60 hover:text-[hsl(var(--foreground))]",
22040
+ getHeadbarMenuRadiusClass(headbarLayout?.menuRadius)
22041
+ )
22042
+ }
22043
+ )
22044
+ ] }) : headbarActions,
22045
+ accountMenu,
22046
+ extra: renderHeadbarExtra,
22047
+ layout: headbarLayout,
22048
+ logo,
22049
+ navItems,
22050
+ onNavigate
22051
+ }
22052
+ ) : null;
22053
+ return /* @__PURE__ */ jsx(AppLayout, { header, sidebar, flush, className, children });
22054
+ }
21085
22055
  function ClampIcon({ expanded }) {
21086
22056
  return /* @__PURE__ */ jsxs("svg", { "aria-hidden": "true", viewBox: "0 0 20 20", className: "h-4 w-4", fill: "none", children: [
21087
22057
  /* @__PURE__ */ jsx(
@@ -25026,7 +25996,7 @@ function DarkModeSelector({
25026
25996
  { value: "light", label: resolvedLabels.light, Icon: SunIcon },
25027
25997
  { value: "dark", label: resolvedLabels.dark, Icon: MoonIcon }
25028
25998
  ];
25029
- const trigger = /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
25999
+ const trigger = /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
25030
26000
  "button",
25031
26001
  {
25032
26002
  className: cn5(
@@ -25039,7 +26009,7 @@ function DarkModeSelector({
25039
26009
  ]
25040
26010
  }
25041
26011
  ) });
25042
- return /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
26012
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Root, { children: [
25043
26013
  tooltip ? /* @__PURE__ */ jsx(Tooltip.Provider, { delayDuration: 300, children: /* @__PURE__ */ jsxs(Tooltip.Root, { children: [
25044
26014
  /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children: trigger }),
25045
26015
  /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsxs(
@@ -25054,14 +26024,14 @@ function DarkModeSelector({
25054
26024
  }
25055
26025
  ) })
25056
26026
  ] }) }) : trigger,
25057
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx(
25058
- DropdownMenu3.Content,
26027
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsx(
26028
+ DropdownMenu5.Content,
25059
26029
  {
25060
26030
  className: "z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
25061
26031
  sideOffset: 5,
25062
26032
  align: "end",
25063
26033
  children: options.map(({ value, label, Icon }) => /* @__PURE__ */ jsxs(
25064
- DropdownMenu3.Item,
26034
+ DropdownMenu5.Item,
25065
26035
  {
25066
26036
  className: cn5(
25067
26037
  "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",
@@ -25109,19 +26079,19 @@ function DarkModeSubMenu({
25109
26079
  { value: "light", label: resolvedLabels.light, Icon: SunIcon },
25110
26080
  { value: "dark", label: resolvedLabels.dark, Icon: MoonIcon }
25111
26081
  ];
25112
- return /* @__PURE__ */ jsxs(DropdownMenu3.Sub, { children: [
25113
- /* @__PURE__ */ jsxs(DropdownMenu3.SubTrigger, { className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))]", children: [
26082
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Sub, { children: [
26083
+ /* @__PURE__ */ jsxs(DropdownMenu5.SubTrigger, { className: "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))] data-[state=open]:bg-[hsl(var(--accent))]", children: [
25114
26084
  /* @__PURE__ */ jsx(SunMoonIcon, { className: "h-4 w-4" }),
25115
26085
  /* @__PURE__ */ jsx("span", { children: label }),
25116
26086
  /* @__PURE__ */ jsx("span", { className: "ml-auto text-xs text-[hsl(var(--muted-foreground))]", children: currentLabel })
25117
26087
  ] }),
25118
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx(
25119
- DropdownMenu3.SubContent,
26088
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsx(
26089
+ DropdownMenu5.SubContent,
25120
26090
  {
25121
26091
  className: "z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
25122
26092
  sideOffset: 8,
25123
26093
  children: options.map(({ value, label: optLabel, Icon }) => /* @__PURE__ */ jsxs(
25124
- DropdownMenu3.CheckboxItem,
26094
+ DropdownMenu5.CheckboxItem,
25125
26095
  {
25126
26096
  checked: mode === value,
25127
26097
  disabled: mode === value,
@@ -25130,7 +26100,7 @@ function DarkModeSubMenu({
25130
26100
  ),
25131
26101
  onCheckedChange: () => onModeChange(value),
25132
26102
  children: [
25133
- /* @__PURE__ */ jsx(DropdownMenu3.ItemIndicator, { className: "absolute left-2 inline-flex items-center justify-center", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) }) }),
26103
+ /* @__PURE__ */ jsx(DropdownMenu5.ItemIndicator, { className: "absolute left-2 inline-flex items-center justify-center", children: /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M20 6 9 17l-5-5" }) }) }),
25134
26104
  /* @__PURE__ */ jsx(Icon, { className: "h-4 w-4" }),
25135
26105
  optLabel
25136
26106
  ]
@@ -25158,7 +26128,7 @@ function I18nSelector({
25158
26128
  tooltip,
25159
26129
  className
25160
26130
  }) {
25161
- const trigger = /* @__PURE__ */ jsx(DropdownMenu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
26131
+ const trigger = /* @__PURE__ */ jsx(DropdownMenu5.Trigger, { asChild: true, children: /* @__PURE__ */ jsxs(
25162
26132
  "button",
25163
26133
  {
25164
26134
  className: cn6(
@@ -25171,7 +26141,7 @@ function I18nSelector({
25171
26141
  ]
25172
26142
  }
25173
26143
  ) });
25174
- return /* @__PURE__ */ jsxs(DropdownMenu3.Root, { children: [
26144
+ return /* @__PURE__ */ jsxs(DropdownMenu5.Root, { children: [
25175
26145
  tooltip ? /* @__PURE__ */ jsx(Tooltip.Provider, { delayDuration: 300, children: /* @__PURE__ */ jsxs(Tooltip.Root, { children: [
25176
26146
  /* @__PURE__ */ jsx(Tooltip.Trigger, { asChild: true, children: trigger }),
25177
26147
  /* @__PURE__ */ jsx(Tooltip.Portal, { children: /* @__PURE__ */ jsxs(
@@ -25186,14 +26156,14 @@ function I18nSelector({
25186
26156
  }
25187
26157
  ) })
25188
26158
  ] }) }) : trigger,
25189
- /* @__PURE__ */ jsx(DropdownMenu3.Portal, { children: /* @__PURE__ */ jsx(
25190
- DropdownMenu3.Content,
26159
+ /* @__PURE__ */ jsx(DropdownMenu5.Portal, { children: /* @__PURE__ */ jsx(
26160
+ DropdownMenu5.Content,
25191
26161
  {
25192
26162
  className: "z-50 min-w-[8rem] rounded-md border border-[hsl(var(--border))] bg-[hsl(var(--popover))] p-1 text-[hsl(var(--popover-foreground))] shadow-md animate-in fade-in-0 zoom-in-95",
25193
26163
  sideOffset: 5,
25194
26164
  align: "end",
25195
26165
  children: languages.map(({ code, label }) => /* @__PURE__ */ jsx(
25196
- DropdownMenu3.Item,
26166
+ DropdownMenu5.Item,
25197
26167
  {
25198
26168
  className: cn6(
25199
26169
  "relative flex cursor-pointer select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--accent-foreground))]",
@@ -25270,6 +26240,6 @@ lodash/lodash.js:
25270
26240
  *)
25271
26241
  */
25272
26242
 
25273
- export { ARTIST_CONFIG, ARTIST_DEFAULT_QUICK_ACTIONS, AppHeader, AppLayout, AppSidebar, ArtistLandingPage, BSD_CONFIG, BSD_DEFAULT_FEATURE_CARDS, BaseAccordion, BaseAvatar, BaseBadge, BaseBreadcrumb, BaseButton, BaseCheckbox, BaseContextMenu, BaseContextMenuCheckboxItem, BaseContextMenuContent, BaseContextMenuItem, BaseContextMenuLabel, BaseContextMenuRadioGroup, BaseContextMenuRadioItem, BaseContextMenuSeparator, BaseContextMenuSub, BaseContextMenuSubContent, BaseContextMenuSubTrigger, BaseContextMenuTrigger, BaseDescriptionList, BaseDialog, BaseDivider, BaseDropdownMenu, BaseEmptyState, BaseField, BaseInput, BaseLayout, BaseLayoutPane, BaseLayoutResizeHandle, BaseLayoutSplit, BaseLoadingState, BaseMultiSelect, BaseNotice, BasePagination, BasePanel, BaseProgress, BaseRadioGroup, BaseSectionHeader, BaseSegmentedControl, BaseSelect, BaseSkeleton, BaseSwitch, BaseTable, BaseTableBody, BaseTableCaption, BaseTableCell, BaseTableContainer, BaseTableEmpty, BaseTableFooter, BaseTableFooterBar, BaseTableHead, BaseTableHeader, BaseTableLoading, BaseTableRow, BaseTabs, BaseTextarea, BaseToolbar, BaseTooltip, BsdLandingPage, BsdToolboxPanel, CONCEPT_CONFIG, CONCEPT_DEFAULT_QUICK_ACTIONS, ConceptDesignLandingPage, DarkModeSelector, DarkModeSubMenu, DataExplorerActionBar, DataExplorerButton, DataExplorerCheckbox, DataExplorerCollectionFooter, DataExplorerDetailField, DataExplorerDetailSection, DataExplorerDetailShell, DataExplorerDisplayActionMenu, DataExplorerDisplayCard, DataExplorerDisplayCollectionView, DataExplorerDisplayListItem, DataExplorerDisplayMedia, DataExplorerImagePreview, DataExplorerPage, DataExplorerRecordCard, DataExplorerSelect, DataExplorerToolbarActions, DataExplorerToolbarShell, DataExplorerTree, DataExplorerTreeShell, DataExplorerView, DataExplorerViewCollection, DataExplorerViewItem, DataExplorerViewItemShell, DataExplorerViewShell, DataExplorerViewTree, DefaultLandingPage, DynamicComponent, I18nSelector, InteractiveTable, InteractiveTableEditableTextCell, InteractiveTableReadonlyCell, InteractiveTableSelectCell, LoginPage, MonkeysToastProvider, MonkeysToaster, NavButton, MonkeysToastProvider as ToastProvider, MonkeysToaster as Toaster, WorkbenchContentPane, WorkbenchContentToolbar, WorkbenchDetailSidebar, WorkbenchGalleryCard, WorkbenchGallerySettingsButton, WorkbenchGallerySettingsPanel, WorkbenchGalleryView, WorkbenchLaneView, WorkbenchMasonryLayout, WorkbenchResizableSidebar, WorkbenchTableView, applyMonkeysTheme, calculateHue, calculateLightness, calculateSaturation, clearRegistry, cn3 as cn, createSolidColorScale, extractToastMessage, genTailwindTheme, getBaseBadgeToneClassName, getBaseButtonToneClassName, getBaseMenuItemToneClassName, getBaseNoticeToneClassName, getDataExplorerActionToneClassName, getDataExplorerMenuItemToneClassName, getRegisteredComponents, getRegisteredThemes, getThemeConfig, hasCustomComponent, markDarkColor, registerComponent, registerTheme, resolveBaseAppearance, resolveComponent, resolveDataExplorerAppearance, resolveMonkeysTheme, resolveToastVariantForMessage, setNeocardTheme, setTailwindTheme, toast, useDarkMode, useToastFeed, useToastOnValue };
26243
+ export { ARTIST_CONFIG, ARTIST_DEFAULT_QUICK_ACTIONS, AppHeader, AppLayout, AppSidebar, ArtistLandingPage, BSD_CONFIG, BSD_DEFAULT_FEATURE_CARDS, BaseAccordion, BaseAvatar, BaseBadge, BaseBreadcrumb, BaseButton, BaseCheckbox, BaseContextMenu, BaseContextMenuCheckboxItem, BaseContextMenuContent, BaseContextMenuItem, BaseContextMenuLabel, BaseContextMenuRadioGroup, BaseContextMenuRadioItem, BaseContextMenuSeparator, BaseContextMenuSub, BaseContextMenuSubContent, BaseContextMenuSubTrigger, BaseContextMenuTrigger, BaseDescriptionList, BaseDialog, BaseDivider, BaseDropdownMenu, BaseEmptyState, BaseField, BaseInput, BaseLayout, BaseLayoutPane, BaseLayoutResizeHandle, BaseLayoutSplit, BaseLoadingState, BaseMultiSelect, BaseNotice, BasePagination, BasePanel, BaseProgress, BaseRadioGroup, BaseSectionHeader, BaseSegmentedControl, BaseSelect, BaseSkeleton, BaseSwitch, BaseTable, BaseTableBody, BaseTableCaption, BaseTableCell, BaseTableContainer, BaseTableEmpty, BaseTableFooter, BaseTableFooterBar, BaseTableHead, BaseTableHeader, BaseTableLoading, BaseTableRow, BaseTabs, BaseTextarea, BaseToolbar, BaseTooltip, BsdLandingPage, BsdToolboxPanel, CONCEPT_CONFIG, CONCEPT_DEFAULT_QUICK_ACTIONS, ConceptDesignLandingPage, DarkModeSelector, DarkModeSubMenu, DataExplorerActionBar, DataExplorerButton, DataExplorerCheckbox, DataExplorerCollectionFooter, DataExplorerDetailField, DataExplorerDetailSection, DataExplorerDetailShell, DataExplorerDisplayActionMenu, DataExplorerDisplayCard, DataExplorerDisplayCollectionView, DataExplorerDisplayListItem, DataExplorerDisplayMedia, DataExplorerImagePreview, DataExplorerPage, DataExplorerRecordCard, DataExplorerSelect, DataExplorerToolbarActions, DataExplorerToolbarShell, DataExplorerTree, DataExplorerTreeShell, DataExplorerView, DataExplorerViewCollection, DataExplorerViewItem, DataExplorerViewItemShell, DataExplorerViewShell, DataExplorerViewTree, DefaultLandingPage, DynamicComponent, I18nSelector, InteractiveTable, InteractiveTableEditableTextCell, InteractiveTableReadonlyCell, InteractiveTableSelectCell, LoginPage, MonkeysToastProvider, MonkeysToaster, NavButton, NavigationLayout, MonkeysToastProvider as ToastProvider, MonkeysToaster as Toaster, UserAccountMenu, WorkbenchContentPane, WorkbenchContentToolbar, WorkbenchDetailSidebar, WorkbenchGalleryCard, WorkbenchGallerySettingsButton, WorkbenchGallerySettingsPanel, WorkbenchGalleryView, WorkbenchLaneView, WorkbenchMasonryLayout, WorkbenchResizableSidebar, WorkbenchTableView, applyMonkeysTheme, calculateHue, calculateLightness, calculateSaturation, clearRegistry, cn3 as cn, createSolidColorScale, extractToastMessage, genTailwindTheme, getBaseBadgeToneClassName, getBaseButtonToneClassName, getBaseMenuItemToneClassName, getBaseNoticeToneClassName, getDataExplorerActionToneClassName, getDataExplorerMenuItemToneClassName, getRegisteredComponents, getRegisteredThemes, getThemeConfig, hasCustomComponent, markDarkColor, registerComponent, registerTheme, resolveBaseAppearance, resolveComponent, resolveDataExplorerAppearance, resolveMonkeysTheme, resolveToastVariantForMessage, setNeocardTheme, setTailwindTheme, toast, useDarkMode, useToastFeed, useToastOnValue };
25274
26244
  //# sourceMappingURL=index.mjs.map
25275
26245
  //# sourceMappingURL=index.mjs.map