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

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.js CHANGED
@@ -3,7 +3,7 @@
3
3
  var React = require('react');
4
4
  var jsxRuntime = require('react/jsx-runtime');
5
5
  var ContextMenu = require('@radix-ui/react-context-menu');
6
- var DropdownMenu3 = require('@radix-ui/react-dropdown-menu');
6
+ var DropdownMenu5 = require('@radix-ui/react-dropdown-menu');
7
7
  var core = require('@dnd-kit/core');
8
8
  require('@dnd-kit/sortable');
9
9
  require('@dnd-kit/utilities');
@@ -33,7 +33,7 @@ function _interopNamespace(e) {
33
33
 
34
34
  var React__default = /*#__PURE__*/_interopDefault(React);
35
35
  var ContextMenu__namespace = /*#__PURE__*/_interopNamespace(ContextMenu);
36
- var DropdownMenu3__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu3);
36
+ var DropdownMenu5__namespace = /*#__PURE__*/_interopNamespace(DropdownMenu5);
37
37
  var Tooltip__namespace = /*#__PURE__*/_interopNamespace(Tooltip);
38
38
 
39
39
  var __create = Object.create;
@@ -1278,7 +1278,7 @@ var require_lodash = __commonJS({
1278
1278
  if (typeof func != "function") {
1279
1279
  throw new TypeError2(FUNC_ERROR_TEXT);
1280
1280
  }
1281
- return setTimeout(function() {
1281
+ return setTimeout2(function() {
1282
1282
  func.apply(undefined2, args);
1283
1283
  }, wait);
1284
1284
  }
@@ -2078,7 +2078,7 @@ var require_lodash = __commonJS({
2078
2078
  end = end === undefined2 ? length : end;
2079
2079
  return !start && end >= length ? array : baseSlice(array, start, end);
2080
2080
  }
2081
- var clearTimeout = ctxClearTimeout || function(id) {
2081
+ var clearTimeout2 = ctxClearTimeout || function(id) {
2082
2082
  return root.clearTimeout(id);
2083
2083
  };
2084
2084
  function cloneBuffer(buffer, isDeep) {
@@ -3129,7 +3129,7 @@ var require_lodash = __commonJS({
3129
3129
  return object[key];
3130
3130
  }
3131
3131
  var setData = shortOut(baseSetData);
3132
- var setTimeout = ctxSetTimeout || function(func, wait) {
3132
+ var setTimeout2 = ctxSetTimeout || function(func, wait) {
3133
3133
  return root.setTimeout(func, wait);
3134
3134
  };
3135
3135
  var setToString = shortOut(baseSetToString);
@@ -3921,7 +3921,7 @@ var require_lodash = __commonJS({
3921
3921
  }
3922
3922
  function leadingEdge(time) {
3923
3923
  lastInvokeTime = time;
3924
- timerId = setTimeout(timerExpired, wait);
3924
+ timerId = setTimeout2(timerExpired, wait);
3925
3925
  return leading ? invokeFunc(time) : result2;
3926
3926
  }
3927
3927
  function remainingWait(time) {
@@ -3937,7 +3937,7 @@ var require_lodash = __commonJS({
3937
3937
  if (shouldInvoke(time)) {
3938
3938
  return trailingEdge(time);
3939
3939
  }
3940
- timerId = setTimeout(timerExpired, remainingWait(time));
3940
+ timerId = setTimeout2(timerExpired, remainingWait(time));
3941
3941
  }
3942
3942
  function trailingEdge(time) {
3943
3943
  timerId = undefined2;
@@ -3949,7 +3949,7 @@ var require_lodash = __commonJS({
3949
3949
  }
3950
3950
  function cancel() {
3951
3951
  if (timerId !== undefined2) {
3952
- clearTimeout(timerId);
3952
+ clearTimeout2(timerId);
3953
3953
  }
3954
3954
  lastInvokeTime = 0;
3955
3955
  lastArgs = lastCallTime = lastThis = timerId = undefined2;
@@ -3967,13 +3967,13 @@ var require_lodash = __commonJS({
3967
3967
  return leadingEdge(lastCallTime);
3968
3968
  }
3969
3969
  if (maxing) {
3970
- clearTimeout(timerId);
3971
- timerId = setTimeout(timerExpired, wait);
3970
+ clearTimeout2(timerId);
3971
+ timerId = setTimeout2(timerExpired, wait);
3972
3972
  return invokeFunc(lastCallTime);
3973
3973
  }
3974
3974
  }
3975
3975
  if (timerId === undefined2) {
3976
- timerId = setTimeout(timerExpired, wait);
3976
+ timerId = setTimeout2(timerExpired, wait);
3977
3977
  }
3978
3978
  return result2;
3979
3979
  }
@@ -14796,8 +14796,8 @@ function DataExplorerSelect({
14796
14796
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
14797
14797
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-muted-foreground", children: selected?.label ?? placeholder })
14798
14798
  ] }) : selected?.label ?? label ?? placeholder;
14799
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Root, { children: [
14800
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
14799
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { children: [
14800
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
14801
14801
  "button",
14802
14802
  {
14803
14803
  type: "button",
@@ -14825,8 +14825,8 @@ function DataExplorerSelect({
14825
14825
  ]
14826
14826
  }
14827
14827
  ) }),
14828
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
14829
- DropdownMenu3__namespace.Content,
14828
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
14829
+ DropdownMenu5__namespace.Content,
14830
14830
  {
14831
14831
  align,
14832
14832
  sideOffset,
@@ -14834,7 +14834,7 @@ function DataExplorerSelect({
14834
14834
  style: theme.styles.menuContent,
14835
14835
  onClick: (event) => event.stopPropagation(),
14836
14836
  children: /* @__PURE__ */ jsxRuntime.jsx(
14837
- DropdownMenu3__namespace.RadioGroup,
14837
+ DropdownMenu5__namespace.RadioGroup,
14838
14838
  {
14839
14839
  value,
14840
14840
  onValueChange: (nextValue) => {
@@ -14842,7 +14842,7 @@ function DataExplorerSelect({
14842
14842
  void onValueChange?.(nextValue);
14843
14843
  },
14844
14844
  children: options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
14845
- DropdownMenu3__namespace.RadioItem,
14845
+ DropdownMenu5__namespace.RadioItem,
14846
14846
  {
14847
14847
  value: option.value,
14848
14848
  title: option.title,
@@ -14888,9 +14888,9 @@ function renderMenuItem(action, context, theme, className) {
14888
14888
  const disabled = (resolveDataExplorerValue(action.disabled, context) ?? false) || (resolveDataExplorerValue(action.loading, context) ?? false);
14889
14889
  const active = resolveDataExplorerValue(action.active, context) ?? false;
14890
14890
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
14891
- action.separatorBefore ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Separator, { className: theme.slots.menuSeparator }) : null,
14891
+ action.separatorBefore ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Separator, { className: theme.slots.menuSeparator }) : null,
14892
14892
  /* @__PURE__ */ jsxRuntime.jsxs(
14893
- DropdownMenu3__namespace.Item,
14893
+ DropdownMenu5__namespace.Item,
14894
14894
  {
14895
14895
  title: action.title,
14896
14896
  disabled,
@@ -14911,7 +14911,7 @@ function renderMenuItem(action, context, theme, className) {
14911
14911
  ]
14912
14912
  }
14913
14913
  ),
14914
- action.separatorAfter ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Separator, { className: theme.slots.menuSeparator }) : null
14914
+ action.separatorAfter ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Separator, { className: theme.slots.menuSeparator }) : null
14915
14915
  ] }, action.id);
14916
14916
  }
14917
14917
  function renderMenuAction(action, context, theme, classNames, appearance) {
@@ -14920,8 +14920,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
14920
14920
  const visibleItems = (action.items ?? []).filter(
14921
14921
  (item) => resolveDataExplorerValue(item.visible, context) ?? true
14922
14922
  );
14923
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Root, { children: [
14924
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
14923
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { children: [
14924
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
14925
14925
  DataExplorerButton,
14926
14926
  {
14927
14927
  title: action.title,
@@ -14937,8 +14937,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
14937
14937
  className: classNames?.action
14938
14938
  }
14939
14939
  ) }),
14940
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
14941
- DropdownMenu3__namespace.Content,
14940
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
14941
+ DropdownMenu5__namespace.Content,
14942
14942
  {
14943
14943
  align: action.align ?? "end",
14944
14944
  sideOffset: action.sideOffset ?? 6,
@@ -14947,8 +14947,8 @@ function renderMenuAction(action, context, theme, classNames, appearance) {
14947
14947
  onClick: (event) => event.stopPropagation(),
14948
14948
  children: [
14949
14949
  action.menuLabel ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
14950
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Label, { className: theme.slots.menuLabel, children: action.menuLabel }),
14951
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Separator, { className: theme.slots.menuSeparator })
14950
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Label, { className: theme.slots.menuLabel, children: action.menuLabel }),
14951
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Separator, { className: theme.slots.menuSeparator })
14952
14952
  ] }) : null,
14953
14953
  visibleItems.map(
14954
14954
  (item) => renderMenuItem(item, context, theme, classNames?.menuItem)
@@ -15771,8 +15771,8 @@ function DataExplorerDisplayActionMenu({
15771
15771
  if (visibleActions.length === 0) {
15772
15772
  return null;
15773
15773
  }
15774
- return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn2("inline-flex", classNames?.root), children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Root, { open, onOpenChange: setOpen, children: [
15775
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
15774
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn2("inline-flex", classNames?.root), children: /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { open, onOpenChange: setOpen, children: [
15775
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
15776
15776
  "button",
15777
15777
  {
15778
15778
  type: "button",
@@ -15789,8 +15789,8 @@ function DataExplorerDisplayActionMenu({
15789
15789
  ]
15790
15790
  }
15791
15791
  ) }),
15792
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
15793
- DropdownMenu3__namespace.Content,
15792
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
15793
+ DropdownMenu5__namespace.Content,
15794
15794
  {
15795
15795
  align,
15796
15796
  sideOffset,
@@ -15803,7 +15803,7 @@ function DataExplorerDisplayActionMenu({
15803
15803
  children: [
15804
15804
  label ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
15805
15805
  /* @__PURE__ */ jsxRuntime.jsx(
15806
- DropdownMenu3__namespace.Label,
15806
+ DropdownMenu5__namespace.Label,
15807
15807
  {
15808
15808
  className: cn2(
15809
15809
  theme.slots.menuLabel,
@@ -15813,7 +15813,7 @@ function DataExplorerDisplayActionMenu({
15813
15813
  }
15814
15814
  ),
15815
15815
  /* @__PURE__ */ jsxRuntime.jsx(
15816
- DropdownMenu3__namespace.Separator,
15816
+ DropdownMenu5__namespace.Separator,
15817
15817
  {
15818
15818
  className: cn2(
15819
15819
  theme.slots.menuSeparator,
@@ -15827,7 +15827,7 @@ function DataExplorerDisplayActionMenu({
15827
15827
  if (action.render) {
15828
15828
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
15829
15829
  action.separatorBefore ? /* @__PURE__ */ jsxRuntime.jsx(
15830
- DropdownMenu3__namespace.Separator,
15830
+ DropdownMenu5__namespace.Separator,
15831
15831
  {
15832
15832
  className: cn2(
15833
15833
  theme.slots.menuSeparator,
@@ -15837,7 +15837,7 @@ function DataExplorerDisplayActionMenu({
15837
15837
  ) : null,
15838
15838
  action.render(context),
15839
15839
  action.separatorAfter ? /* @__PURE__ */ jsxRuntime.jsx(
15840
- DropdownMenu3__namespace.Separator,
15840
+ DropdownMenu5__namespace.Separator,
15841
15841
  {
15842
15842
  className: cn2(
15843
15843
  theme.slots.menuSeparator,
@@ -15849,7 +15849,7 @@ function DataExplorerDisplayActionMenu({
15849
15849
  }
15850
15850
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
15851
15851
  action.separatorBefore ? /* @__PURE__ */ jsxRuntime.jsx(
15852
- DropdownMenu3__namespace.Separator,
15852
+ DropdownMenu5__namespace.Separator,
15853
15853
  {
15854
15854
  className: cn2(
15855
15855
  "-mx-1 my-1 h-px bg-border",
@@ -15858,7 +15858,7 @@ function DataExplorerDisplayActionMenu({
15858
15858
  }
15859
15859
  ) : null,
15860
15860
  /* @__PURE__ */ jsxRuntime.jsxs(
15861
- DropdownMenu3__namespace.Item,
15861
+ DropdownMenu5__namespace.Item,
15862
15862
  {
15863
15863
  title: action.title,
15864
15864
  disabled,
@@ -15909,7 +15909,7 @@ function DataExplorerDisplayActionMenu({
15909
15909
  }
15910
15910
  ),
15911
15911
  action.separatorAfter ? /* @__PURE__ */ jsxRuntime.jsx(
15912
- DropdownMenu3__namespace.Separator,
15912
+ DropdownMenu5__namespace.Separator,
15913
15913
  {
15914
15914
  className: cn2(
15915
15915
  theme.slots.menuSeparator,
@@ -17983,8 +17983,8 @@ function DataExplorerViewTree({
17983
17983
  return resolveDataExplorerValue(action.visible, payload) ?? true;
17984
17984
  });
17985
17985
  if (visibleActions.length === 0) return null;
17986
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Root, { children: [
17987
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
17986
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { children: [
17987
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
17988
17988
  "button",
17989
17989
  {
17990
17990
  type: "button",
@@ -17999,8 +17999,8 @@ function DataExplorerViewTree({
17999
17999
  children: /* @__PURE__ */ jsxRuntime.jsx(MoreIcon2, {})
18000
18000
  }
18001
18001
  ) }),
18002
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
18003
- DropdownMenu3__namespace.Content,
18002
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
18003
+ DropdownMenu5__namespace.Content,
18004
18004
  {
18005
18005
  align: "end",
18006
18006
  sideOffset: 6,
@@ -18015,9 +18015,9 @@ function DataExplorerViewTree({
18015
18015
  return /* @__PURE__ */ jsxRuntime.jsx("div", { children: action.render(payload) }, action.id);
18016
18016
  }
18017
18017
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
18018
- action.separatorBefore ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Separator, { className: theme.slots.menuSeparator }) : null,
18018
+ action.separatorBefore ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Separator, { className: theme.slots.menuSeparator }) : null,
18019
18019
  /* @__PURE__ */ jsxRuntime.jsxs(
18020
- DropdownMenu3__namespace.Item,
18020
+ DropdownMenu5__namespace.Item,
18021
18021
  {
18022
18022
  title: action.title,
18023
18023
  disabled,
@@ -18039,7 +18039,7 @@ function DataExplorerViewTree({
18039
18039
  ]
18040
18040
  }
18041
18041
  ),
18042
- action.separatorAfter ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Separator, { className: theme.slots.menuSeparator }) : null
18042
+ action.separatorAfter ? /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Separator, { className: theme.slots.menuSeparator }) : null
18043
18043
  ] }, action.id);
18044
18044
  })
18045
18045
  }
@@ -20823,6 +20823,277 @@ function LoginPage({
20823
20823
  }
20824
20824
  );
20825
20825
  }
20826
+ var defaultAppearance = {
20827
+ preset: "admin",
20828
+ density: "compact",
20829
+ radius: "lg",
20830
+ border: "subtle",
20831
+ background: "soft"
20832
+ };
20833
+ var radiusClassNames = {
20834
+ default: "rounded-md",
20835
+ none: "rounded-none",
20836
+ sm: "rounded-sm",
20837
+ md: "rounded-md",
20838
+ lg: "rounded-lg",
20839
+ xl: "rounded-xl",
20840
+ full: "rounded-full"
20841
+ };
20842
+ function CheckIcon4() {
20843
+ return /* @__PURE__ */ jsxRuntime.jsx(
20844
+ "svg",
20845
+ {
20846
+ "aria-hidden": "true",
20847
+ className: "h-3 w-3",
20848
+ viewBox: "0 0 24 24",
20849
+ fill: "none",
20850
+ stroke: "currentColor",
20851
+ strokeWidth: "2.25",
20852
+ strokeLinecap: "round",
20853
+ strokeLinejoin: "round",
20854
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" })
20855
+ }
20856
+ );
20857
+ }
20858
+ function MoreIcon3() {
20859
+ return /* @__PURE__ */ jsxRuntime.jsxs(
20860
+ "svg",
20861
+ {
20862
+ "aria-hidden": "true",
20863
+ className: "h-4 w-4",
20864
+ viewBox: "0 0 24 24",
20865
+ fill: "none",
20866
+ stroke: "currentColor",
20867
+ strokeWidth: "2",
20868
+ strokeLinecap: "round",
20869
+ strokeLinejoin: "round",
20870
+ children: [
20871
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "12", cy: "12", r: "1" }),
20872
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "19", cy: "12", r: "1" }),
20873
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "5", cy: "12", r: "1" })
20874
+ ]
20875
+ }
20876
+ );
20877
+ }
20878
+ function getInitials2(name) {
20879
+ if (!name) return "U";
20880
+ const words = name.trim().split(/\s+/).filter(Boolean);
20881
+ if (!words.length) return "U";
20882
+ if (words.length === 1) return words[0].slice(0, 2).toUpperCase();
20883
+ return words.slice(0, 2).map((word) => word[0]).join("").toUpperCase();
20884
+ }
20885
+ function renderIcon(icon, className) {
20886
+ if (!icon) return null;
20887
+ return /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("inline-flex h-4 w-4 shrink-0 items-center justify-center", className), children: icon });
20888
+ }
20889
+ function getCurrentOptionLabel(selector) {
20890
+ return selector.options.find((option) => option.value === selector.value)?.label ?? selector.value;
20891
+ }
20892
+ function UserAccountMenuSelector({
20893
+ classNames,
20894
+ menuRadius,
20895
+ selector
20896
+ }) {
20897
+ if (selector.visible === false || selector.options.length === 0) return null;
20898
+ const radiusClass = radiusClassNames[menuRadius];
20899
+ const currentLabel = getCurrentOptionLabel(selector);
20900
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Sub, { children: [
20901
+ /* @__PURE__ */ jsxRuntime.jsxs(
20902
+ DropdownMenu5__namespace.SubTrigger,
20903
+ {
20904
+ disabled: selector.disabled,
20905
+ className: cn(
20906
+ "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",
20907
+ radiusClass,
20908
+ classNames?.subTrigger
20909
+ ),
20910
+ children: [
20911
+ renderIcon(selector.icon),
20912
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: selector.label }),
20913
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto min-w-0 max-w-[7rem] truncate text-xs text-[hsl(var(--muted-foreground))]", children: currentLabel })
20914
+ ]
20915
+ }
20916
+ ),
20917
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
20918
+ DropdownMenu5__namespace.SubContent,
20919
+ {
20920
+ sideOffset: 8,
20921
+ className: cn(
20922
+ "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",
20923
+ radiusClass,
20924
+ selector.contentWidthClassName,
20925
+ classNames?.subContent
20926
+ ),
20927
+ children: /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.RadioGroup, { value: selector.value, onValueChange: selector.onChange, children: selector.options.map((option) => /* @__PURE__ */ jsxRuntime.jsxs(
20928
+ DropdownMenu5__namespace.RadioItem,
20929
+ {
20930
+ value: option.value,
20931
+ disabled: option.disabled,
20932
+ className: cn(
20933
+ "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",
20934
+ radiusClass,
20935
+ classNames?.item
20936
+ ),
20937
+ children: [
20938
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.ItemIndicator, { className: "absolute left-2 inline-flex h-4 w-4 items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(CheckIcon4, {}) }),
20939
+ renderIcon(option.icon, classNames?.itemIcon),
20940
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: option.label })
20941
+ ]
20942
+ },
20943
+ option.value
20944
+ )) })
20945
+ }
20946
+ ) })
20947
+ ] });
20948
+ }
20949
+ function UserAccountMenu({
20950
+ align = "end",
20951
+ appearance = defaultAppearance,
20952
+ ariaLabel,
20953
+ className,
20954
+ classNames,
20955
+ contentWidthClassName = "w-56",
20956
+ fallbackName = "User",
20957
+ items = [],
20958
+ menuRadius = "default",
20959
+ selectors = [],
20960
+ side = "bottom",
20961
+ sideOffset = 8,
20962
+ triggerEndIcon,
20963
+ triggerTitle,
20964
+ triggerVariant = "avatar",
20965
+ user
20966
+ }) {
20967
+ const displayName = user.name?.trim() || fallbackName;
20968
+ const initials = user.initials ?? getInitials2(displayName);
20969
+ const radiusClass = radiusClassNames[menuRadius];
20970
+ const visibleSelectors = selectors.filter(
20971
+ (selector) => selector.visible !== false && selector.options.length > 0
20972
+ );
20973
+ const visibleItems = items.filter((item) => item.visible !== false);
20974
+ const hasMenuBody = visibleSelectors.length > 0 || visibleItems.length > 0;
20975
+ const avatar = /* @__PURE__ */ jsxRuntime.jsx(
20976
+ BaseAvatar,
20977
+ {
20978
+ appearance,
20979
+ alt: user.avatarAlt ?? displayName,
20980
+ className: cn("h-8 w-8", classNames?.avatar),
20981
+ initials,
20982
+ name: displayName,
20983
+ size: "sm",
20984
+ src: user.avatarUrl
20985
+ }
20986
+ );
20987
+ const isProfileTrigger = triggerVariant === "profile";
20988
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { children: [
20989
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
20990
+ BaseButton,
20991
+ {
20992
+ appearance,
20993
+ ariaLabel: ariaLabel ?? displayName,
20994
+ className: cn(
20995
+ 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",
20996
+ className,
20997
+ classNames?.root,
20998
+ classNames?.trigger
20999
+ ),
21000
+ classNames: {
21001
+ icon: "h-8 w-8",
21002
+ label: isProfileTrigger ? "min-w-0 flex-1 text-left" : void 0
21003
+ },
21004
+ endIcon: isProfileTrigger ? triggerEndIcon ?? /* @__PURE__ */ jsxRuntime.jsx(MoreIcon3, {}) : void 0,
21005
+ icon: avatar,
21006
+ iconOnly: !isProfileTrigger,
21007
+ label: isProfileTrigger ? /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex min-w-0 flex-col items-start", children: [
21008
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "max-w-full truncate text-sm font-medium leading-none text-[hsl(var(--foreground))]", children: displayName }),
21009
+ user.secondaryText ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1 max-w-full truncate text-xs leading-none text-[hsl(var(--muted-foreground))]", children: user.secondaryText }) : null
21010
+ ] }) : void 0,
21011
+ title: triggerTitle ?? displayName,
21012
+ tone: "muted"
21013
+ }
21014
+ ) }),
21015
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
21016
+ DropdownMenu5__namespace.Content,
21017
+ {
21018
+ align,
21019
+ side,
21020
+ sideOffset,
21021
+ className: cn(
21022
+ "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",
21023
+ contentWidthClassName,
21024
+ radiusClass,
21025
+ classNames?.content
21026
+ ),
21027
+ children: [
21028
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Label, { className: cn("px-2 py-1.5 font-normal", classNames?.label), children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [
21029
+ avatar,
21030
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 flex-col", children: [
21031
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: cn("truncate text-sm font-medium leading-none", classNames?.userName), children: displayName }),
21032
+ user.secondaryText ? /* @__PURE__ */ jsxRuntime.jsx(
21033
+ "span",
21034
+ {
21035
+ className: cn(
21036
+ "truncate pt-1 text-xs leading-none text-[hsl(var(--muted-foreground))]",
21037
+ classNames?.secondaryText
21038
+ ),
21039
+ children: user.secondaryText
21040
+ }
21041
+ ) : null
21042
+ ] })
21043
+ ] }) }),
21044
+ hasMenuBody ? /* @__PURE__ */ jsxRuntime.jsx(
21045
+ DropdownMenu5__namespace.Separator,
21046
+ {
21047
+ className: cn("my-1 h-px bg-[hsl(var(--border))]", classNames?.separator)
21048
+ }
21049
+ ) : null,
21050
+ visibleSelectors.map((selector, index) => /* @__PURE__ */ jsxRuntime.jsx(
21051
+ UserAccountMenuSelector,
21052
+ {
21053
+ classNames,
21054
+ menuRadius,
21055
+ selector
21056
+ },
21057
+ selector.id ?? `selector-${index}`
21058
+ )),
21059
+ visibleSelectors.length > 0 && visibleItems.length > 0 ? /* @__PURE__ */ jsxRuntime.jsx(
21060
+ DropdownMenu5__namespace.Separator,
21061
+ {
21062
+ className: cn("my-1 h-px bg-[hsl(var(--border))]", classNames?.separator)
21063
+ }
21064
+ ) : null,
21065
+ visibleItems.map((item) => /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
21066
+ item.separatorBefore ? /* @__PURE__ */ jsxRuntime.jsx(
21067
+ DropdownMenu5__namespace.Separator,
21068
+ {
21069
+ className: cn("my-1 h-px bg-[hsl(var(--border))]", classNames?.separator)
21070
+ }
21071
+ ) : null,
21072
+ /* @__PURE__ */ jsxRuntime.jsxs(
21073
+ DropdownMenu5__namespace.Item,
21074
+ {
21075
+ disabled: item.disabled,
21076
+ onSelect: item.onSelect,
21077
+ className: cn(
21078
+ "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",
21079
+ radiusClass,
21080
+ item.tone === "danger" && "text-[hsl(var(--destructive))] hover:bg-[hsl(var(--accent))] hover:text-[hsl(var(--destructive))] focus:text-[hsl(var(--destructive))]",
21081
+ classNames?.item,
21082
+ item.tone === "danger" && classNames?.dangerItem
21083
+ ),
21084
+ children: [
21085
+ renderIcon(item.icon, classNames?.itemIcon),
21086
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 flex-1 truncate", children: item.label }),
21087
+ item.shortcut ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-3 shrink-0 text-xs text-[hsl(var(--muted-foreground))]", children: item.shortcut }) : null
21088
+ ]
21089
+ }
21090
+ )
21091
+ ] }, item.id))
21092
+ ]
21093
+ }
21094
+ ) })
21095
+ ] });
21096
+ }
20826
21097
  function cn3(...inputs) {
20827
21098
  return inputs.filter(Boolean).join(" ");
20828
21099
  }
@@ -20903,27 +21174,27 @@ function AppHeader({
20903
21174
  (!tabs || tabs.length === 0) && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex-1" }),
20904
21175
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex shrink-0 items-center gap-4", children: [
20905
21176
  extra,
20906
- user && /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Root, { children: [
20907
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx("img", { src: user.photo, alt: user.name, className: "h-8 w-8 rounded-full object-cover" }) : /* @__PURE__ */ jsxRuntime.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" }) }) }),
20908
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
20909
- DropdownMenu3__namespace.Content,
21177
+ user && /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { children: [
21178
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx("img", { src: user.photo, alt: user.name, className: "h-8 w-8 rounded-full object-cover" }) : /* @__PURE__ */ jsxRuntime.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" }) }) }),
21179
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
21180
+ DropdownMenu5__namespace.Content,
20910
21181
  {
20911
21182
  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",
20912
21183
  sideOffset: 5,
20913
21184
  align: "end",
20914
21185
  children: [
20915
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Label, { className: "flex items-center gap-2 px-2 py-1.5 font-normal", children: [
21186
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Label, { className: "flex items-center gap-2 px-2 py-1.5 font-normal", children: [
20916
21187
  user.photo ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: user.photo, alt: user.name, className: "h-8 w-8 rounded-full object-cover" }) : /* @__PURE__ */ jsxRuntime.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" }),
20917
21188
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col", children: [
20918
21189
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-medium leading-none", children: user.name }),
20919
21190
  user.email && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-[hsl(var(--muted-foreground))] leading-none mt-1", children: user.email })
20920
21191
  ] })
20921
21192
  ] }),
20922
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Separator, { className: "h-px bg-[hsl(var(--border))] my-1" }),
20923
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Group, { children: [
21193
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Separator, { className: "h-px bg-[hsl(var(--border))] my-1" }),
21194
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Group, { children: [
20924
21195
  userMenuItems,
20925
21196
  /* @__PURE__ */ jsxRuntime.jsxs(
20926
- DropdownMenu3__namespace.Item,
21197
+ DropdownMenu5__namespace.Item,
20927
21198
  {
20928
21199
  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))]",
20929
21200
  onSelect: () => onLogout?.(),
@@ -21099,9 +21370,9 @@ function AppLayout({ header, sidebar, children, flush = false, className }) {
21099
21370
  "flex h-screen flex-col gap-[var(--global-spacing,0.75rem)] overflow-hidden p-[var(--global-spacing,0.75rem)]",
21100
21371
  className
21101
21372
  ), style: { backgroundColor: "hsl(var(--muted))" }, children: [
21102
- header,
21373
+ header ? header : null,
21103
21374
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-1 gap-[var(--global-spacing,0.75rem)] overflow-hidden min-h-0", children: [
21104
- sidebar,
21375
+ sidebar ? sidebar : null,
21105
21376
  /* @__PURE__ */ jsxRuntime.jsx("main", { className: cn3(
21106
21377
  "flex-1 min-h-0 overflow-hidden rounded-xl border border-[hsl(var(--input))] bg-[hsl(var(--background))]",
21107
21378
  !flush && "overflow-y-auto"
@@ -21109,6 +21380,717 @@ function AppLayout({ header, sidebar, children, flush = false, className }) {
21109
21380
  ] })
21110
21381
  ] });
21111
21382
  }
21383
+ var NAVIGATION_LAYOUT_SIDEBAR_EXPANDED_WIDTH = "13.7rem";
21384
+ var NAVIGATION_LAYOUT_SIDEBAR_COLLAPSED_WIDTH = "4.25rem";
21385
+ var NAVIGATION_LAYOUT_TRANSITION_TIMING = "cubic-bezier(0.22, 1, 0.36, 1)";
21386
+ var NAVIGATION_LAYOUT_HEADBAR_DEFAULT_HEIGHT_PX = 72;
21387
+ var NAVIGATION_LAYOUT_HEADBAR_MIN_HEIGHT_PX = 56;
21388
+ var NAVIGATION_LAYOUT_HEADBAR_MAX_HEIGHT_PX = 120;
21389
+ var NAVIGATION_LAYOUT_HEADBAR_COMPACT_HEIGHT_THRESHOLD_PX = 64;
21390
+ var NAVIGATION_LAYOUT_HEADBAR_BOXED_VERTICAL_PADDING_PX = 12;
21391
+ var NAVIGATION_LAYOUT_HEADBAR_COMPACT_VERTICAL_PADDING_PX = 8;
21392
+ var NAVIGATION_LAYOUT_HEADBAR_LOGO_DEFAULT_SIZE_PX = 44;
21393
+ var NAVIGATION_LAYOUT_HEADBAR_LOGO_COMPACT_SIZE_PX = 36;
21394
+ var NAVIGATION_LAYOUT_DEFAULT_APPEARANCE = {
21395
+ preset: "admin",
21396
+ density: "compact",
21397
+ radius: "lg",
21398
+ border: "subtle",
21399
+ background: "soft"
21400
+ };
21401
+ var NAVIGATION_LAYOUT_MENU_RADIUS_CLASS_MAP = {
21402
+ none: { all: "rounded-none", left: "!rounded-none", right: "!rounded-none" },
21403
+ sm: { all: "rounded-sm", left: "!rounded-l-sm !rounded-r-none", right: "!rounded-l-none !rounded-r-sm" },
21404
+ md: { all: "rounded-md", left: "!rounded-l-md !rounded-r-none", right: "!rounded-l-none !rounded-r-md" },
21405
+ lg: { all: "rounded-lg", left: "!rounded-l-lg !rounded-r-none", right: "!rounded-l-none !rounded-r-lg" },
21406
+ xl: { all: "rounded-xl", left: "!rounded-l-xl !rounded-r-none", right: "!rounded-l-none !rounded-r-xl" },
21407
+ full: { all: "rounded-full", left: "!rounded-l-full !rounded-r-none", right: "!rounded-l-none !rounded-r-full" }
21408
+ };
21409
+ function clampHeadbarHeight(value) {
21410
+ if (typeof value !== "number" || !Number.isFinite(value)) return NAVIGATION_LAYOUT_HEADBAR_DEFAULT_HEIGHT_PX;
21411
+ return Math.min(NAVIGATION_LAYOUT_HEADBAR_MAX_HEIGHT_PX, Math.max(NAVIGATION_LAYOUT_HEADBAR_MIN_HEIGHT_PX, Math.round(value)));
21412
+ }
21413
+ function getHeadbarVerticalPaddingPx(heightPx) {
21414
+ return heightPx <= NAVIGATION_LAYOUT_HEADBAR_COMPACT_HEIGHT_THRESHOLD_PX ? NAVIGATION_LAYOUT_HEADBAR_COMPACT_VERTICAL_PADDING_PX : NAVIGATION_LAYOUT_HEADBAR_BOXED_VERTICAL_PADDING_PX;
21415
+ }
21416
+ function getHeadbarLogoSizePx(heightPx) {
21417
+ return heightPx <= NAVIGATION_LAYOUT_HEADBAR_COMPACT_HEIGHT_THRESHOLD_PX ? NAVIGATION_LAYOUT_HEADBAR_LOGO_COMPACT_SIZE_PX : NAVIGATION_LAYOUT_HEADBAR_LOGO_DEFAULT_SIZE_PX;
21418
+ }
21419
+ function getHeadbarMenuRadiusClass(menuRadius = "default", part = "all") {
21420
+ if (menuRadius === "default") {
21421
+ if (part === "left") return "rounded-l-lg rounded-r-none";
21422
+ if (part === "right") return "rounded-l-none rounded-r-lg";
21423
+ return "rounded-lg";
21424
+ }
21425
+ return NAVIGATION_LAYOUT_MENU_RADIUS_CLASS_MAP[menuRadius][part];
21426
+ }
21427
+ function getHeadbarFrameClass(layoutMode = "boxed") {
21428
+ 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)]";
21429
+ }
21430
+ function getHeadbarFrameStyle(layoutMode = "boxed", heightPx) {
21431
+ const verticalPaddingPx = getHeadbarVerticalPaddingPx(heightPx);
21432
+ const style = {
21433
+ height: `${heightPx}px`,
21434
+ minHeight: `${heightPx}px`,
21435
+ paddingTop: `${verticalPaddingPx}px`,
21436
+ paddingBottom: `${verticalPaddingPx}px`
21437
+ };
21438
+ if (layoutMode === "full-bleed") {
21439
+ style.marginLeft = "calc(var(--global-spacing,0.75rem) * -1)";
21440
+ style.marginRight = "calc(var(--global-spacing,0.75rem) * -1)";
21441
+ style.marginTop = "calc(var(--global-spacing,0.75rem) * -1)";
21442
+ style.width = "calc(100% + (var(--global-spacing,0.75rem) * 2))";
21443
+ }
21444
+ return style;
21445
+ }
21446
+ function getHeadbarNavClass(navPosition = "center") {
21447
+ if (navPosition === "left") return "justify-start";
21448
+ if (navPosition === "right") return "justify-end";
21449
+ return "justify-center";
21450
+ }
21451
+ function findNavigationRootId(items, activeItemId) {
21452
+ for (const item of items) {
21453
+ if (item.id === activeItemId) return item.id;
21454
+ if (item.children?.some((child) => child.id === activeItemId)) return item.id;
21455
+ }
21456
+ return activeItemId;
21457
+ }
21458
+ function getNavigationActionTitle(action) {
21459
+ return action.title || (typeof action.label === "string" ? action.label : void 0);
21460
+ }
21461
+ function NavigationLayoutActionButtons({
21462
+ actions,
21463
+ compact
21464
+ }) {
21465
+ if (!actions.length) return null;
21466
+ if (compact) {
21467
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col items-center gap-2", children: actions.map((action) => {
21468
+ const title = getNavigationActionTitle(action);
21469
+ return /* @__PURE__ */ jsxRuntime.jsx(
21470
+ BaseTooltip,
21471
+ {
21472
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21473
+ content: action.label,
21474
+ placement: "right",
21475
+ children: /* @__PURE__ */ jsxRuntime.jsx(
21476
+ BaseButton,
21477
+ {
21478
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21479
+ tone: "muted",
21480
+ iconOnly: true,
21481
+ icon: action.icon,
21482
+ onClick: action.onClick,
21483
+ title,
21484
+ ariaLabel: title,
21485
+ className: cn3(
21486
+ "h-10 w-10 rounded-lg border-transparent text-[hsl(var(--muted-foreground))] shadow-none",
21487
+ "hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))] hover:text-[hsl(var(--foreground))]",
21488
+ "active:translate-y-0 active:scale-[0.96]"
21489
+ )
21490
+ }
21491
+ )
21492
+ },
21493
+ action.id
21494
+ );
21495
+ }) });
21496
+ }
21497
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col gap-2", children: actions.map((action) => /* @__PURE__ */ jsxRuntime.jsx(
21498
+ BaseButton,
21499
+ {
21500
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21501
+ tone: "muted",
21502
+ icon: action.icon,
21503
+ label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate", children: action.label }),
21504
+ onClick: action.onClick,
21505
+ title: getNavigationActionTitle(action),
21506
+ className: cn3(
21507
+ "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",
21508
+ "hover:-translate-y-0.5 hover:border-[hsl(var(--input))]/80 hover:bg-[hsl(var(--muted))]/70 hover:text-[hsl(var(--foreground))]",
21509
+ "active:translate-y-0 active:scale-[0.985]"
21510
+ )
21511
+ },
21512
+ action.id
21513
+ )) });
21514
+ }
21515
+ function SidebarNavigationList({
21516
+ activeItemId,
21517
+ items,
21518
+ onNavigate,
21519
+ revealRequest
21520
+ }) {
21521
+ const navRef = React.useRef(null);
21522
+ const [expandedByRoot, setExpandedByRoot] = React.useState({});
21523
+ const toggleRoot = (id) => {
21524
+ setExpandedByRoot((current) => ({
21525
+ ...current,
21526
+ [id]: !current[id]
21527
+ }));
21528
+ };
21529
+ React.useEffect(() => {
21530
+ if (!revealRequest) return;
21531
+ setExpandedByRoot((current) => ({
21532
+ ...current,
21533
+ [revealRequest.id]: true
21534
+ }));
21535
+ const frameId = window.requestAnimationFrame(() => {
21536
+ const targetElement = navRef.current?.querySelector(
21537
+ `[data-navigation-sidebar-root-id="${CSS.escape(revealRequest.id)}"]`
21538
+ );
21539
+ if (targetElement instanceof HTMLElement) {
21540
+ targetElement.scrollIntoView({ behavior: "auto", block: "nearest", inline: "nearest" });
21541
+ }
21542
+ });
21543
+ return () => window.cancelAnimationFrame(frameId);
21544
+ }, [revealRequest]);
21545
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "h-full flex-1 overflow-y-auto", style: { scrollbarWidth: "none", msOverflowStyle: "none" }, children: [
21546
+ /* @__PURE__ */ jsxRuntime.jsx("style", { children: `.monkeys-navigation-sidebar-nav::-webkit-scrollbar { display: none; }` }),
21547
+ /* @__PURE__ */ jsxRuntime.jsx(
21548
+ "div",
21549
+ {
21550
+ ref: navRef,
21551
+ className: "monkeys-navigation-sidebar-nav flex w-full flex-col gap-2 text-xs text-[hsl(var(--foreground))]",
21552
+ children: items.map((item) => {
21553
+ const isGroup = Boolean(item.children?.length);
21554
+ const isExpanded = Boolean(expandedByRoot[item.id]);
21555
+ const isActive = activeItemId === item.id;
21556
+ if (isGroup) {
21557
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-navigation-sidebar-root-id": item.id, children: [
21558
+ /* @__PURE__ */ jsxRuntime.jsx(
21559
+ NavButton,
21560
+ {
21561
+ icon: item.icon,
21562
+ onClick: () => toggleRoot(item.id),
21563
+ postfix: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-1 justify-end", children: /* @__PURE__ */ jsxRuntime.jsx(
21564
+ "svg",
21565
+ {
21566
+ xmlns: "http://www.w3.org/2000/svg",
21567
+ width: "16",
21568
+ height: "16",
21569
+ viewBox: "0 0 24 24",
21570
+ fill: "none",
21571
+ stroke: "currentColor",
21572
+ strokeWidth: "2",
21573
+ strokeLinecap: "round",
21574
+ strokeLinejoin: "round",
21575
+ className: "shrink-0 text-[hsl(var(--foreground))] transition-transform duration-200",
21576
+ style: { transform: isExpanded ? "rotate(90deg)" : "rotate(0deg)" },
21577
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m9 18 6-6-6-6" })
21578
+ }
21579
+ ) }),
21580
+ children: item.label
21581
+ }
21582
+ ),
21583
+ isExpanded ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-1 flex flex-col gap-1", children: item.children?.map((child) => /* @__PURE__ */ jsxRuntime.jsx(
21584
+ NavButton,
21585
+ {
21586
+ active: activeItemId === child.id,
21587
+ onClick: () => onNavigate?.(child.id),
21588
+ children: child.label
21589
+ },
21590
+ child.id
21591
+ )) }) : null
21592
+ ] }, item.id);
21593
+ }
21594
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { "data-navigation-sidebar-root-id": item.id, children: /* @__PURE__ */ jsxRuntime.jsx(NavButton, { active: isActive, icon: item.icon, onClick: () => onNavigate?.(item.id), children: item.label }) }, item.id);
21595
+ })
21596
+ }
21597
+ )
21598
+ ] });
21599
+ }
21600
+ function SidebarBrand({
21601
+ collapsed,
21602
+ logo,
21603
+ title
21604
+ }) {
21605
+ if (!logo) return null;
21606
+ const brandTitle = title ?? logo.title;
21607
+ const logoMark = /* @__PURE__ */ jsxRuntime.jsx(
21608
+ "div",
21609
+ {
21610
+ className: cn3(
21611
+ "flex h-9 w-9 shrink-0 items-center justify-center overflow-hidden rounded-lg",
21612
+ logo.url ? "bg-transparent" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"
21613
+ ),
21614
+ children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo.url, alt: logo.title, className: "h-full w-full object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-sm font-bold", children: logo.title.charAt(0) })
21615
+ }
21616
+ );
21617
+ if (collapsed) {
21618
+ return /* @__PURE__ */ jsxRuntime.jsx(
21619
+ BaseTooltip,
21620
+ {
21621
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21622
+ content: brandTitle,
21623
+ placement: "right",
21624
+ children: /* @__PURE__ */ jsxRuntime.jsx(
21625
+ BaseButton,
21626
+ {
21627
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21628
+ ariaLabel: typeof brandTitle === "string" ? brandTitle : logo.title,
21629
+ className: "h-10 w-10 rounded-lg border-transparent bg-transparent p-0 shadow-none hover:bg-[hsl(var(--muted))]/60",
21630
+ icon: logoMark,
21631
+ iconOnly: true,
21632
+ onClick: logo.onClick,
21633
+ title: typeof brandTitle === "string" ? brandTitle : logo.title,
21634
+ tone: "muted"
21635
+ }
21636
+ )
21637
+ }
21638
+ );
21639
+ }
21640
+ return /* @__PURE__ */ jsxRuntime.jsx(
21641
+ BaseButton,
21642
+ {
21643
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21644
+ ariaLabel: logo.title,
21645
+ className: "h-auto w-full justify-start gap-3 border-transparent bg-transparent p-0 text-left shadow-none hover:bg-transparent",
21646
+ classNames: { icon: "h-9 w-9" },
21647
+ icon: logoMark,
21648
+ label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate text-sm font-semibold text-[hsl(var(--foreground))]", children: brandTitle }),
21649
+ onClick: logo.onClick,
21650
+ title: typeof brandTitle === "string" ? brandTitle : logo.title,
21651
+ tone: "muted"
21652
+ }
21653
+ );
21654
+ }
21655
+ function Sidebar({
21656
+ accountMenu,
21657
+ activeItemId,
21658
+ actions = [],
21659
+ collapsed,
21660
+ collapsedAccountMenu,
21661
+ footer,
21662
+ header,
21663
+ items,
21664
+ logo,
21665
+ onCollapsedChange,
21666
+ onNavigate,
21667
+ onRevealRoot,
21668
+ revealRequest,
21669
+ title
21670
+ }) {
21671
+ if (collapsed) {
21672
+ const activeRootId = findNavigationRootId(items, activeItemId);
21673
+ return /* @__PURE__ */ jsxRuntime.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: [
21674
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-3 flex shrink-0 justify-center", children: header ?? /* @__PURE__ */ jsxRuntime.jsx(SidebarBrand, { collapsed: true, logo, title }) }),
21675
+ /* @__PURE__ */ jsxRuntime.jsx(
21676
+ "div",
21677
+ {
21678
+ className: "flex min-h-0 flex-1 flex-col items-center gap-2 overflow-y-auto pb-3",
21679
+ style: { scrollbarWidth: "none", msOverflowStyle: "none" },
21680
+ children: items.map((item) => {
21681
+ const isActive = activeRootId === item.id;
21682
+ return /* @__PURE__ */ jsxRuntime.jsx(
21683
+ BaseTooltip,
21684
+ {
21685
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21686
+ content: item.label,
21687
+ placement: "right",
21688
+ children: /* @__PURE__ */ jsxRuntime.jsx(
21689
+ BaseButton,
21690
+ {
21691
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21692
+ tone: "muted",
21693
+ active: isActive,
21694
+ iconOnly: true,
21695
+ icon: item.icon,
21696
+ onClick: () => {
21697
+ onRevealRoot?.(item.id);
21698
+ onCollapsedChange?.(false);
21699
+ if (item.children?.length) return;
21700
+ onNavigate?.(item.id);
21701
+ },
21702
+ title: typeof item.label === "string" ? item.label : void 0,
21703
+ ariaLabel: typeof item.label === "string" ? item.label : item.id,
21704
+ className: cn3(
21705
+ "h-10 w-10 rounded-lg border text-[hsl(var(--muted-foreground))] shadow-none",
21706
+ "hover:-translate-y-0.5 active:translate-y-0 active:scale-[0.96]",
21707
+ 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))]"
21708
+ )
21709
+ }
21710
+ )
21711
+ },
21712
+ item.id
21713
+ );
21714
+ })
21715
+ }
21716
+ ),
21717
+ /* @__PURE__ */ jsxRuntime.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: [
21718
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationLayoutActionButtons, { actions, compact: true }),
21719
+ collapsedAccountMenu ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 flex justify-center border-t border-[hsl(var(--input))] pt-2", children: collapsedAccountMenu }) : null
21720
+ ] })
21721
+ ] });
21722
+ }
21723
+ return /* @__PURE__ */ jsxRuntime.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: [
21724
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mb-4 shrink-0", children: header ?? /* @__PURE__ */ jsxRuntime.jsx(SidebarBrand, { logo, title }) }),
21725
+ /* @__PURE__ */ jsxRuntime.jsx(
21726
+ SidebarNavigationList,
21727
+ {
21728
+ activeItemId,
21729
+ items,
21730
+ onNavigate,
21731
+ revealRequest
21732
+ }
21733
+ ),
21734
+ /* @__PURE__ */ jsxRuntime.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: [
21735
+ /* @__PURE__ */ jsxRuntime.jsx(NavigationLayoutActionButtons, { actions, compact: false }),
21736
+ footer,
21737
+ accountMenu ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-2 border-t border-[hsl(var(--input))] pt-2", children: accountMenu }) : null
21738
+ ] })
21739
+ ] });
21740
+ }
21741
+ function HeadbarChevronIcon({ open }) {
21742
+ return /* @__PURE__ */ jsxRuntime.jsx(
21743
+ "svg",
21744
+ {
21745
+ "aria-hidden": "true",
21746
+ className: cn3("h-4 w-4 shrink-0 transition-transform duration-200", open && "rotate-180"),
21747
+ viewBox: "0 0 24 24",
21748
+ fill: "none",
21749
+ stroke: "currentColor",
21750
+ strokeWidth: "2",
21751
+ strokeLinecap: "round",
21752
+ strokeLinejoin: "round",
21753
+ children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m6 9 6 6 6-6" })
21754
+ }
21755
+ );
21756
+ }
21757
+ function HeadbarNavMenuItem({
21758
+ activeItemId,
21759
+ isActive,
21760
+ item,
21761
+ label,
21762
+ menuButtonRadiusClass,
21763
+ menuContentRadiusClass,
21764
+ menuItemRadiusClass,
21765
+ onNavigate
21766
+ }) {
21767
+ const [open, setOpen] = React.useState(false);
21768
+ const closeTimerRef = React.useRef(null);
21769
+ const clearCloseTimer = () => {
21770
+ if (!closeTimerRef.current) return;
21771
+ clearTimeout(closeTimerRef.current);
21772
+ closeTimerRef.current = null;
21773
+ };
21774
+ const openMenu = () => {
21775
+ clearCloseTimer();
21776
+ setOpen(true);
21777
+ };
21778
+ const scheduleCloseMenu = () => {
21779
+ clearCloseTimer();
21780
+ closeTimerRef.current = setTimeout(() => {
21781
+ setOpen(false);
21782
+ closeTimerRef.current = null;
21783
+ }, 120);
21784
+ };
21785
+ React.useEffect(() => clearCloseTimer, []);
21786
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { modal: false, open, onOpenChange: setOpen, children: [
21787
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
21788
+ BaseButton,
21789
+ {
21790
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21791
+ tone: "muted",
21792
+ active: isActive || open,
21793
+ icon: item.icon,
21794
+ endIcon: /* @__PURE__ */ jsxRuntime.jsx(HeadbarChevronIcon, { open }),
21795
+ label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: label }),
21796
+ onClick: () => setOpen(true),
21797
+ onMouseEnter: openMenu,
21798
+ onMouseLeave: scheduleCloseMenu,
21799
+ className: cn3(
21800
+ "h-9 max-w-[12rem] border-transparent !bg-transparent px-3 text-sm font-medium shadow-none",
21801
+ menuButtonRadiusClass,
21802
+ 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))]"
21803
+ )
21804
+ }
21805
+ ) }),
21806
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
21807
+ DropdownMenu5__namespace.Content,
21808
+ {
21809
+ align: "start",
21810
+ sideOffset: 5,
21811
+ onCloseAutoFocus: (event) => event.preventDefault(),
21812
+ onMouseEnter: openMenu,
21813
+ onMouseLeave: scheduleCloseMenu,
21814
+ className: cn3(
21815
+ "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",
21816
+ menuContentRadiusClass
21817
+ ),
21818
+ children: item.children?.map((child) => /* @__PURE__ */ jsxRuntime.jsxs(
21819
+ DropdownMenu5__namespace.Item,
21820
+ {
21821
+ className: cn3(
21822
+ "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))]",
21823
+ menuItemRadiusClass,
21824
+ child.id === activeItemId && "bg-[hsl(var(--muted))] text-[hsl(var(--foreground))]"
21825
+ ),
21826
+ onSelect: () => {
21827
+ setOpen(false);
21828
+ onNavigate?.(child.id);
21829
+ },
21830
+ children: [
21831
+ child.icon ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex h-4 w-4 shrink-0 items-center justify-center text-[hsl(var(--muted-foreground))]", children: child.icon }) : null,
21832
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: child.headbarLabel ?? child.label })
21833
+ ]
21834
+ },
21835
+ child.id
21836
+ ))
21837
+ }
21838
+ ) })
21839
+ ] });
21840
+ }
21841
+ function HeadbarNav({
21842
+ activeItemId,
21843
+ activeRootId,
21844
+ items,
21845
+ menuRadius,
21846
+ onNavigate
21847
+ }) {
21848
+ const menuButtonRadiusClass = getHeadbarMenuRadiusClass(menuRadius);
21849
+ const menuContentRadiusClass = getHeadbarMenuRadiusClass(menuRadius);
21850
+ const menuItemRadiusClass = getHeadbarMenuRadiusClass(menuRadius);
21851
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 items-center gap-1", children: items.map((item) => {
21852
+ const isActive = activeRootId === item.id || activeItemId === item.id;
21853
+ const label = item.headbarLabel ?? item.label;
21854
+ if (item.children?.length) {
21855
+ return /* @__PURE__ */ jsxRuntime.jsx(
21856
+ HeadbarNavMenuItem,
21857
+ {
21858
+ activeItemId,
21859
+ isActive,
21860
+ item,
21861
+ label,
21862
+ menuButtonRadiusClass,
21863
+ menuContentRadiusClass,
21864
+ menuItemRadiusClass,
21865
+ onNavigate
21866
+ },
21867
+ item.id
21868
+ );
21869
+ }
21870
+ return /* @__PURE__ */ jsxRuntime.jsx(
21871
+ BaseButton,
21872
+ {
21873
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21874
+ tone: "muted",
21875
+ active: isActive,
21876
+ icon: item.icon,
21877
+ label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: label }),
21878
+ onClick: () => onNavigate?.(item.id),
21879
+ className: cn3(
21880
+ "h-9 max-w-[12rem] border-transparent !bg-transparent px-3 text-sm font-medium shadow-none",
21881
+ menuButtonRadiusClass,
21882
+ 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))]"
21883
+ )
21884
+ },
21885
+ item.id
21886
+ );
21887
+ }) });
21888
+ }
21889
+ function Headbar({
21890
+ activeItemId,
21891
+ activeRootId,
21892
+ actions,
21893
+ accountMenu,
21894
+ extra,
21895
+ layout,
21896
+ logo,
21897
+ navItems,
21898
+ onNavigate
21899
+ }) {
21900
+ const heightPx = clampHeadbarHeight(layout?.heightPx);
21901
+ const layoutMode = layout?.layoutMode ?? "boxed";
21902
+ const menuRadius = layout?.menuRadius ?? "default";
21903
+ const logoHeightPx = getHeadbarLogoSizePx(heightPx);
21904
+ const frameStyle = getHeadbarFrameStyle(layoutMode, heightPx);
21905
+ const showBrandTitle = Boolean(layout?.brandTitle);
21906
+ return /* @__PURE__ */ jsxRuntime.jsxs("header", { className: getHeadbarFrameClass(layoutMode), style: frameStyle, children: [
21907
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex min-w-0 items-center justify-start", children: logo ? /* @__PURE__ */ jsxRuntime.jsx(
21908
+ BaseButton,
21909
+ {
21910
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
21911
+ tone: "muted",
21912
+ icon: /* @__PURE__ */ jsxRuntime.jsx(
21913
+ "div",
21914
+ {
21915
+ className: cn3(
21916
+ "flex items-center justify-center overflow-hidden rounded-lg",
21917
+ logo.url ? "w-auto max-w-[min(22rem,30vw)] bg-transparent" : "bg-[hsl(var(--primary))] text-[hsl(var(--primary-foreground))]"
21918
+ ),
21919
+ style: logo.url ? { height: logoHeightPx } : { width: logoHeightPx, height: logoHeightPx },
21920
+ children: logo.url ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logo.url, alt: logo.title, className: "block h-full w-auto object-contain" }) : /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-base font-bold", children: logo.title.charAt(0) })
21921
+ }
21922
+ ),
21923
+ label: showBrandTitle ? /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap text-base font-medium text-[hsl(var(--foreground))]", children: layout?.brandTitle }) : null,
21924
+ ariaLabel: logo.title,
21925
+ title: logo.title,
21926
+ className: "h-auto min-w-0 justify-start border-transparent bg-transparent p-0 shadow-none hover:bg-transparent",
21927
+ classNames: logo.url ? { icon: "!h-auto !w-auto shrink-0" } : void 0,
21928
+ onClick: logo.onClick
21929
+ }
21930
+ ) : null }),
21931
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: cn3("flex min-w-0 items-center", getHeadbarNavClass(layout?.navPosition)), children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "no-scrollbar flex max-w-full min-w-0 items-center overflow-x-auto overscroll-x-contain", children: /* @__PURE__ */ jsxRuntime.jsx(
21932
+ HeadbarNav,
21933
+ {
21934
+ activeItemId,
21935
+ activeRootId,
21936
+ items: navItems,
21937
+ menuRadius,
21938
+ onNavigate
21939
+ }
21940
+ ) }) }),
21941
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex min-w-0 items-center justify-end gap-3", children: [
21942
+ actions,
21943
+ extra,
21944
+ accountMenu
21945
+ ] })
21946
+ ] });
21947
+ }
21948
+ function NavigationLayout({
21949
+ activeItemId,
21950
+ activeRootId,
21951
+ allowModeSwitch = false,
21952
+ accountMenu,
21953
+ children,
21954
+ className,
21955
+ collapsedSidebarAccountMenu,
21956
+ collapsedSidebarWidth = NAVIGATION_LAYOUT_SIDEBAR_COLLAPSED_WIDTH,
21957
+ defaultMode = "headbar",
21958
+ defaultSidebarCollapsed = false,
21959
+ expandedSidebarWidth = NAVIGATION_LAYOUT_SIDEBAR_EXPANDED_WIDTH,
21960
+ expandSidebarLabel = "Expand sidebar",
21961
+ flush = false,
21962
+ headbarActions,
21963
+ headbarLayout,
21964
+ logo,
21965
+ mode,
21966
+ navItems,
21967
+ onModeChange,
21968
+ onNavigate,
21969
+ onSidebarCollapsedChange,
21970
+ renderHeadbarExtra,
21971
+ collapseSidebarLabel = "Collapse sidebar",
21972
+ sidebarCollapsed: controlledSidebarCollapsed,
21973
+ sidebarAccountMenu,
21974
+ sidebarFooter,
21975
+ sidebarHeader,
21976
+ switchToHeadbarLabel = "Switch to headbar",
21977
+ switchToSidebarLabel = "Switch to sidebar"
21978
+ }) {
21979
+ const [uncontrolledMode, setUncontrolledMode] = React.useState(defaultMode);
21980
+ const [uncontrolledSidebarCollapsed, setUncontrolledSidebarCollapsed] = React.useState(defaultSidebarCollapsed);
21981
+ const [revealRequest, setRevealRequest] = React.useState(null);
21982
+ const isModeControlled = mode !== void 0;
21983
+ const isSidebarCollapsedControlled = controlledSidebarCollapsed !== void 0;
21984
+ const navigationMode = isModeControlled ? mode : uncontrolledMode;
21985
+ const sidebarCollapsed = isSidebarCollapsedControlled ? controlledSidebarCollapsed : uncontrolledSidebarCollapsed;
21986
+ const isHeadbarMode = navigationMode === "headbar";
21987
+ const sidebarWidth = sidebarCollapsed ? collapsedSidebarWidth : expandedSidebarWidth;
21988
+ React.useEffect(() => {
21989
+ if (!isModeControlled) {
21990
+ setUncontrolledMode(defaultMode);
21991
+ }
21992
+ }, [defaultMode, isModeControlled]);
21993
+ React.useEffect(() => {
21994
+ if (!isSidebarCollapsedControlled) {
21995
+ setUncontrolledSidebarCollapsed(defaultSidebarCollapsed);
21996
+ }
21997
+ }, [defaultSidebarCollapsed, isSidebarCollapsedControlled]);
21998
+ const setNavigationMode = (nextMode) => {
21999
+ if (!isModeControlled) {
22000
+ setUncontrolledMode(nextMode);
22001
+ }
22002
+ onModeChange?.(nextMode);
22003
+ };
22004
+ const setCollapsed = (collapsed) => {
22005
+ if (!isSidebarCollapsedControlled) {
22006
+ setUncontrolledSidebarCollapsed(collapsed);
22007
+ }
22008
+ onSidebarCollapsedChange?.(collapsed);
22009
+ };
22010
+ const navigationActions = [];
22011
+ if (allowModeSwitch) {
22012
+ navigationActions.push({
22013
+ id: "toggle-headbar",
22014
+ label: switchToHeadbarLabel,
22015
+ onClick: () => setNavigationMode("headbar"),
22016
+ icon: /* @__PURE__ */ jsxRuntime.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: [
22017
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
22018
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M3 9h18" })
22019
+ ] })
22020
+ });
22021
+ }
22022
+ navigationActions.push({
22023
+ id: "toggle-sidebar",
22024
+ label: sidebarCollapsed ? expandSidebarLabel : collapseSidebarLabel,
22025
+ onClick: () => setCollapsed(!sidebarCollapsed),
22026
+ 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: [
22027
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
22028
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" }),
22029
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: sidebarCollapsed ? "m14 9 3 3-3 3" : "m16 15-3-3 3-3" })
22030
+ ] })
22031
+ });
22032
+ const sidebar = isHeadbarMode ? null : /* @__PURE__ */ jsxRuntime.jsx(
22033
+ "div",
22034
+ {
22035
+ className: "relative h-full min-h-0 shrink-0 overflow-hidden transition-[width] duration-260",
22036
+ style: { width: sidebarWidth, transitionTimingFunction: NAVIGATION_LAYOUT_TRANSITION_TIMING },
22037
+ children: /* @__PURE__ */ jsxRuntime.jsx(
22038
+ Sidebar,
22039
+ {
22040
+ accountMenu: sidebarAccountMenu ?? accountMenu,
22041
+ activeItemId,
22042
+ actions: navigationActions,
22043
+ collapsed: sidebarCollapsed,
22044
+ collapsedAccountMenu: collapsedSidebarAccountMenu ?? accountMenu,
22045
+ footer: sidebarFooter,
22046
+ header: sidebarHeader,
22047
+ items: navItems,
22048
+ logo,
22049
+ onCollapsedChange: setCollapsed,
22050
+ onNavigate,
22051
+ onRevealRoot: (rootId) => setRevealRequest((prev) => ({ id: rootId, nonce: (prev?.nonce ?? 0) + 1 })),
22052
+ revealRequest,
22053
+ title: headbarLayout?.brandTitle
22054
+ }
22055
+ )
22056
+ }
22057
+ );
22058
+ const header = isHeadbarMode ? /* @__PURE__ */ jsxRuntime.jsx(
22059
+ Headbar,
22060
+ {
22061
+ activeItemId,
22062
+ activeRootId: activeRootId ?? findNavigationRootId(navItems, activeItemId),
22063
+ actions: allowModeSwitch ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
22064
+ headbarActions,
22065
+ /* @__PURE__ */ jsxRuntime.jsx(
22066
+ BaseButton,
22067
+ {
22068
+ appearance: NAVIGATION_LAYOUT_DEFAULT_APPEARANCE,
22069
+ tone: "muted",
22070
+ icon: /* @__PURE__ */ jsxRuntime.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: [
22071
+ /* @__PURE__ */ jsxRuntime.jsx("rect", { width: "18", height: "18", x: "3", y: "3", rx: "2" }),
22072
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M9 3v18" }),
22073
+ /* @__PURE__ */ jsxRuntime.jsx("path", { d: "m14 9 3 3-3 3" })
22074
+ ] }),
22075
+ label: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate whitespace-nowrap", children: switchToSidebarLabel }),
22076
+ onClick: () => setNavigationMode("sidebar"),
22077
+ className: cn3(
22078
+ "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))]",
22079
+ getHeadbarMenuRadiusClass(headbarLayout?.menuRadius)
22080
+ )
22081
+ }
22082
+ )
22083
+ ] }) : headbarActions,
22084
+ accountMenu,
22085
+ extra: renderHeadbarExtra,
22086
+ layout: headbarLayout,
22087
+ logo,
22088
+ navItems,
22089
+ onNavigate
22090
+ }
22091
+ ) : null;
22092
+ return /* @__PURE__ */ jsxRuntime.jsx(AppLayout, { header, sidebar, flush, className, children });
22093
+ }
21112
22094
  function ClampIcon({ expanded }) {
21113
22095
  return /* @__PURE__ */ jsxRuntime.jsxs("svg", { "aria-hidden": "true", viewBox: "0 0 20 20", className: "h-4 w-4", fill: "none", children: [
21114
22096
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -25053,7 +26035,7 @@ function DarkModeSelector({
25053
26035
  { value: "light", label: resolvedLabels.light, Icon: SunIcon },
25054
26036
  { value: "dark", label: resolvedLabels.dark, Icon: MoonIcon }
25055
26037
  ];
25056
- const trigger = /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
26038
+ const trigger = /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
25057
26039
  "button",
25058
26040
  {
25059
26041
  className: cn5(
@@ -25066,7 +26048,7 @@ function DarkModeSelector({
25066
26048
  ]
25067
26049
  }
25068
26050
  ) });
25069
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Root, { children: [
26051
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { children: [
25070
26052
  tooltip ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Provider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip__namespace.Root, { children: [
25071
26053
  /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children: trigger }),
25072
26054
  /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -25081,14 +26063,14 @@ function DarkModeSelector({
25081
26063
  }
25082
26064
  ) })
25083
26065
  ] }) }) : trigger,
25084
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
25085
- DropdownMenu3__namespace.Content,
26066
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
26067
+ DropdownMenu5__namespace.Content,
25086
26068
  {
25087
26069
  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",
25088
26070
  sideOffset: 5,
25089
26071
  align: "end",
25090
26072
  children: options.map(({ value, label, Icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
25091
- DropdownMenu3__namespace.Item,
26073
+ DropdownMenu5__namespace.Item,
25092
26074
  {
25093
26075
  className: cn5(
25094
26076
  "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))]",
@@ -25136,19 +26118,19 @@ function DarkModeSubMenu({
25136
26118
  { value: "light", label: resolvedLabels.light, Icon: SunIcon },
25137
26119
  { value: "dark", label: resolvedLabels.dark, Icon: MoonIcon }
25138
26120
  ];
25139
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Sub, { children: [
25140
- /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.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: [
26121
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Sub, { children: [
26122
+ /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.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: [
25141
26123
  /* @__PURE__ */ jsxRuntime.jsx(SunMoonIcon, { className: "h-4 w-4" }),
25142
26124
  /* @__PURE__ */ jsxRuntime.jsx("span", { children: label }),
25143
26125
  /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-auto text-xs text-[hsl(var(--muted-foreground))]", children: currentLabel })
25144
26126
  ] }),
25145
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
25146
- DropdownMenu3__namespace.SubContent,
26127
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
26128
+ DropdownMenu5__namespace.SubContent,
25147
26129
  {
25148
26130
  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",
25149
26131
  sideOffset: 8,
25150
26132
  children: options.map(({ value, label: optLabel, Icon }) => /* @__PURE__ */ jsxRuntime.jsxs(
25151
- DropdownMenu3__namespace.CheckboxItem,
26133
+ DropdownMenu5__namespace.CheckboxItem,
25152
26134
  {
25153
26135
  checked: mode === value,
25154
26136
  disabled: mode === value,
@@ -25157,7 +26139,7 @@ function DarkModeSubMenu({
25157
26139
  ),
25158
26140
  onCheckedChange: () => onModeChange(value),
25159
26141
  children: [
25160
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.ItemIndicator, { className: "absolute left-2 inline-flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" }) }) }),
26142
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.ItemIndicator, { className: "absolute left-2 inline-flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.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__ */ jsxRuntime.jsx("path", { d: "M20 6 9 17l-5-5" }) }) }),
25161
26143
  /* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-4 w-4" }),
25162
26144
  optLabel
25163
26145
  ]
@@ -25185,7 +26167,7 @@ function I18nSelector({
25185
26167
  tooltip,
25186
26168
  className
25187
26169
  }) {
25188
- const trigger = /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
26170
+ const trigger = /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Trigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
25189
26171
  "button",
25190
26172
  {
25191
26173
  className: cn6(
@@ -25198,7 +26180,7 @@ function I18nSelector({
25198
26180
  ]
25199
26181
  }
25200
26182
  ) });
25201
- return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu3__namespace.Root, { children: [
26183
+ return /* @__PURE__ */ jsxRuntime.jsxs(DropdownMenu5__namespace.Root, { children: [
25202
26184
  tooltip ? /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Provider, { delayDuration: 300, children: /* @__PURE__ */ jsxRuntime.jsxs(Tooltip__namespace.Root, { children: [
25203
26185
  /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Trigger, { asChild: true, children: trigger }),
25204
26186
  /* @__PURE__ */ jsxRuntime.jsx(Tooltip__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsxs(
@@ -25213,14 +26195,14 @@ function I18nSelector({
25213
26195
  }
25214
26196
  ) })
25215
26197
  ] }) }) : trigger,
25216
- /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu3__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
25217
- DropdownMenu3__namespace.Content,
26198
+ /* @__PURE__ */ jsxRuntime.jsx(DropdownMenu5__namespace.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(
26199
+ DropdownMenu5__namespace.Content,
25218
26200
  {
25219
26201
  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",
25220
26202
  sideOffset: 5,
25221
26203
  align: "end",
25222
26204
  children: languages.map(({ code, label }) => /* @__PURE__ */ jsxRuntime.jsx(
25223
- DropdownMenu3__namespace.Item,
26205
+ DropdownMenu5__namespace.Item,
25224
26206
  {
25225
26207
  className: cn6(
25226
26208
  "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))]",
@@ -25406,8 +26388,10 @@ exports.LoginPage = LoginPage;
25406
26388
  exports.MonkeysToastProvider = MonkeysToastProvider;
25407
26389
  exports.MonkeysToaster = MonkeysToaster;
25408
26390
  exports.NavButton = NavButton;
26391
+ exports.NavigationLayout = NavigationLayout;
25409
26392
  exports.ToastProvider = MonkeysToastProvider;
25410
26393
  exports.Toaster = MonkeysToaster;
26394
+ exports.UserAccountMenu = UserAccountMenu;
25411
26395
  exports.WorkbenchContentPane = WorkbenchContentPane;
25412
26396
  exports.WorkbenchContentToolbar = WorkbenchContentToolbar;
25413
26397
  exports.WorkbenchDetailSidebar = WorkbenchDetailSidebar;