@lincyaw/aegis-ui 0.17.0 → 0.18.0

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.
Files changed (91) hide show
  1. package/dist/components/ui/AnchoredPopover.cjs +2 -0
  2. package/dist/components/ui/AnchoredPopover.cjs.map +1 -0
  3. package/dist/components/ui/AnchoredPopover.d.ts +35 -0
  4. package/dist/components/ui/AnchoredPopover.js +118 -0
  5. package/dist/components/ui/AnchoredPopover.js.map +1 -0
  6. package/dist/components/ui/Breadcrumb.cjs +1 -1
  7. package/dist/components/ui/Breadcrumb.cjs.map +1 -1
  8. package/dist/components/ui/Breadcrumb.d.ts +13 -1
  9. package/dist/components/ui/Breadcrumb.js +28 -19
  10. package/dist/components/ui/Breadcrumb.js.map +1 -1
  11. package/dist/components/ui/CodeBlock.cjs +2 -2
  12. package/dist/components/ui/CodeBlock.cjs.map +1 -1
  13. package/dist/components/ui/CodeBlock.d.ts +19 -1
  14. package/dist/components/ui/CodeBlock.js +86 -36
  15. package/dist/components/ui/CodeBlock.js.map +1 -1
  16. package/dist/components/ui/LineIcon.cjs +2 -0
  17. package/dist/components/ui/LineIcon.cjs.map +1 -0
  18. package/dist/components/ui/LineIcon.d.ts +15 -0
  19. package/dist/components/ui/LineIcon.js +33 -0
  20. package/dist/components/ui/LineIcon.js.map +1 -0
  21. package/dist/components/ui/PaneLayout.cjs +2 -0
  22. package/dist/components/ui/PaneLayout.cjs.map +1 -0
  23. package/dist/components/ui/PaneLayout.d.ts +33 -0
  24. package/dist/components/ui/PaneLayout.js +34 -0
  25. package/dist/components/ui/PaneLayout.js.map +1 -0
  26. package/dist/components/ui/Quote.cjs +2 -0
  27. package/dist/components/ui/Quote.cjs.map +1 -0
  28. package/dist/components/ui/Quote.d.ts +12 -0
  29. package/dist/components/ui/Quote.js +10 -0
  30. package/dist/components/ui/Quote.js.map +1 -0
  31. package/dist/components/ui/SectionDivider.cjs +1 -1
  32. package/dist/components/ui/SectionDivider.cjs.map +1 -1
  33. package/dist/components/ui/SectionDivider.d.ts +7 -1
  34. package/dist/components/ui/SectionDivider.js +9 -7
  35. package/dist/components/ui/SectionDivider.js.map +1 -1
  36. package/dist/components/ui/StatusDot.cjs.map +1 -1
  37. package/dist/components/ui/StatusDot.d.ts +3 -2
  38. package/dist/components/ui/StatusDot.js.map +1 -1
  39. package/dist/components/ui/Toolbar.cjs +1 -1
  40. package/dist/components/ui/Toolbar.cjs.map +1 -1
  41. package/dist/components/ui/Toolbar.d.ts +10 -1
  42. package/dist/components/ui/Toolbar.js +17 -7
  43. package/dist/components/ui/Toolbar.js.map +1 -1
  44. package/dist/components/ui/index.d.ts +9 -1
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.d.ts +1 -1
  47. package/dist/index.js +343 -332
  48. package/dist/index.js.map +1 -1
  49. package/dist/layouts/PageWrapper.cjs +1 -1
  50. package/dist/layouts/PageWrapper.cjs.map +1 -1
  51. package/dist/layouts/PageWrapper.d.ts +7 -1
  52. package/dist/layouts/PageWrapper.js +13 -8
  53. package/dist/layouts/PageWrapper.js.map +1 -1
  54. package/dist/layouts/shell/AegisShell.cjs +1 -1
  55. package/dist/layouts/shell/AegisShell.cjs.map +1 -1
  56. package/dist/layouts/shell/AegisShell.d.ts +1 -1
  57. package/dist/layouts/shell/AegisShell.js +193 -150
  58. package/dist/layouts/shell/AegisShell.js.map +1 -1
  59. package/dist/layouts/shell/ShellMenuToggle.cjs +2 -0
  60. package/dist/layouts/shell/ShellMenuToggle.cjs.map +1 -0
  61. package/dist/layouts/shell/ShellMenuToggle.d.ts +8 -0
  62. package/dist/layouts/shell/ShellMenuToggle.js +23 -0
  63. package/dist/layouts/shell/ShellMenuToggle.js.map +1 -0
  64. package/dist/layouts/shell/Sidebar.cjs +1 -1
  65. package/dist/layouts/shell/Sidebar.cjs.map +1 -1
  66. package/dist/layouts/shell/Sidebar.d.ts +10 -4
  67. package/dist/layouts/shell/Sidebar.js +39 -32
  68. package/dist/layouts/shell/Sidebar.js.map +1 -1
  69. package/dist/layouts/shell/TopHeader.cjs +1 -1
  70. package/dist/layouts/shell/TopHeader.cjs.map +1 -1
  71. package/dist/layouts/shell/TopHeader.d.ts +14 -0
  72. package/dist/layouts/shell/TopHeader.js +127 -110
  73. package/dist/layouts/shell/TopHeader.js.map +1 -1
  74. package/dist/layouts/shell/buildRouteTree.cjs +1 -1
  75. package/dist/layouts/shell/buildRouteTree.cjs.map +1 -1
  76. package/dist/layouts/shell/buildRouteTree.js +5 -5
  77. package/dist/layouts/shell/buildRouteTree.js.map +1 -1
  78. package/dist/layouts/shell/index.d.ts +1 -0
  79. package/dist/layouts/shell/shellNavContext.cjs +2 -0
  80. package/dist/layouts/shell/shellNavContext.cjs.map +1 -0
  81. package/dist/layouts/shell/shellNavContext.d.ts +8 -0
  82. package/dist/layouts/shell/shellNavContext.js +6 -0
  83. package/dist/layouts/shell/shellNavContext.js.map +1 -0
  84. package/dist/layouts/shell/types.d.ts +21 -0
  85. package/dist/locale/strings.cjs +1 -1
  86. package/dist/locale/strings.cjs.map +1 -1
  87. package/dist/locale/strings.d.ts +2 -0
  88. package/dist/locale/strings.js +7 -5
  89. package/dist/locale/strings.js.map +1 -1
  90. package/dist/style.css +1 -1
  91. package/package.json +1 -1
@@ -1,37 +1,44 @@
1
- import { jsx as s, jsxs as i } from "react/jsx-runtime";
2
- import { NavLink as c } from "react-router-dom";
3
- import { joinPath as o } from "./paths.js";
4
- function m({
5
- activeApp: e,
6
- drawerRef: r
1
+ import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
+ import { NavLink as b } from "react-router-dom";
3
+ import { joinPath as m } from "./paths.js";
4
+ function N({
5
+ activeApp: l,
6
+ drawerRef: c,
7
+ top: a,
8
+ footer: r
7
9
  }) {
8
- return !e?.sidebar || e.sidebar.length === 0 ? null : /* @__PURE__ */ s("aside", { ref: r, className: "aegis-shell__sidebar", children: /* @__PURE__ */ i("section", { className: "aegis-shell__sidebar-section", children: [
9
- /* @__PURE__ */ s("div", { className: "aegis-shell__sidebar-heading", children: e.label }),
10
- e.sidebar.map((l, d) => /* @__PURE__ */ i("div", { children: [
11
- l.label && /* @__PURE__ */ s("div", { className: "aegis-shell__sidebar-heading", children: l.label }),
12
- l.items.map((a) => {
13
- const n = o(e.basePath, a.to);
14
- return /* @__PURE__ */ i(
15
- c,
16
- {
17
- to: n,
18
- end: a.end,
19
- className: ({ isActive: h }) => [
20
- "aegis-shell__nav-link",
21
- h ? "aegis-shell__nav-link--active" : ""
22
- ].filter(Boolean).join(" "),
23
- children: [
24
- a.icon && /* @__PURE__ */ s("span", { className: "aegis-shell__nav-icon", children: a.icon }),
25
- /* @__PURE__ */ s("span", { children: a.label })
26
- ]
27
- },
28
- n
29
- );
30
- })
31
- ] }, d))
32
- ] }) });
10
+ const n = l?.sidebar ?? [];
11
+ return n.length === 0 && a === void 0 ? null : /* @__PURE__ */ i("aside", { ref: c, className: "aegis-shell__sidebar", children: [
12
+ a !== void 0 && /* @__PURE__ */ e("div", { className: "aegis-shell__sidebar-top", children: a }),
13
+ l && n.length > 0 && /* @__PURE__ */ i("section", { className: "aegis-shell__sidebar-section", children: [
14
+ a === void 0 && /* @__PURE__ */ e("div", { className: "aegis-shell__sidebar-heading", children: l.label }),
15
+ n.map((d, o) => /* @__PURE__ */ i("div", { children: [
16
+ d.label && /* @__PURE__ */ e("div", { className: "aegis-shell__sidebar-heading", children: d.label }),
17
+ d.items.map((s) => {
18
+ const h = m(l.basePath, s.to);
19
+ return /* @__PURE__ */ i(
20
+ b,
21
+ {
22
+ to: h,
23
+ end: s.end,
24
+ className: ({ isActive: _ }) => [
25
+ "aegis-shell__nav-link",
26
+ _ ? "aegis-shell__nav-link--active" : ""
27
+ ].filter(Boolean).join(" "),
28
+ children: [
29
+ s.icon && /* @__PURE__ */ e("span", { className: "aegis-shell__nav-icon", children: s.icon }),
30
+ /* @__PURE__ */ e("span", { children: s.label })
31
+ ]
32
+ },
33
+ h
34
+ );
35
+ })
36
+ ] }, o))
37
+ ] }),
38
+ r !== void 0 && /* @__PURE__ */ e("div", { className: "aegis-shell__sidebar-footer", children: r })
39
+ ] });
33
40
  }
34
41
  export {
35
- m as Sidebar
42
+ N as Sidebar
36
43
  };
37
44
  //# sourceMappingURL=Sidebar.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sidebar.js","sources":["../../../src/layouts/shell/Sidebar.tsx"],"sourcesContent":["import type { ReactElement, Ref } from 'react';\n\nimport { NavLink } from 'react-router-dom';\n\nimport { joinPath } from './paths';\nimport type { AegisApp } from './types';\n\ninterface SidebarProps {\n activeApp: AegisApp | undefined;\n /** The sidebar element, which is the navigation drawer at 768 px and below. */\n drawerRef?: Ref<HTMLElement>;\n}\n\n/**\n * Per-app inner nav. The global app list lives in the header's\n * `AppSwitcher`, not here — sidebar only ever shows the current app.\n */\nexport function Sidebar({\n activeApp,\n drawerRef,\n}: SidebarProps): ReactElement | null {\n if (!activeApp?.sidebar || activeApp.sidebar.length === 0) {\n return null;\n }\n\n return (\n <aside ref={drawerRef} className=\"aegis-shell__sidebar\">\n <section className=\"aegis-shell__sidebar-section\">\n <div className=\"aegis-shell__sidebar-heading\">{activeApp.label}</div>\n {activeApp.sidebar.map((group, idx) => (\n <div key={idx}>\n {group.label && (\n <div className=\"aegis-shell__sidebar-heading\">{group.label}</div>\n )}\n {group.items.map((item) => {\n const path = joinPath(activeApp.basePath, item.to);\n return (\n <NavLink\n key={path}\n to={path}\n end={item.end}\n className={({ isActive }) =>\n [\n 'aegis-shell__nav-link',\n isActive ? 'aegis-shell__nav-link--active' : '',\n ]\n .filter(Boolean)\n .join(' ')\n }\n >\n {item.icon && (\n <span className=\"aegis-shell__nav-icon\">{item.icon}</span>\n )}\n <span>{item.label}</span>\n </NavLink>\n );\n })}\n </div>\n ))}\n </section>\n </aside>\n );\n}\n"],"names":["Sidebar","activeApp","drawerRef","jsx","jsxs","group","idx","item","path","joinPath","NavLink","isActive"],"mappings":";;;AAiBO,SAASA,EAAQ;AAAA,EACtB,WAAAC;AAAA,EACA,WAAAC;AACF,GAAsC;AACpC,SAAI,CAACD,GAAW,WAAWA,EAAU,QAAQ,WAAW,IAC/C,OAIP,gBAAAE,EAAC,WAAM,KAAKD,GAAW,WAAU,wBAC/B,UAAA,gBAAAE,EAAC,WAAA,EAAQ,WAAU,gCACjB,UAAA;AAAA,IAAA,gBAAAD,EAAC,OAAA,EAAI,WAAU,gCAAgC,UAAAF,EAAU,OAAM;AAAA,IAC9DA,EAAU,QAAQ,IAAI,CAACI,GAAOC,wBAC5B,OAAA,EACE,UAAA;AAAA,MAAAD,EAAM,SACL,gBAAAF,EAAC,OAAA,EAAI,WAAU,gCAAgC,YAAM,OAAM;AAAA,MAE5DE,EAAM,MAAM,IAAI,CAACE,MAAS;AACzB,cAAMC,IAAOC,EAASR,EAAU,UAAUM,EAAK,EAAE;AACjD,eACE,gBAAAH;AAAA,UAACM;AAAA,UAAA;AAAA,YAEC,IAAIF;AAAA,YACJ,KAAKD,EAAK;AAAA,YACV,WAAW,CAAC,EAAE,UAAAI,QACZ;AAAA,cACE;AAAA,cACAA,IAAW,kCAAkC;AAAA,YAAA,EAE5C,OAAO,OAAO,EACd,KAAK,GAAG;AAAA,YAGZ,UAAA;AAAA,cAAAJ,EAAK,QACJ,gBAAAJ,EAAC,QAAA,EAAK,WAAU,yBAAyB,YAAK,MAAK;AAAA,cAErD,gBAAAA,EAAC,QAAA,EAAM,UAAAI,EAAK,MAAA,CAAM;AAAA,YAAA;AAAA,UAAA;AAAA,UAfbC;AAAA,QAAA;AAAA,MAkBX,CAAC;AAAA,IAAA,EAAA,GA1BOF,CA2BV,CACD;AAAA,EAAA,EAAA,CACH,EAAA,CACF;AAEJ;"}
1
+ {"version":3,"file":"Sidebar.js","sources":["../../../src/layouts/shell/Sidebar.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { NavLink } from 'react-router-dom';\n\nimport { joinPath } from './paths';\nimport type { AegisApp } from './types';\n\ninterface SidebarProps {\n activeApp: AegisApp | undefined;\n /** The sidebar element, which is the navigation drawer at 768 px and below. */\n drawerRef?: Ref<HTMLElement>;\n /** Heads the sidebar in place of the app's name, e.g. the brand. */\n top?: ReactNode;\n /** Sits at the sidebar's foot, e.g. the actions and the user menu. */\n footer?: ReactNode;\n}\n\n/**\n * Per-app inner nav. Under the default chrome the global app list lives in\n * the header's `AppSwitcher`, not here — the sidebar only ever shows the\n * current app. Under `chrome=\"sidebar\"` it also carries the brand at its\n * top and the header's controls at its foot.\n */\nexport function Sidebar({\n activeApp,\n drawerRef,\n top,\n footer,\n}: SidebarProps): ReactElement | null {\n const groups = activeApp?.sidebar ?? [];\n if (groups.length === 0 && top === undefined) {\n return null;\n }\n\n return (\n <aside ref={drawerRef} className=\"aegis-shell__sidebar\">\n {top !== undefined && (\n <div className=\"aegis-shell__sidebar-top\">{top}</div>\n )}\n {activeApp && groups.length > 0 && (\n <section className=\"aegis-shell__sidebar-section\">\n {top === undefined && (\n <div className=\"aegis-shell__sidebar-heading\">\n {activeApp.label}\n </div>\n )}\n {groups.map((group, idx) => (\n <div key={idx}>\n {group.label && (\n <div className=\"aegis-shell__sidebar-heading\">\n {group.label}\n </div>\n )}\n {group.items.map((item) => {\n const path = joinPath(activeApp.basePath, item.to);\n return (\n <NavLink\n key={path}\n to={path}\n end={item.end}\n className={({ isActive }) =>\n [\n 'aegis-shell__nav-link',\n isActive ? 'aegis-shell__nav-link--active' : '',\n ]\n .filter(Boolean)\n .join(' ')\n }\n >\n {item.icon && (\n <span className=\"aegis-shell__nav-icon\">{item.icon}</span>\n )}\n <span>{item.label}</span>\n </NavLink>\n );\n })}\n </div>\n ))}\n </section>\n )}\n {footer !== undefined && (\n <div className=\"aegis-shell__sidebar-footer\">{footer}</div>\n )}\n </aside>\n );\n}\n"],"names":["Sidebar","activeApp","drawerRef","top","footer","groups","jsxs","jsx","group","idx","item","path","joinPath","NavLink","isActive"],"mappings":";;;AAuBO,SAASA,EAAQ;AAAA,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AAW,UACV,gBAAAG,EAAC,OAAA,EAAI,WAAU,+BAA+B,UAAAH,EAAA,CAAO;AAAA,EAAA,GAEzD;AAEJ;"}
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),S=require("antd"),p=require("react-router-dom"),q=require("../../components/ui/Avatar.cjs"),C=require("../../components/ui/Chip.cjs"),A=require("../../components/ui/DropdownMenu.cjs"),E=require("../../components/ui/EnvironmentSwitcher.cjs"),B=require("./AppSwitcher.cjs"),U=require("./ShellNotificationBell.cjs"),v=require("../../locale/useStrings.cjs"),D=require("./environments/useEnvironment.cjs");function I({brand:s,apps:n,activeAppId:i,onAppSwitch:a,appSwitcher:o=!0,scrolled:l=!1,user:t,headerCenter:w,headerActions:N,inboxPath:d,onMobileMenuToggle:g,mobileMenuOpen:u=!1,menuToggleRef:b,showMobileMenu:f,sidebarCollapsible:y,sidebarCollapsed:h,onSidebarToggle:_,inlineSlotRef:k,inlineSlotActive:m,agentPanelOpen:c=!1,onAgentPanelToggle:x}){const r=v.useStrings(),j=e.jsxs(e.Fragment,{children:[s.logo&&e.jsx("span",{className:"aegis-shell__brand-logo",children:s.logo}),e.jsx("span",{className:"aegis-shell__brand-name",children:s.name})]});return e.jsxs("header",{className:l?"aegis-shell__header aegis-shell__header--scrolled":"aegis-shell__header",children:[e.jsxs("div",{className:"aegis-shell__header-left",children:[f&&g&&e.jsx("button",{ref:b,type:"button",className:"aegis-shell__menu-toggle",onClick:g,"aria-label":u?r.closeNavigation:r.openNavigation,"aria-expanded":u,children:e.jsx("span",{className:"aegis-shell__menu-toggle-glyph","aria-hidden":"true",children:"☰"})}),y&&_&&e.jsx("button",{type:"button",className:"aegis-shell__sidebar-toggle",onClick:_,"aria-label":h?r.showSidebar:r.hideSidebar,"aria-pressed":h,title:h?r.showSidebar:r.hideSidebar,children:e.jsx("span",{className:"aegis-shell__sidebar-toggle-glyph","aria-hidden":"true",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"2.5",y:"3.5",width:"15",height:"13",rx:"2"}),e.jsx("line",{x1:"8",y1:"3.5",x2:"8",y2:"16.5"})]})})}),o?e.jsx(B.AppSwitcher,{apps:n,activeAppId:i,onAppSwitch:a}):null,s.href?e.jsx(p.Link,{to:s.href,className:"aegis-shell__brand",children:j}):e.jsx("span",{className:"aegis-shell__brand",children:j})]}),e.jsx("div",{className:m?"aegis-shell__header-center aegis-shell__header-center--app":"aegis-shell__header-center",ref:k,"data-aegis-inline-slot":"",children:!m&&w}),e.jsxs("div",{className:"aegis-shell__header-right",children:[e.jsx(L,{}),N,d&&e.jsx(U.ShellNotificationBell,{inboxPath:d}),t&&e.jsx(R,{user:t}),x&&e.jsx("button",{type:"button",className:"aegis-shell__agent-toggle",onClick:x,"aria-label":c?r.hideAgentPanel:r.showAgentPanel,"aria-pressed":c,title:c?r.hideAgentPanel:r.showAgentPanel,children:e.jsx("span",{className:"aegis-shell__agent-toggle-glyph","aria-hidden":"true",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"2.5",y:"3.5",width:"15",height:"13",rx:"2"}),e.jsx("line",{x1:"12",y1:"3.5",x2:"12",y2:"16.5"})]})})})]})]})}function L(){const s=v.useStrings(),n=D.useEnvironmentManifest();if(n.status==="error")return e.jsx(S.Tooltip,{title:s.environmentsRetry(n.error.message),children:e.jsx("span",{className:"aegis-shell__env-error",children:e.jsxs(C.Chip,{tone:"warning",onClick:n.retry,children:[e.jsx("span",{className:"aegis-shell__env-error-full",children:s.environmentsUnavailable}),e.jsx("span",{className:"aegis-shell__env-error-short",children:s.environmentsUnavailableShort})]})})});if(n.status!=="ready")return null;const i=n.manifest.environments.map(a=>({id:a.id,label:a.label,badge:a.badge,hint:a.baseUrl}));return e.jsx(E.EnvironmentSwitcher,{className:"aegis-shell__env-switcher",options:i,currentId:n.currentEnvId,onChange:n.setCurrentEnv})}function R({user:s}){const n=p.useNavigate(),i=(s.menu??[]).map(l=>{const t=l.to;return{key:l.key,label:l.label,onClick:t?()=>{n(t)}:l.onClick}}),a=s.avatar??(typeof s.name=="string"?e.jsx(q.Avatar,{name:s.name,size:"sm",className:"aegis-shell__user-initials"}):null),o=e.jsxs("span",{className:a?"aegis-shell__user aegis-shell__user--badge":"aegis-shell__user",children:[a,e.jsx("span",{className:"aegis-shell__user-name",children:s.name})]});return i.length===0?o:e.jsx(A.DropdownMenu,{trigger:o,items:i})}exports.TopHeader=I;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),C=require("antd"),p=require("react-router-dom"),E=require("../../components/ui/Avatar.cjs"),B=require("../../components/ui/Chip.cjs"),P=require("../../components/ui/DropdownMenu.cjs"),U=require("../../components/ui/EnvironmentSwitcher.cjs"),T=require("./AppSwitcher.cjs"),D=require("./ShellNotificationBell.cjs"),g=require("../../locale/useStrings.cjs"),L=require("./environments/useEnvironment.cjs");function M({brand:s,apps:n,activeAppId:r,onAppSwitch:a,appSwitcher:t=!0,scrolled:o=!1,user:i,headerCenter:h,headerActions:b,inboxPath:d,onMobileMenuToggle:u,mobileMenuOpen:_=!1,menuToggleRef:S,showMobileMenu:y,sidebarCollapsible:k,sidebarCollapsed:c,onSidebarToggle:m,inlineSlotRef:q,inlineSlotActive:x,agentPanelOpen:A=!1,onAgentPanelToggle:j}){const l=g.useStrings();return e.jsxs("header",{className:o?"aegis-shell__header aegis-shell__header--scrolled":"aegis-shell__header",children:[e.jsxs("div",{className:"aegis-shell__header-left",children:[y&&u&&e.jsx("button",{ref:S,type:"button",className:"aegis-shell__menu-toggle",onClick:u,"aria-label":_?l.closeNavigation:l.openNavigation,"aria-expanded":_,children:e.jsx("span",{className:"aegis-shell__menu-toggle-glyph","aria-hidden":"true",children:"☰"})}),k&&m&&e.jsx("button",{type:"button",className:"aegis-shell__sidebar-toggle",onClick:m,"aria-label":c?l.showSidebar:l.hideSidebar,"aria-pressed":c,title:c?l.showSidebar:l.hideSidebar,children:e.jsx("span",{className:"aegis-shell__sidebar-toggle-glyph","aria-hidden":"true",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"2.5",y:"3.5",width:"15",height:"13",rx:"2"}),e.jsx("line",{x1:"8",y1:"3.5",x2:"8",y2:"16.5"})]})})}),t?e.jsx(T.AppSwitcher,{apps:n,activeAppId:r,onAppSwitch:a}):null,e.jsx(v,{brand:s})]}),e.jsx("div",{className:x?"aegis-shell__header-center aegis-shell__header-center--app":"aegis-shell__header-center",ref:q,"data-aegis-inline-slot":"",children:!x&&h}),e.jsxs("div",{className:"aegis-shell__header-right",children:[e.jsx(N,{}),b,d&&e.jsx(D.ShellNotificationBell,{inboxPath:d}),i&&e.jsx(f,{user:i}),j&&e.jsx(w,{open:A,onToggle:j})]})]})}function v({brand:s}){const n=e.jsxs(e.Fragment,{children:[s.logo&&e.jsx("span",{className:"aegis-shell__brand-logo",children:s.logo}),e.jsx("span",{className:"aegis-shell__brand-name",children:s.name})]});return s.href?e.jsx(p.Link,{to:s.href,className:"aegis-shell__brand",children:n}):e.jsx("span",{className:"aegis-shell__brand",children:n})}function w({open:s,onToggle:n}){const r=g.useStrings();return e.jsx("button",{type:"button",className:"aegis-shell__agent-toggle",onClick:n,"aria-label":s?r.hideAgentPanel:r.showAgentPanel,"aria-pressed":s,title:s?r.hideAgentPanel:r.showAgentPanel,children:e.jsx("span",{className:"aegis-shell__agent-toggle-glyph","aria-hidden":"true",children:e.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinejoin:"round",xmlns:"http://www.w3.org/2000/svg",children:[e.jsx("rect",{x:"2.5",y:"3.5",width:"15",height:"13",rx:"2"}),e.jsx("line",{x1:"12",y1:"3.5",x2:"12",y2:"16.5"})]})})})}function N(){const s=g.useStrings(),n=L.useEnvironmentManifest();if(n.status==="error")return e.jsx(C.Tooltip,{title:s.environmentsRetry(n.error.message),children:e.jsx("span",{className:"aegis-shell__env-error",children:e.jsxs(B.Chip,{tone:"warning",onClick:n.retry,children:[e.jsx("span",{className:"aegis-shell__env-error-full",children:s.environmentsUnavailable}),e.jsx("span",{className:"aegis-shell__env-error-short",children:s.environmentsUnavailableShort})]})})});if(n.status!=="ready")return null;const r=n.manifest.environments.map(a=>({id:a.id,label:a.label,badge:a.badge,hint:a.baseUrl}));return e.jsx(U.EnvironmentSwitcher,{className:"aegis-shell__env-switcher",options:r,currentId:n.currentEnvId,onChange:n.setCurrentEnv})}function f({user:s,align:n}){const r=p.useNavigate(),a=(s.menu??[]).map(i=>{const h=i.to;return{key:i.key,label:i.label,onClick:h?()=>{r(h)}:i.onClick}}),t=s.avatar??(typeof s.name=="string"?e.jsx(E.Avatar,{name:s.name,size:"sm",className:"aegis-shell__user-initials"}):null),o=e.jsxs("span",{className:t?"aegis-shell__user aegis-shell__user--badge":"aegis-shell__user",children:[t,e.jsx("span",{className:"aegis-shell__user-name",children:s.name})]});return a.length===0?o:e.jsx(P.DropdownMenu,{trigger:o,items:a,align:n})}exports.ActiveEnvironmentSwitcher=N;exports.AgentPanelToggle=w;exports.ShellBrand=v;exports.TopHeader=M;exports.UserMenu=f;
2
2
  //# sourceMappingURL=TopHeader.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"TopHeader.cjs","sources":["../../../src/layouts/shell/TopHeader.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { Tooltip } from 'antd';\nimport { Link, useNavigate } from 'react-router-dom';\n\nimport { Avatar } from '../../components/ui/Avatar';\nimport { Chip } from '../../components/ui/Chip';\nimport {\n type DropdownItem,\n DropdownMenu,\n} from '../../components/ui/DropdownMenu';\nimport { EnvironmentSwitcher } from '../../components/ui/EnvironmentSwitcher';\nimport { useStrings } from '../../locale';\nimport { AppSwitcher } from './AppSwitcher';\nimport { ShellNotificationBell } from './ShellNotificationBell';\nimport { useEnvironmentManifest } from './environments';\nimport type { AegisApp, AegisBrand, AegisUser } from './types';\n\ninterface TopHeaderProps {\n brand: AegisBrand;\n apps: AegisApp[];\n activeAppId?: string;\n onAppSwitch?: (appId: string) => void;\n /** Whether to render the app launcher. */\n appSwitcher?: boolean;\n /** The page has scrolled under the header; it gets a shadow. */\n scrolled?: boolean;\n user?: AegisUser;\n headerCenter?: ReactNode;\n headerActions?: ReactNode;\n /** When set, render a notification bell linking to this path. */\n inboxPath?: string;\n /** Fired by the mobile hamburger; the shell owns the open state. */\n onMobileMenuToggle?: () => void;\n /** Whether the navigation drawer is open — drives aria-expanded on the hamburger. */\n mobileMenuOpen?: boolean;\n /** The hamburger button, which takes focus back when the drawer is dismissed. */\n menuToggleRef?: Ref<HTMLButtonElement>;\n /** Whether to render the mobile hamburger at all (only when sidebar exists). */\n showMobileMenu?: boolean;\n /** Whether to render the desktop sidebar collapse toggle. */\n sidebarCollapsible?: boolean;\n /** Current collapsed state — drives aria-pressed on the toggle. */\n sidebarCollapsed?: boolean;\n /** Fired by the desktop collapse button; the shell owns the state. */\n onSidebarToggle?: () => void;\n /**\n * Ref callback for the inline app-header slot. The active app's\n * `header` is portalled into this node so it appears inside the shell\n * header instead of below it.\n */\n inlineSlotRef?: (node: HTMLDivElement | null) => void;\n /** When true, hide the global `headerCenter` (an app header took it over). */\n inlineSlotActive?: boolean;\n /** Current agent panel state — drives aria-pressed on its toggle. */\n agentPanelOpen?: boolean;\n /** Fired by the agent panel toggle; the toggle renders only when set. */\n onAgentPanelToggle?: () => void;\n}\n\nexport function TopHeader({\n brand,\n apps,\n activeAppId,\n onAppSwitch,\n appSwitcher = true,\n scrolled = false,\n user,\n headerCenter,\n headerActions,\n inboxPath,\n onMobileMenuToggle,\n mobileMenuOpen = false,\n menuToggleRef,\n showMobileMenu,\n sidebarCollapsible,\n sidebarCollapsed,\n onSidebarToggle,\n inlineSlotRef,\n inlineSlotActive,\n agentPanelOpen = false,\n onAgentPanelToggle,\n}: TopHeaderProps): ReactElement {\n const strings = useStrings();\n const brandInner = (\n <>\n {brand.logo && (\n <span className=\"aegis-shell__brand-logo\">{brand.logo}</span>\n )}\n <span className=\"aegis-shell__brand-name\">{brand.name}</span>\n </>\n );\n\n return (\n <header\n className={\n scrolled\n ? 'aegis-shell__header aegis-shell__header--scrolled'\n : 'aegis-shell__header'\n }\n >\n <div className=\"aegis-shell__header-left\">\n {showMobileMenu && onMobileMenuToggle && (\n <button\n ref={menuToggleRef}\n type=\"button\"\n className=\"aegis-shell__menu-toggle\"\n onClick={onMobileMenuToggle}\n aria-label={\n mobileMenuOpen ? strings.closeNavigation : strings.openNavigation\n }\n aria-expanded={mobileMenuOpen}\n >\n <span className=\"aegis-shell__menu-toggle-glyph\" aria-hidden=\"true\">\n ☰\n </span>\n </button>\n )}\n {sidebarCollapsible && onSidebarToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__sidebar-toggle\"\n onClick={onSidebarToggle}\n aria-label={\n sidebarCollapsed ? strings.showSidebar : strings.hideSidebar\n }\n aria-pressed={sidebarCollapsed}\n title={sidebarCollapsed ? strings.showSidebar : strings.hideSidebar}\n >\n <span\n className=\"aegis-shell__sidebar-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"8\" y1=\"3.5\" x2=\"8\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n {appSwitcher ? (\n <AppSwitcher\n apps={apps}\n activeAppId={activeAppId}\n onAppSwitch={onAppSwitch}\n />\n ) : null}\n {brand.href ? (\n <Link to={brand.href} className=\"aegis-shell__brand\">\n {brandInner}\n </Link>\n ) : (\n <span className=\"aegis-shell__brand\">{brandInner}</span>\n )}\n </div>\n <div\n className={\n inlineSlotActive\n ? 'aegis-shell__header-center aegis-shell__header-center--app'\n : 'aegis-shell__header-center'\n }\n ref={inlineSlotRef}\n data-aegis-inline-slot=\"\"\n >\n {!inlineSlotActive && headerCenter}\n </div>\n <div className=\"aegis-shell__header-right\">\n <ActiveEnvironmentSwitcher />\n {headerActions}\n {inboxPath && <ShellNotificationBell inboxPath={inboxPath} />}\n {user && <UserMenu user={user} />}\n {onAgentPanelToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__agent-toggle\"\n onClick={onAgentPanelToggle}\n aria-label={\n agentPanelOpen ? strings.hideAgentPanel : strings.showAgentPanel\n }\n aria-pressed={agentPanelOpen}\n title={\n agentPanelOpen ? strings.hideAgentPanel : strings.showAgentPanel\n }\n >\n <span\n className=\"aegis-shell__agent-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"12\" y1=\"3.5\" x2=\"12\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n </div>\n </header>\n );\n}\n\nfunction ActiveEnvironmentSwitcher(): ReactElement | null {\n const strings = useStrings();\n const state = useEnvironmentManifest();\n if (state.status === 'error') {\n return (\n <Tooltip title={strings.environmentsRetry(state.error.message)}>\n <span className=\"aegis-shell__env-error\">\n <Chip tone=\"warning\" onClick={state.retry}>\n <span className=\"aegis-shell__env-error-full\">\n {strings.environmentsUnavailable}\n </span>\n <span className=\"aegis-shell__env-error-short\">\n {strings.environmentsUnavailableShort}\n </span>\n </Chip>\n </span>\n </Tooltip>\n );\n }\n if (state.status !== 'ready') {\n return null;\n }\n const options = state.manifest.environments.map((e) => ({\n id: e.id,\n label: e.label,\n badge: e.badge,\n hint: e.baseUrl,\n }));\n return (\n <EnvironmentSwitcher\n className=\"aegis-shell__env-switcher\"\n options={options}\n currentId={state.currentEnvId}\n onChange={state.setCurrentEnv}\n />\n );\n}\n\nfunction UserMenu({ user }: { user: AegisUser }): ReactElement {\n const navigate = useNavigate();\n const items: DropdownItem[] = (user.menu ?? []).map((entry) => {\n const to = entry.to;\n return {\n key: entry.key,\n label: entry.label,\n onClick: to\n ? () => {\n navigate(to);\n }\n : entry.onClick,\n };\n });\n const badge =\n user.avatar ??\n (typeof user.name === 'string' ? (\n <Avatar\n name={user.name}\n size=\"sm\"\n className=\"aegis-shell__user-initials\"\n />\n ) : null);\n const trigger = (\n <span\n className={\n badge\n ? 'aegis-shell__user aegis-shell__user--badge'\n : 'aegis-shell__user'\n }\n >\n {badge}\n <span className=\"aegis-shell__user-name\">{user.name}</span>\n </span>\n );\n if (items.length === 0) {\n return trigger;\n }\n return <DropdownMenu trigger={trigger} items={items} />;\n}\n"],"names":["TopHeader","brand","apps","activeAppId","onAppSwitch","appSwitcher","scrolled","user","headerCenter","headerActions","inboxPath","onMobileMenuToggle","mobileMenuOpen","menuToggleRef","showMobileMenu","sidebarCollapsible","sidebarCollapsed","onSidebarToggle","inlineSlotRef","inlineSlotActive","agentPanelOpen","onAgentPanelToggle","strings","useStrings","brandInner","jsxs","Fragment","jsx","AppSwitcher","Link","ActiveEnvironmentSwitcher","ShellNotificationBell","UserMenu","state","useEnvironmentManifest","Tooltip","Chip","options","e","EnvironmentSwitcher","navigate","useNavigate","items","entry","to","badge","Avatar","trigger","DropdownMenu"],"mappings":"sgBA4DO,S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OAAA,CAEd,CAAC,EACKE,EACJtC,EAAK,SACJ,OAAOA,EAAK,MAAS,SACpBoB,EAAAA,IAACmB,EAAAA,OAAA,CACC,KAAMvC,EAAK,KACX,KAAK,KACL,UAAU,4BAAA,CAAA,EAEV,MACAwC,EACJtB,EAAAA,KAAC,OAAA,CACC,UACEoB,EACI,6CACA,oBAGL,SAAA,CAAAA,EACDlB,EAAAA,IAAC,OAAA,CAAK,UAAU,yBAA0B,WAAK,IAAA,CAAK,CAAA,CAAA,CAAA,EAGxD,OAAIe,EAAM,SAAW,EACZK,EAEFpB,EAAAA,IAACqB,EAAAA,aAAA,CAAa,QAAAD,EAAkB,MAAAL,CAAA,CAAc,CACvD"}
1
+ {"version":3,"file":"TopHeader.cjs","sources":["../../../src/layouts/shell/TopHeader.tsx"],"sourcesContent":["import type { ReactElement, ReactNode, Ref } from 'react';\n\nimport { Tooltip } from 'antd';\nimport { Link, useNavigate } from 'react-router-dom';\n\nimport { Avatar } from '../../components/ui/Avatar';\nimport { Chip } from '../../components/ui/Chip';\nimport {\n type DropdownItem,\n DropdownMenu,\n} from '../../components/ui/DropdownMenu';\nimport { EnvironmentSwitcher } from '../../components/ui/EnvironmentSwitcher';\nimport { useStrings } from '../../locale';\nimport { AppSwitcher } from './AppSwitcher';\nimport { ShellNotificationBell } from './ShellNotificationBell';\nimport { useEnvironmentManifest } from './environments';\nimport type { AegisApp, AegisBrand, AegisUser } from './types';\n\ninterface TopHeaderProps {\n brand: AegisBrand;\n apps: AegisApp[];\n activeAppId?: string;\n onAppSwitch?: (appId: string) => void;\n /** Whether to render the app launcher. */\n appSwitcher?: boolean;\n /** The page has scrolled under the header; it gets a shadow. */\n scrolled?: boolean;\n user?: AegisUser;\n headerCenter?: ReactNode;\n headerActions?: ReactNode;\n /** When set, render a notification bell linking to this path. */\n inboxPath?: string;\n /** Fired by the mobile hamburger; the shell owns the open state. */\n onMobileMenuToggle?: () => void;\n /** Whether the navigation drawer is open — drives aria-expanded on the hamburger. */\n mobileMenuOpen?: boolean;\n /** The hamburger button, which takes focus back when the drawer is dismissed. */\n menuToggleRef?: Ref<HTMLButtonElement>;\n /** Whether to render the mobile hamburger at all (only when sidebar exists). */\n showMobileMenu?: boolean;\n /** Whether to render the desktop sidebar collapse toggle. */\n sidebarCollapsible?: boolean;\n /** Current collapsed state — drives aria-pressed on the toggle. */\n sidebarCollapsed?: boolean;\n /** Fired by the desktop collapse button; the shell owns the state. */\n onSidebarToggle?: () => void;\n /**\n * Ref callback for the inline app-header slot. The active app's\n * `header` is portalled into this node so it appears inside the shell\n * header instead of below it.\n */\n inlineSlotRef?: (node: HTMLDivElement | null) => void;\n /** When true, hide the global `headerCenter` (an app header took it over). */\n inlineSlotActive?: boolean;\n /** Current agent panel state — drives aria-pressed on its toggle. */\n agentPanelOpen?: boolean;\n /** Fired by the agent panel toggle; the toggle renders only when set. */\n onAgentPanelToggle?: () => void;\n}\n\nexport function TopHeader({\n brand,\n apps,\n activeAppId,\n onAppSwitch,\n appSwitcher = true,\n scrolled = false,\n user,\n headerCenter,\n headerActions,\n inboxPath,\n onMobileMenuToggle,\n mobileMenuOpen = false,\n menuToggleRef,\n showMobileMenu,\n sidebarCollapsible,\n sidebarCollapsed,\n onSidebarToggle,\n inlineSlotRef,\n inlineSlotActive,\n agentPanelOpen = false,\n onAgentPanelToggle,\n}: TopHeaderProps): ReactElement {\n const strings = useStrings();\n\n return (\n <header\n className={\n scrolled\n ? 'aegis-shell__header aegis-shell__header--scrolled'\n : 'aegis-shell__header'\n }\n >\n <div className=\"aegis-shell__header-left\">\n {showMobileMenu && onMobileMenuToggle && (\n <button\n ref={menuToggleRef}\n type=\"button\"\n className=\"aegis-shell__menu-toggle\"\n onClick={onMobileMenuToggle}\n aria-label={\n mobileMenuOpen ? strings.closeNavigation : strings.openNavigation\n }\n aria-expanded={mobileMenuOpen}\n >\n <span className=\"aegis-shell__menu-toggle-glyph\" aria-hidden=\"true\">\n ☰\n </span>\n </button>\n )}\n {sidebarCollapsible && onSidebarToggle && (\n <button\n type=\"button\"\n className=\"aegis-shell__sidebar-toggle\"\n onClick={onSidebarToggle}\n aria-label={\n sidebarCollapsed ? strings.showSidebar : strings.hideSidebar\n }\n aria-pressed={sidebarCollapsed}\n title={sidebarCollapsed ? strings.showSidebar : strings.hideSidebar}\n >\n <span\n className=\"aegis-shell__sidebar-toggle-glyph\"\n aria-hidden=\"true\"\n >\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"8\" y1=\"3.5\" x2=\"8\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n )}\n {appSwitcher ? (\n <AppSwitcher\n apps={apps}\n activeAppId={activeAppId}\n onAppSwitch={onAppSwitch}\n />\n ) : null}\n <ShellBrand brand={brand} />\n </div>\n <div\n className={\n inlineSlotActive\n ? 'aegis-shell__header-center aegis-shell__header-center--app'\n : 'aegis-shell__header-center'\n }\n ref={inlineSlotRef}\n data-aegis-inline-slot=\"\"\n >\n {!inlineSlotActive && headerCenter}\n </div>\n <div className=\"aegis-shell__header-right\">\n <ActiveEnvironmentSwitcher />\n {headerActions}\n {inboxPath && <ShellNotificationBell inboxPath={inboxPath} />}\n {user && <UserMenu user={user} />}\n {onAgentPanelToggle && (\n <AgentPanelToggle\n open={agentPanelOpen}\n onToggle={onAgentPanelToggle}\n />\n )}\n </div>\n </header>\n );\n}\n\n/** The brand's logo and name, linked to `brand.href` when it has one. */\nexport function ShellBrand({ brand }: { brand: AegisBrand }): ReactElement {\n const inner = (\n <>\n {brand.logo && (\n <span className=\"aegis-shell__brand-logo\">{brand.logo}</span>\n )}\n <span className=\"aegis-shell__brand-name\">{brand.name}</span>\n </>\n );\n return brand.href ? (\n <Link to={brand.href} className=\"aegis-shell__brand\">\n {inner}\n </Link>\n ) : (\n <span className=\"aegis-shell__brand\">{inner}</span>\n );\n}\n\nexport function AgentPanelToggle({\n open,\n onToggle,\n}: {\n open: boolean;\n onToggle: () => void;\n}): ReactElement {\n const strings = useStrings();\n return (\n <button\n type=\"button\"\n className=\"aegis-shell__agent-toggle\"\n onClick={onToggle}\n aria-label={open ? strings.hideAgentPanel : strings.showAgentPanel}\n aria-pressed={open}\n title={open ? strings.hideAgentPanel : strings.showAgentPanel}\n >\n <span className=\"aegis-shell__agent-toggle-glyph\" aria-hidden=\"true\">\n <svg\n width=\"18\"\n height=\"18\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinejoin=\"round\"\n xmlns=\"http://www.w3.org/2000/svg\"\n >\n <rect x=\"2.5\" y=\"3.5\" width=\"15\" height=\"13\" rx=\"2\" />\n <line x1=\"12\" y1=\"3.5\" x2=\"12\" y2=\"16.5\" />\n </svg>\n </span>\n </button>\n );\n}\n\nexport function ActiveEnvironmentSwitcher(): ReactElement | null {\n const strings = useStrings();\n const state = useEnvironmentManifest();\n if (state.status === 'error') {\n return (\n <Tooltip title={strings.environmentsRetry(state.error.message)}>\n <span className=\"aegis-shell__env-error\">\n <Chip tone=\"warning\" onClick={state.retry}>\n <span className=\"aegis-shell__env-error-full\">\n {strings.environmentsUnavailable}\n </span>\n <span className=\"aegis-shell__env-error-short\">\n {strings.environmentsUnavailableShort}\n </span>\n </Chip>\n </span>\n </Tooltip>\n );\n }\n if (state.status !== 'ready') {\n return null;\n }\n const options = state.manifest.environments.map((e) => ({\n id: e.id,\n label: e.label,\n badge: e.badge,\n hint: e.baseUrl,\n }));\n return (\n <EnvironmentSwitcher\n className=\"aegis-shell__env-switcher\"\n options={options}\n currentId={state.currentEnvId}\n onChange={state.setCurrentEnv}\n />\n );\n}\n\nexport function UserMenu({\n user,\n align,\n}: {\n user: AegisUser;\n /** The side of the trigger the menu lines up with. */\n align?: 'left' | 'right';\n}): ReactElement {\n const navigate = useNavigate();\n const items: DropdownItem[] = (user.menu ?? []).map((entry) => {\n const to = entry.to;\n return {\n key: entry.key,\n label: entry.label,\n onClick: to\n ? () => {\n navigate(to);\n }\n : entry.onClick,\n };\n });\n const badge =\n user.avatar ??\n (typeof user.name === 'string' ? (\n <Avatar\n name={user.name}\n size=\"sm\"\n className=\"aegis-shell__user-initials\"\n />\n ) : null);\n const trigger = (\n <span\n className={\n badge\n ? 'aegis-shell__user aegis-shell__user--badge'\n : 'aegis-shell__user'\n }\n >\n {badge}\n <span className=\"aegis-shell__user-name\">{user.name}</span>\n </span>\n );\n if (items.length === 0) {\n return trigger;\n }\n return <DropdownMenu trigger={trigger} items={items} align={align} />;\n}\n"],"names":["TopHeader","brand","apps","activeAppId","onAppSwitch","appSwitcher","scrolled","user","headerCenter","headerActions","inboxPath","onMobileMenuToggle","mobileMenuOpen","menuToggleRef","showMobileMenu","sidebarCollapsible","sidebarCollapsed","onSidebarToggle","inlineSlotRef","inlineSlotActive","agentPanelOpen","onAgentPanelToggle","strings","useStrings","jsxs","jsx","AppSwitcher","ShellBrand","ActiveEnvironmentSwitcher","ShellNotificationBell","UserMenu","AgentPanelToggle","inner","Fragment","Link","open","onToggle","state","useEnvironmentManifest","Tooltip","Chip","options","e","EnvironmentSwitcher","align","navigate","useNavigate","items","entry","to","badge","Avatar","trigger","DropdownMenu"],"mappings":"sgBA4DO,SAASA,EAAU,CACxB,MAAAC,EACA,KAAAC,EACA,YAAAC,EACA,YAAAC,EACA,YAAAC,EAAc,GACd,SAAAC,EAAW,GACX,KAAAC,EACA,aAAAC,EACA,cAAAC,EACA,UAAAC,EACA,mBAAAC,EACA,eAAAC,EAAiB,GACjB,cAAAC,EACA,eAAAC,EACA,mBAAAC,EACA,iBAAAC,EACA,gBAAAC,EACA,cAAAC,EACA,iBAAAC,EACA,eAAAC,EAAiB,GACjB,mBAAAC,CACF,EAAiC,CAC/B,MAAMC,EAAUC,EAA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OA,EAAK,MAAS,SACpBkB,EAAAA,IAAC0B,EAAAA,OAAA,CACC,KAAM5C,EAAK,KACX,KAAK,KACL,UAAU,4BAAA,CAAA,EAEV,MACA6C,EACJ5B,EAAAA,KAAC,OAAA,CACC,UACE0B,EACI,6CACA,oBAGL,SAAA,CAAAA,EACDzB,EAAAA,IAAC,OAAA,CAAK,UAAU,yBAA0B,WAAK,IAAA,CAAK,CAAA,CAAA,CAAA,EAGxD,OAAIsB,EAAM,SAAW,EACZK,EAEF3B,EAAAA,IAAC4B,EAAAA,aAAA,CAAa,QAAAD,EAAkB,MAAAL,EAAc,MAAAH,CAAA,CAAc,CACrE"}
@@ -42,4 +42,18 @@ interface TopHeaderProps {
42
42
  onAgentPanelToggle?: () => void;
43
43
  }
44
44
  export declare function TopHeader({ brand, apps, activeAppId, onAppSwitch, appSwitcher, scrolled, user, headerCenter, headerActions, inboxPath, onMobileMenuToggle, mobileMenuOpen, menuToggleRef, showMobileMenu, sidebarCollapsible, sidebarCollapsed, onSidebarToggle, inlineSlotRef, inlineSlotActive, agentPanelOpen, onAgentPanelToggle, }: TopHeaderProps): ReactElement;
45
+ /** The brand's logo and name, linked to `brand.href` when it has one. */
46
+ export declare function ShellBrand({ brand }: {
47
+ brand: AegisBrand;
48
+ }): ReactElement;
49
+ export declare function AgentPanelToggle({ open, onToggle, }: {
50
+ open: boolean;
51
+ onToggle: () => void;
52
+ }): ReactElement;
53
+ export declare function ActiveEnvironmentSwitcher(): ReactElement | null;
54
+ export declare function UserMenu({ user, align, }: {
55
+ user: AegisUser;
56
+ /** The side of the trigger the menu lines up with. */
57
+ align?: 'left' | 'right';
58
+ }): ReactElement;
45
59
  export {};
@@ -1,74 +1,71 @@
1
- import { jsxs as i, Fragment as S, jsx as e } from "react/jsx-runtime";
2
- import { Tooltip as A } from "antd";
3
- import { Link as E, useNavigate as j } from "react-router-dom";
4
- import { Avatar as U } from "../../components/ui/Avatar.js";
1
+ import { jsxs as l, jsx as e, Fragment as C } from "react/jsx-runtime";
2
+ import { Tooltip as S } from "antd";
3
+ import { useNavigate as A, Link as E } from "react-router-dom";
4
+ import { Avatar as j } from "../../components/ui/Avatar.js";
5
5
  import { Chip as B } from "../../components/ui/Chip.js";
6
- import { DropdownMenu as I } from "../../components/ui/DropdownMenu.js";
6
+ import { DropdownMenu as U } from "../../components/ui/DropdownMenu.js";
7
7
  import { EnvironmentSwitcher as L } from "../../components/ui/EnvironmentSwitcher.js";
8
- import { AppSwitcher as W } from "./AppSwitcher.js";
9
- import { ShellNotificationBell as z } from "./ShellNotificationBell.js";
10
- import { useStrings as N } from "../../locale/useStrings.js";
11
- import { useEnvironmentManifest as D } from "./environments/useEnvironment.js";
8
+ import { AppSwitcher as P } from "./AppSwitcher.js";
9
+ import { ShellNotificationBell as I } from "./ShellNotificationBell.js";
10
+ import { useStrings as d } from "../../locale/useStrings.js";
11
+ import { useEnvironmentManifest as W } from "./environments/useEnvironment.js";
12
12
  function Z({
13
13
  brand: s,
14
14
  apps: a,
15
15
  activeAppId: n,
16
- onAppSwitch: l,
17
- appSwitcher: h = !0,
18
- scrolled: t = !1,
19
- user: o,
20
- headerCenter: w,
21
- headerActions: b,
22
- inboxPath: g,
23
- onMobileMenuToggle: m,
24
- mobileMenuOpen: _ = !1,
25
- menuToggleRef: k,
26
- showMobileMenu: x,
27
- sidebarCollapsible: y,
28
- sidebarCollapsed: c,
29
- onSidebarToggle: p,
30
- inlineSlotRef: C,
31
- inlineSlotActive: u,
32
- agentPanelOpen: d = !1,
33
- onAgentPanelToggle: f
16
+ onAppSwitch: r,
17
+ appSwitcher: o = !0,
18
+ scrolled: h = !1,
19
+ user: i,
20
+ headerCenter: c,
21
+ headerActions: N,
22
+ inboxPath: m,
23
+ onMobileMenuToggle: _,
24
+ mobileMenuOpen: p = !1,
25
+ menuToggleRef: w,
26
+ showMobileMenu: b,
27
+ sidebarCollapsible: k,
28
+ sidebarCollapsed: g,
29
+ onSidebarToggle: u,
30
+ inlineSlotRef: x,
31
+ inlineSlotActive: f,
32
+ agentPanelOpen: y = !1,
33
+ onAgentPanelToggle: v
34
34
  }) {
35
- const r = N(), v = /* @__PURE__ */ i(S, { children: [
36
- s.logo && /* @__PURE__ */ e("span", { className: "aegis-shell__brand-logo", children: s.logo }),
37
- /* @__PURE__ */ e("span", { className: "aegis-shell__brand-name", children: s.name })
38
- ] });
39
- return /* @__PURE__ */ i(
35
+ const t = d();
36
+ return /* @__PURE__ */ l(
40
37
  "header",
41
38
  {
42
- className: t ? "aegis-shell__header aegis-shell__header--scrolled" : "aegis-shell__header",
39
+ className: h ? "aegis-shell__header aegis-shell__header--scrolled" : "aegis-shell__header",
43
40
  children: [
44
- /* @__PURE__ */ i("div", { className: "aegis-shell__header-left", children: [
45
- x && m && /* @__PURE__ */ e(
41
+ /* @__PURE__ */ l("div", { className: "aegis-shell__header-left", children: [
42
+ b && _ && /* @__PURE__ */ e(
46
43
  "button",
47
44
  {
48
- ref: k,
45
+ ref: w,
49
46
  type: "button",
50
47
  className: "aegis-shell__menu-toggle",
51
- onClick: m,
52
- "aria-label": _ ? r.closeNavigation : r.openNavigation,
53
- "aria-expanded": _,
48
+ onClick: _,
49
+ "aria-label": p ? t.closeNavigation : t.openNavigation,
50
+ "aria-expanded": p,
54
51
  children: /* @__PURE__ */ e("span", { className: "aegis-shell__menu-toggle-glyph", "aria-hidden": "true", children: "☰" })
55
52
  }
56
53
  ),
57
- y && p && /* @__PURE__ */ e(
54
+ k && u && /* @__PURE__ */ e(
58
55
  "button",
59
56
  {
60
57
  type: "button",
61
58
  className: "aegis-shell__sidebar-toggle",
62
- onClick: p,
63
- "aria-label": c ? r.showSidebar : r.hideSidebar,
64
- "aria-pressed": c,
65
- title: c ? r.showSidebar : r.hideSidebar,
59
+ onClick: u,
60
+ "aria-label": g ? t.showSidebar : t.hideSidebar,
61
+ "aria-pressed": g,
62
+ title: g ? t.showSidebar : t.hideSidebar,
66
63
  children: /* @__PURE__ */ e(
67
64
  "span",
68
65
  {
69
66
  className: "aegis-shell__sidebar-toggle-glyph",
70
67
  "aria-hidden": "true",
71
- children: /* @__PURE__ */ i(
68
+ children: /* @__PURE__ */ l(
72
69
  "svg",
73
70
  {
74
71
  width: "18",
@@ -89,63 +86,35 @@ function Z({
89
86
  )
90
87
  }
91
88
  ),
92
- h ? /* @__PURE__ */ e(
93
- W,
89
+ o ? /* @__PURE__ */ e(
90
+ P,
94
91
  {
95
92
  apps: a,
96
93
  activeAppId: n,
97
- onAppSwitch: l
94
+ onAppSwitch: r
98
95
  }
99
96
  ) : null,
100
- s.href ? /* @__PURE__ */ e(E, { to: s.href, className: "aegis-shell__brand", children: v }) : /* @__PURE__ */ e("span", { className: "aegis-shell__brand", children: v })
97
+ /* @__PURE__ */ e(z, { brand: s })
101
98
  ] }),
102
99
  /* @__PURE__ */ e(
103
100
  "div",
104
101
  {
105
- className: u ? "aegis-shell__header-center aegis-shell__header-center--app" : "aegis-shell__header-center",
106
- ref: C,
102
+ className: f ? "aegis-shell__header-center aegis-shell__header-center--app" : "aegis-shell__header-center",
103
+ ref: x,
107
104
  "data-aegis-inline-slot": "",
108
- children: !u && w
105
+ children: !f && c
109
106
  }
110
107
  ),
111
- /* @__PURE__ */ i("div", { className: "aegis-shell__header-right", children: [
108
+ /* @__PURE__ */ l("div", { className: "aegis-shell__header-right", children: [
112
109
  /* @__PURE__ */ e(F, {}),
113
- b,
114
- g && /* @__PURE__ */ e(z, { inboxPath: g }),
115
- o && /* @__PURE__ */ e(H, { user: o }),
116
- f && /* @__PURE__ */ e(
117
- "button",
110
+ N,
111
+ m && /* @__PURE__ */ e(I, { inboxPath: m }),
112
+ i && /* @__PURE__ */ e(H, { user: i }),
113
+ v && /* @__PURE__ */ e(
114
+ D,
118
115
  {
119
- type: "button",
120
- className: "aegis-shell__agent-toggle",
121
- onClick: f,
122
- "aria-label": d ? r.hideAgentPanel : r.showAgentPanel,
123
- "aria-pressed": d,
124
- title: d ? r.hideAgentPanel : r.showAgentPanel,
125
- children: /* @__PURE__ */ e(
126
- "span",
127
- {
128
- className: "aegis-shell__agent-toggle-glyph",
129
- "aria-hidden": "true",
130
- children: /* @__PURE__ */ i(
131
- "svg",
132
- {
133
- width: "18",
134
- height: "18",
135
- viewBox: "0 0 20 20",
136
- fill: "none",
137
- stroke: "currentColor",
138
- strokeWidth: "1.5",
139
- strokeLinejoin: "round",
140
- xmlns: "http://www.w3.org/2000/svg",
141
- children: [
142
- /* @__PURE__ */ e("rect", { x: "2.5", y: "3.5", width: "15", height: "13", rx: "2" }),
143
- /* @__PURE__ */ e("line", { x1: "12", y1: "3.5", x2: "12", y2: "16.5" })
144
- ]
145
- }
146
- )
147
- }
148
- )
116
+ open: y,
117
+ onToggle: v
149
118
  }
150
119
  )
151
120
  ] })
@@ -153,20 +122,61 @@ function Z({
153
122
  }
154
123
  );
155
124
  }
125
+ function z({ brand: s }) {
126
+ const a = /* @__PURE__ */ l(C, { children: [
127
+ s.logo && /* @__PURE__ */ e("span", { className: "aegis-shell__brand-logo", children: s.logo }),
128
+ /* @__PURE__ */ e("span", { className: "aegis-shell__brand-name", children: s.name })
129
+ ] });
130
+ return s.href ? /* @__PURE__ */ e(E, { to: s.href, className: "aegis-shell__brand", children: a }) : /* @__PURE__ */ e("span", { className: "aegis-shell__brand", children: a });
131
+ }
132
+ function D({
133
+ open: s,
134
+ onToggle: a
135
+ }) {
136
+ const n = d();
137
+ return /* @__PURE__ */ e(
138
+ "button",
139
+ {
140
+ type: "button",
141
+ className: "aegis-shell__agent-toggle",
142
+ onClick: a,
143
+ "aria-label": s ? n.hideAgentPanel : n.showAgentPanel,
144
+ "aria-pressed": s,
145
+ title: s ? n.hideAgentPanel : n.showAgentPanel,
146
+ children: /* @__PURE__ */ e("span", { className: "aegis-shell__agent-toggle-glyph", "aria-hidden": "true", children: /* @__PURE__ */ l(
147
+ "svg",
148
+ {
149
+ width: "18",
150
+ height: "18",
151
+ viewBox: "0 0 20 20",
152
+ fill: "none",
153
+ stroke: "currentColor",
154
+ strokeWidth: "1.5",
155
+ strokeLinejoin: "round",
156
+ xmlns: "http://www.w3.org/2000/svg",
157
+ children: [
158
+ /* @__PURE__ */ e("rect", { x: "2.5", y: "3.5", width: "15", height: "13", rx: "2" }),
159
+ /* @__PURE__ */ e("line", { x1: "12", y1: "3.5", x2: "12", y2: "16.5" })
160
+ ]
161
+ }
162
+ ) })
163
+ }
164
+ );
165
+ }
156
166
  function F() {
157
- const s = N(), a = D();
167
+ const s = d(), a = W();
158
168
  if (a.status === "error")
159
- return /* @__PURE__ */ e(A, { title: s.environmentsRetry(a.error.message), children: /* @__PURE__ */ e("span", { className: "aegis-shell__env-error", children: /* @__PURE__ */ i(B, { tone: "warning", onClick: a.retry, children: [
169
+ return /* @__PURE__ */ e(S, { title: s.environmentsRetry(a.error.message), children: /* @__PURE__ */ e("span", { className: "aegis-shell__env-error", children: /* @__PURE__ */ l(B, { tone: "warning", onClick: a.retry, children: [
160
170
  /* @__PURE__ */ e("span", { className: "aegis-shell__env-error-full", children: s.environmentsUnavailable }),
161
171
  /* @__PURE__ */ e("span", { className: "aegis-shell__env-error-short", children: s.environmentsUnavailableShort })
162
172
  ] }) }) });
163
173
  if (a.status !== "ready")
164
174
  return null;
165
- const n = a.manifest.environments.map((l) => ({
166
- id: l.id,
167
- label: l.label,
168
- badge: l.badge,
169
- hint: l.baseUrl
175
+ const n = a.manifest.environments.map((r) => ({
176
+ id: r.id,
177
+ label: r.label,
178
+ badge: r.badge,
179
+ hint: r.baseUrl
170
180
  }));
171
181
  return /* @__PURE__ */ e(
172
182
  L,
@@ -178,36 +188,43 @@ function F() {
178
188
  }
179
189
  );
180
190
  }
181
- function H({ user: s }) {
182
- const a = j(), n = (s.menu ?? []).map((t) => {
183
- const o = t.to;
191
+ function H({
192
+ user: s,
193
+ align: a
194
+ }) {
195
+ const n = A(), r = (s.menu ?? []).map((i) => {
196
+ const c = i.to;
184
197
  return {
185
- key: t.key,
186
- label: t.label,
187
- onClick: o ? () => {
188
- a(o);
189
- } : t.onClick
198
+ key: i.key,
199
+ label: i.label,
200
+ onClick: c ? () => {
201
+ n(c);
202
+ } : i.onClick
190
203
  };
191
- }), l = s.avatar ?? (typeof s.name == "string" ? /* @__PURE__ */ e(
192
- U,
204
+ }), o = s.avatar ?? (typeof s.name == "string" ? /* @__PURE__ */ e(
205
+ j,
193
206
  {
194
207
  name: s.name,
195
208
  size: "sm",
196
209
  className: "aegis-shell__user-initials"
197
210
  }
198
- ) : null), h = /* @__PURE__ */ i(
211
+ ) : null), h = /* @__PURE__ */ l(
199
212
  "span",
200
213
  {
201
- className: l ? "aegis-shell__user aegis-shell__user--badge" : "aegis-shell__user",
214
+ className: o ? "aegis-shell__user aegis-shell__user--badge" : "aegis-shell__user",
202
215
  children: [
203
- l,
216
+ o,
204
217
  /* @__PURE__ */ e("span", { className: "aegis-shell__user-name", children: s.name })
205
218
  ]
206
219
  }
207
220
  );
208
- return n.length === 0 ? h : /* @__PURE__ */ e(I, { trigger: h, items: n });
221
+ return r.length === 0 ? h : /* @__PURE__ */ e(U, { trigger: h, items: r, align: a });
209
222
  }
210
223
  export {
211
- Z as TopHeader
224
+ F as ActiveEnvironmentSwitcher,
225
+ D as AgentPanelToggle,
226
+ z as ShellBrand,
227
+ Z as TopHeader,
228
+ H as UserMenu
212
229
  };
213
230
  //# sourceMappingURL=TopHeader.js.map