@ai-matrx/design-system 0.86.333 → 0.86.335

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 (69) hide show
  1. package/CHANGELOG.md +42 -62
  2. package/dist/carousel.cjs.map +1 -1
  3. package/dist/carousel.js +4 -4
  4. package/dist/{chunk-NNETFHGX.js → chunk-4CO5STZU.js} +18 -4
  5. package/dist/chunk-4CO5STZU.js.map +1 -0
  6. package/dist/{chunk-MFUNGDHO.js → chunk-B24DLFWR.js} +2 -2
  7. package/dist/{chunk-CSSD6NS4.js → chunk-DQUCOMAC.js} +2 -2
  8. package/dist/{chunk-6YZMGSQY.js → chunk-M34WPTPX.js} +2 -2
  9. package/dist/{chunk-VV6WZTH5.js → chunk-PBDQZPKV.js} +2 -2
  10. package/dist/{chunk-E4GS5QH7.js → chunk-Q2HWDJED.js} +2 -2
  11. package/dist/{chunk-ZOQ2XKXF.js → chunk-QOEKPR37.js} +5 -5
  12. package/dist/chunk-QOEKPR37.js.map +1 -0
  13. package/dist/{chunk-MEJVHDYJ.js → chunk-RGJPHRU3.js} +2 -2
  14. package/dist/{chunk-7NEVJKDZ.js → chunk-SUVIHUAD.js} +3 -3
  15. package/dist/{chunk-3MQMVPKO.js → chunk-VQ3G6AFN.js} +4 -4
  16. package/dist/clipboard-fallback-dialog.cjs.map +1 -1
  17. package/dist/clipboard-fallback-dialog.js +1 -1
  18. package/dist/controls.cjs +4 -4
  19. package/dist/controls.cjs.map +1 -1
  20. package/dist/controls.css +6 -0
  21. package/dist/controls.js +4 -4
  22. package/dist/data-table/data-row-inspector.cjs.map +1 -1
  23. package/dist/data-table/data-row-inspector.js +4 -4
  24. package/dist/data-table/data-row-window.cjs.map +1 -1
  25. package/dist/data-table/data-row-window.js +5 -5
  26. package/dist/data-table/index.cjs +4 -4
  27. package/dist/data-table/index.cjs.map +1 -1
  28. package/dist/data-table/index.js +7 -7
  29. package/dist/data-table/pagination.cjs +4 -4
  30. package/dist/data-table/pagination.cjs.map +1 -1
  31. package/dist/data-table/pagination.js +2 -2
  32. package/dist/data-table/uuid-cell.cjs.map +1 -1
  33. package/dist/data-table/uuid-cell.js +2 -2
  34. package/dist/desktop.cjs.map +1 -1
  35. package/dist/desktop.js +3 -3
  36. package/dist/index.cjs +574 -385
  37. package/dist/index.cjs.map +1 -1
  38. package/dist/index.d.cts +115 -3
  39. package/dist/index.d.ts +115 -3
  40. package/dist/index.js +437 -268
  41. package/dist/index.js.map +1 -1
  42. package/dist/item.cjs +33 -17
  43. package/dist/item.cjs.map +1 -1
  44. package/dist/item.d.cts +7 -1
  45. package/dist/item.d.ts +7 -1
  46. package/dist/item.js +19 -17
  47. package/dist/item.js.map +1 -1
  48. package/dist/lite-table.cjs.map +1 -1
  49. package/dist/lite-table.js +1 -1
  50. package/dist/record-list.cjs +16 -2
  51. package/dist/record-list.cjs.map +1 -1
  52. package/dist/record-list.d.cts +7 -1
  53. package/dist/record-list.d.ts +7 -1
  54. package/dist/record-list.js +2 -2
  55. package/dist/settings.cjs.map +1 -1
  56. package/dist/settings.js +2 -2
  57. package/dist/writing-field.cjs.map +1 -1
  58. package/dist/writing-field.js +2 -2
  59. package/package.json +2 -2
  60. package/dist/chunk-NNETFHGX.js.map +0 -1
  61. package/dist/chunk-ZOQ2XKXF.js.map +0 -1
  62. /package/dist/{chunk-MFUNGDHO.js.map → chunk-B24DLFWR.js.map} +0 -0
  63. /package/dist/{chunk-CSSD6NS4.js.map → chunk-DQUCOMAC.js.map} +0 -0
  64. /package/dist/{chunk-6YZMGSQY.js.map → chunk-M34WPTPX.js.map} +0 -0
  65. /package/dist/{chunk-VV6WZTH5.js.map → chunk-PBDQZPKV.js.map} +0 -0
  66. /package/dist/{chunk-E4GS5QH7.js.map → chunk-Q2HWDJED.js.map} +0 -0
  67. /package/dist/{chunk-MEJVHDYJ.js.map → chunk-RGJPHRU3.js.map} +0 -0
  68. /package/dist/{chunk-7NEVJKDZ.js.map → chunk-SUVIHUAD.js.map} +0 -0
  69. /package/dist/{chunk-3MQMVPKO.js.map → chunk-VQ3G6AFN.js.map} +0 -0
package/dist/item.d.cts CHANGED
@@ -283,6 +283,12 @@ interface ItemRowProps extends ItemMenuSurface {
283
283
  * glides LEFT (translate) when the kebab is revealed. Never masked.
284
284
  */
285
285
  trailing?: ReactNode;
286
+ /**
287
+ * Meta shown only while the row is hovered, keyboard-focused or its menu is open (a chat's
288
+ * relative time). At rest it takes no room, so `trailing` keeps the right edge. Always shown on
289
+ * touch, where the kebab is always shown too.
290
+ */
291
+ trailingOnHover?: ReactNode;
286
292
  active?: boolean | undefined;
287
293
  disabled?: boolean | undefined;
288
294
  /** Navigation mode — renders next/link as the row's primary element. */
@@ -328,7 +334,7 @@ declare function isLink(entry: ItemMenuEntry): entry is ItemMenuLink;
328
334
  declare function isSubmenu(entry: ItemMenuEntry): entry is ItemMenuSubmenu;
329
335
  declare function resolveItemMenuConfig(input: ItemMenuConfigInput): ItemMenuConfig;
330
336
 
331
- declare function ItemRow({ label, secondaryLabel, secondaryShare, subtitle, actions, leadingControl, disclosure, reserveDisclosure, leading, trailing, active, disabled, href, onOpen, openInPlace, menu, rename, size, indent, kebabAriaLabel, disableContextMenu, sourceFeature, surfaceName, entity, className, }: ItemRowProps): react.JSX.Element;
337
+ declare function ItemRow({ label, secondaryLabel, secondaryShare, subtitle, actions, leadingControl, disclosure, reserveDisclosure, leading, trailing, trailingOnHover, active, disabled, href, onOpen, openInPlace, menu, rename, size, indent, kebabAriaLabel, disableContextMenu, sourceFeature, surfaceName, entity, className, }: ItemRowProps): react.JSX.Element;
332
338
 
333
339
  declare function ItemMenu({ config, children, align, side, open: openProp, onOpenChange, onCloseAutoFocus, contentMinWidth, presentation, }: ItemMenuProps): react.JSX.Element;
334
340
  declare namespace ItemMenu {
package/dist/item.d.ts CHANGED
@@ -283,6 +283,12 @@ interface ItemRowProps extends ItemMenuSurface {
283
283
  * glides LEFT (translate) when the kebab is revealed. Never masked.
284
284
  */
285
285
  trailing?: ReactNode;
286
+ /**
287
+ * Meta shown only while the row is hovered, keyboard-focused or its menu is open (a chat's
288
+ * relative time). At rest it takes no room, so `trailing` keeps the right edge. Always shown on
289
+ * touch, where the kebab is always shown too.
290
+ */
291
+ trailingOnHover?: ReactNode;
286
292
  active?: boolean | undefined;
287
293
  disabled?: boolean | undefined;
288
294
  /** Navigation mode — renders next/link as the row's primary element. */
@@ -328,7 +334,7 @@ declare function isLink(entry: ItemMenuEntry): entry is ItemMenuLink;
328
334
  declare function isSubmenu(entry: ItemMenuEntry): entry is ItemMenuSubmenu;
329
335
  declare function resolveItemMenuConfig(input: ItemMenuConfigInput): ItemMenuConfig;
330
336
 
331
- declare function ItemRow({ label, secondaryLabel, secondaryShare, subtitle, actions, leadingControl, disclosure, reserveDisclosure, leading, trailing, active, disabled, href, onOpen, openInPlace, menu, rename, size, indent, kebabAriaLabel, disableContextMenu, sourceFeature, surfaceName, entity, className, }: ItemRowProps): react.JSX.Element;
337
+ declare function ItemRow({ label, secondaryLabel, secondaryShare, subtitle, actions, leadingControl, disclosure, reserveDisclosure, leading, trailing, trailingOnHover, active, disabled, href, onOpen, openInPlace, menu, rename, size, indent, kebabAriaLabel, disableContextMenu, sourceFeature, surfaceName, entity, className, }: ItemRowProps): react.JSX.Element;
332
338
 
333
339
  declare function ItemMenu({ config, children, align, side, open: openProp, onOpenChange, onCloseAutoFocus, contentMinWidth, presentation, }: ItemMenuProps): react.JSX.Element;
334
340
  declare namespace ItemMenu {
package/dist/item.js CHANGED
@@ -12,7 +12,7 @@ import {
12
12
  runCommand,
13
13
  runToggle,
14
14
  useItemMenuHost
15
- } from "./chunk-NNETFHGX.js";
15
+ } from "./chunk-4CO5STZU.js";
16
16
  import "./chunk-J6637L6D.js";
17
17
  import "./chunk-HEFTQUJ5.js";
18
18
  import "./chunk-K4XCB576.js";
@@ -34,7 +34,7 @@ import "./chunk-NDTDBBMM.js";
34
34
  import "./chunk-LEPD6TV7.js";
35
35
  import "./chunk-KPZX2M2C.js";
36
36
  import "./chunk-WFBPCMPF.js";
37
- import "./chunk-ZOQ2XKXF.js";
37
+ import "./chunk-QOEKPR37.js";
38
38
  import "./chunk-BD77DHUO.js";
39
39
  import "./chunk-BKCJUFD3.js";
40
40
  import "./chunk-MOZRIHJF.js";
@@ -102,20 +102,7 @@ function ProductSidebarTop({
102
102
  };
103
103
  return /* @__PURE__ */ jsxs("div", { "data-product-sidebar-top": "", className: cn("flex shrink-0 flex-col gap-1 px-2 pb-1 pt-2", className), children: [
104
104
  status,
105
- search ? /* @__PURE__ */ jsx(
106
- InputWithPrefix,
107
- {
108
- prefix: /* @__PURE__ */ jsx(SearchIcon, { className: "size-4" }),
109
- prefixInset: "edge",
110
- value: search.value,
111
- onChange: (e) => search.onChange(e.target.value),
112
- onKeyDown: onSearchKeyDown,
113
- placeholder: search.placeholder ?? "Search",
114
- "aria-label": search.ariaLabel,
115
- className: "h-8"
116
- }
117
- ) : null,
118
- /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col", search && "pt-1"), children: [
105
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
119
106
  newItem ? /* @__PURE__ */ jsx(
120
107
  ItemRow,
121
108
  {
@@ -155,7 +142,22 @@ function ProductSidebarTop({
155
142
  ] })
156
143
  ] }) : null
157
144
  ] }),
158
- children
145
+ children,
146
+ search ? /* @__PURE__ */ jsx(
147
+ InputWithPrefix,
148
+ {
149
+ prefix: /* @__PURE__ */ jsx(SearchIcon, { className: "size-4" }),
150
+ prefixInset: "edge",
151
+ value: search.value,
152
+ onChange: (e) => search.onChange(e.target.value),
153
+ onKeyDown: onSearchKeyDown,
154
+ placeholder: search.placeholder ?? "Search",
155
+ "aria-label": search.ariaLabel,
156
+ className: "h-8",
157
+ wrapperClassName: "mt-1",
158
+ "data-product-sidebar-search": ""
159
+ }
160
+ ) : null
159
161
  ] });
160
162
  }
161
163
  function PlaceRow({
package/dist/item.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/item/ProductSidebarTop.tsx"],"sourcesContent":["\"use client\";\n\n/**\n * THE TOP OF EVERY PRODUCT SIDEBAR (Arman, 2026-10-22: \"This is a very important missing thing that\n * we have to establish or our system will fail.\" — common-docs projects/app-frame/VISION.md).\n *\n * Extracted from the conversation sidebar's top (`@ai-matrx/chat` ConversationSidebar, approved\n * 2026-10-22), so every product sidebar — the web frame, desktop, the extension — has ONE shape and\n * ONE component:\n *\n * [status] optional one line (a refusal, a notice); absent = no band\n * ( Search ) only a host whose LIST has its own filter and no search door above\n * (+) New optional\n * Agents › the chosen related places, in order\n * Workflows › a place with `children` opens a flyout of them; else it opens\n * Scheduled ›\n * … More every other place, the host's extra groups, \"Edit sidebar…\"\n * [children] optional (the conversation sidebar's one row of filter buttons)\n *\n * ONE LEFT EDGE (Arman, 2026-10-23): the Search glyph, every row's icon and the host's list below\n * share one left edge, 16px in from the column (this component's 8px padding + the row's 8px); a\n * place's `›` and every other chevron sit on the RIGHT. The modes (Chat, Work…) are never here —\n * they live in the page header.\n *\n * ONE SEARCH DOOR (Arman, 2026-10-23: \"You cannot have a search icon and also a searchbar\"): a\n * sidebar whose top row carries a search icon (the web frame's Go to) passes no `search` — that icon\n * finds every place and page this field used to. The field is only a list's own filter.\n *\n * The product's own list sits below, outside this component. WHICH places sit above More is a\n * layered knob (system → organization → person) the HOST reads and writes; this component only\n * draws `chosen` and calls `onEditSidebar`. `SidebarPlacesChooser` is the \"Above More\" section of\n * the host's Edit sidebar dialog (`SidebarEditDialog` is the dialog's chrome).\n */\n\nimport type { ComponentType, KeyboardEvent, ReactNode } from \"react\";\nimport {\n ChevronRightIcon as ChevronRight,\n MoreHorizontalIcon as MoreHorizontal,\n PlusIcon as Plus,\n SearchIcon as Search,\n} from \"../icons\";\nimport { Button } from \"../button\";\nimport { Checkbox } from \"../checkbox\";\nimport { cn } from \"../cn\";\nimport { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from \"../dialog\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"../dropdown-menu\";\nimport { InputWithPrefix } from \"../input\";\nimport { ItemRow } from \"./ItemRow\";\n\n/** One related place a product sidebar can offer (another product, a page, a list). */\nexport interface SidebarPlace {\n /** Stable id: what the layered \"above More\" knob stores. */\n id: string;\n label: string;\n icon: ComponentType<{ className?: string }>;\n /** Its address. Set it and the row is a real link (cmd/ctrl/middle-click opens a new tab). */\n href?: string | undefined;\n /** A sub-list: the row opens a flyout of these (the place itself first) instead of navigating. */\n children?: readonly SidebarPlace[] | undefined;\n}\n\n/** An extra group at the end of More (a product's own other pages, under its name). */\nexport interface SidebarMoreGroup {\n id: string;\n label?: string | undefined;\n places: readonly SidebarPlace[];\n}\n\nexport interface ProductSidebarTopSearch {\n value: string;\n onChange: (value: string) => void;\n /** Screen-reader name (\"Search conversations\"). */\n ariaLabel: string;\n placeholder?: string | undefined;\n}\n\nexport interface ProductSidebarTopProps {\n /** Above Search: one status line (a refusal, a notice). Render it only when it has something to say. */\n status?: ReactNode;\n search?: ProductSidebarTopSearch | undefined;\n /** \"New\" row; absent = none. */\n newItem?: { label?: string | undefined; href?: string | undefined; onOpen?: (() => void) | undefined } | undefined;\n /** Every related place, in order. */\n places: readonly SidebarPlace[];\n /** Ids shown above More, in this order (unknown ids are skipped). */\n chosen: readonly string[];\n /** A place was opened (plain click). Absent + `href` = the link navigates. */\n onOpenPlace?: ((place: SidebarPlace) => void) | undefined;\n /** Extra groups at the end of More, before \"Edit sidebar…\". */\n moreGroups?: readonly SidebarMoreGroup[] | undefined;\n /** \"Edit sidebar…\" in More; absent = not offered. */\n onEditSidebar?: (() => void) | undefined;\n /** Below the rows: the conversation sidebar's bucket toggles. */\n children?: ReactNode;\n /** The right-click menu's feature tag on every row. */\n sourceFeature: string;\n className?: string | undefined;\n}\n\n/** Places above More, in `chosen` order; the rest in `places` order. */\nexport function splitSidebarPlaces(\n places: readonly SidebarPlace[],\n chosen: readonly string[],\n): { above: SidebarPlace[]; more: SidebarPlace[] } {\n const byId = new Map(places.map((p) => [p.id, p]));\n const above = chosen.map((id) => byId.get(id)).filter((p): p is SidebarPlace => p != null);\n const aboveIds = new Set(above.map((p) => p.id));\n return { above, more: places.filter((p) => !aboveIds.has(p.id)) };\n}\n\nexport function ProductSidebarTop({\n status,\n search,\n newItem,\n places,\n chosen,\n onOpenPlace,\n moreGroups,\n onEditSidebar,\n children,\n sourceFeature,\n className,\n}: ProductSidebarTopProps) {\n const { above, more } = splitSidebarPlaces(places, chosen);\n const groups = (moreGroups ?? []).filter((g) => g.places.length > 0);\n const open = (place: SidebarPlace) => onOpenPlace?.(place);\n\n const onSearchKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (search && e.key === \"Escape\" && search.value) {\n e.preventDefault();\n search.onChange(\"\");\n }\n };\n\n return (\n <div data-product-sidebar-top=\"\" className={cn(\"flex shrink-0 flex-col gap-1 px-2 pb-1 pt-2\", className)}>\n {status}\n {search ? (\n <InputWithPrefix\n prefix={<Search className=\"size-4\" />}\n prefixInset=\"edge\"\n value={search.value}\n onChange={(e) => search.onChange(e.target.value)}\n onKeyDown={onSearchKeyDown}\n placeholder={search.placeholder ?? \"Search\"}\n aria-label={search.ariaLabel}\n className=\"h-8\"\n />\n ) : null}\n\n <div className={cn(\"flex flex-col\", search && \"pt-1\")}>\n {newItem ? (\n <ItemRow\n size=\"sm\"\n label={newItem.label ?? \"New\"}\n leading={<Plus className=\"size-4\" />}\n href={newItem.href}\n openInPlace={newItem.href ? true : undefined}\n onOpen={newItem.onOpen}\n sourceFeature={sourceFeature}\n disableContextMenu\n />\n ) : null}\n {above.map((p) => (\n <PlaceRow key={p.id} place={p} onOpen={onOpenPlace ? open : undefined} sourceFeature={sourceFeature} chevron />\n ))}\n {more.length > 0 || groups.length > 0 || onEditSidebar ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <div data-sidebar-more-trigger=\"\">\n <ItemRow\n size=\"sm\"\n label=\"More\"\n leading={<MoreHorizontal className=\"size-4\" />}\n sourceFeature={sourceFeature}\n disableContextMenu\n />\n </div>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"w-56\">\n {more.map((p) => (\n <PlaceMenuItem key={p.id} place={p} onOpen={open} />\n ))}\n {groups.map((g, i) => (\n <div key={g.id} role=\"group\" aria-label={g.label}>\n {more.length > 0 || i > 0 ? <DropdownMenuSeparator /> : null}\n {g.label ? <DropdownMenuLabel>{g.label}</DropdownMenuLabel> : null}\n {g.places.map((p) => (\n <PlaceMenuItem key={p.id} place={p} onOpen={open} />\n ))}\n </div>\n ))}\n {onEditSidebar ? (\n <>\n {more.length > 0 || groups.length > 0 ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem onSelect={onEditSidebar}>Edit sidebar…</DropdownMenuItem>\n </>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </div>\n\n {children}\n </div>\n );\n}\n\n/** A place above More: a link row, or a flyout of its sub-list. */\nfunction PlaceRow({\n place,\n onOpen,\n sourceFeature,\n chevron,\n}: {\n place: SidebarPlace;\n onOpen: ((place: SidebarPlace) => void) | undefined;\n sourceFeature: string;\n chevron?: boolean;\n}) {\n const Icon = place.icon;\n const trailing = chevron ? <ChevronRight className=\"size-4 text-muted-foreground\" /> : undefined;\n if (place.children && place.children.length > 0) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <div data-sidebar-place={place.id} data-sidebar-place-flyout=\"\">\n <ItemRow\n size=\"sm\"\n label={place.label}\n leading={<Icon className=\"size-4\" />}\n trailing={trailing}\n sourceFeature={sourceFeature}\n disableContextMenu\n />\n </div>\n </DropdownMenuTrigger>\n <DropdownMenuContent side=\"right\" align=\"start\" className=\"w-56\">\n <FlyoutItems place={place} onOpen={(p) => (onOpen ? onOpen(p) : goTo(p))} />\n </DropdownMenuContent>\n </DropdownMenu>\n );\n }\n return (\n <div data-sidebar-place={place.id}>\n <ItemRow\n size=\"sm\"\n label={place.label}\n leading={<Icon className=\"size-4\" />}\n trailing={trailing}\n href={place.href}\n openInPlace={place.href && onOpen ? true : undefined}\n onOpen={onOpen ? () => onOpen(place) : undefined}\n sourceFeature={sourceFeature}\n disableContextMenu\n />\n </div>\n );\n}\n\n/** The place itself first, then its sub-list. */\nfunction FlyoutItems({ place, onOpen }: { place: SidebarPlace; onOpen: (place: SidebarPlace) => void }) {\n const Icon = place.icon;\n return (\n <>\n {place.href ? (\n <>\n <DropdownMenuItem onSelect={() => onOpen({ ...place, children: undefined })}>\n <Icon className=\"size-4\" />\n {place.label}\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n </>\n ) : null}\n {(place.children ?? []).map((c) => {\n const CIcon = c.icon;\n return (\n <DropdownMenuItem key={c.id} onSelect={() => onOpen(c)}>\n <CIcon className=\"size-4\" />\n {c.label}\n </DropdownMenuItem>\n );\n })}\n </>\n );\n}\n\nfunction PlaceMenuItem({ place, onOpen }: { place: SidebarPlace; onOpen: (place: SidebarPlace) => void }) {\n const Icon = place.icon;\n if (place.children && place.children.length > 0) {\n return (\n <DropdownMenuSub>\n <DropdownMenuSubTrigger>\n <Icon className=\"size-4\" />\n {place.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent className=\"w-56\">\n <FlyoutItems place={place} onOpen={onOpen} />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n );\n }\n return (\n <DropdownMenuItem onSelect={() => onOpen(place)}>\n <Icon className=\"size-4\" />\n {place.label}\n </DropdownMenuItem>\n );\n}\n\n/** No host handler: a place with an address is a plain navigation. */\nfunction goTo(place: SidebarPlace) {\n if (place.href && typeof window !== \"undefined\") window.location.assign(place.href);\n}\n\n/** \"Above More\": which places sit above More (the host saves it on its layered knob). */\nexport function SidebarPlacesChooser({\n places,\n chosen,\n onChange,\n title = \"Above More\",\n}: {\n places: readonly SidebarPlace[];\n chosen: readonly string[];\n /** The next chosen ids, in `places` order. */\n onChange: (next: string[]) => void;\n title?: string;\n}) {\n const flip = (id: string) =>\n onChange(places.filter((p) => (p.id === id ? !chosen.includes(id) : chosen.includes(p.id))).map((p) => p.id));\n return (\n <section className=\"flex flex-col gap-1\" data-sidebar-places-chooser=\"\">\n <span className=\"text-sm font-medium text-foreground\">{title}</span>\n {places.map((p) => {\n const Icon = p.icon;\n return (\n <label key={p.id} className=\"flex h-8 cursor-pointer items-center gap-2 rounded-md px-1 text-sm hover:bg-muted\">\n <Checkbox size=\"sm\" checked={chosen.includes(p.id)} onCheckedChange={() => flip(p.id)} />\n <Icon className=\"size-4 text-muted-foreground\" />\n <span className=\"text-foreground\">{p.label}</span>\n </label>\n );\n })}\n </section>\n );\n}\n\n/** The Edit sidebar dialog's chrome: title, the host's sections, a refusal line, Cancel / Save. */\nexport function SidebarEditDialog({\n open,\n onOpenChange,\n onSave,\n refusal,\n saveLabel = \"Save as my default\",\n children,\n}: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n onSave: () => void;\n /** Why the last save was refused; shown in the dialog. */\n refusal?: string | null | undefined;\n saveLabel?: string;\n children: ReactNode;\n}) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent size=\"sm\" onOpenAutoFocus={(e) => e.preventDefault()}>\n <DialogHeader>\n <DialogTitle>Edit sidebar</DialogTitle>\n </DialogHeader>\n <div className=\"flex flex-col gap-4\">\n {children}\n <div className=\"h-5 truncate text-sm text-destructive\" role=\"status\">\n {refusal ?? \"\"}\n </div>\n </div>\n <DialogFooter>\n <Button variant=\"ghost\" onClick={() => onOpenChange(false)}>\n Cancel\n </Button>\n <Button onClick={onSave}>{saveLabel}</Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqJkB,SAsDE,UAt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arman, 2026-10-22: \"This is a very important missing thing that\n * we have to establish or our system will fail.\" — common-docs projects/app-frame/VISION.md).\n *\n * Extracted from the conversation sidebar's top (`@ai-matrx/chat` ConversationSidebar, approved\n * 2026-10-22), so every product sidebar — the web frame, desktop, the extension — has ONE shape and\n * ONE component:\n *\n * [status] optional one line (a refusal, a notice); absent = no band\n * (+) New optional\n * Agents › the chosen related places, in order\n * Workflows › a place with `children` opens a flyout of them; else it opens\n * Scheduled ›\n * … More every other place, the host's extra groups, \"Edit sidebar…\"\n * [children] optional (the conversation sidebar's one row of filter buttons)\n * ( Search ) the LIST's own search, last: directly above the host's list\n *\n * THE LIST'S SEARCH SITS WITH THE LIST (Arman, 2026-10-23: \"move the chat search to be above the\n * actual chats so it's not confused with the other things\"): it filters the rows below it, so it is\n * the last thing in the top, under the places and the filter row — never among the top actions.\n *\n * ONE LEFT EDGE (Arman, 2026-10-23): the Search glyph, every row's icon and the host's list below\n * share one left edge, 16px in from the column (this component's 8px padding + the row's 8px); a\n * place's `›` and every other chevron sit on the RIGHT. The modes (Chat, Work…) are never here —\n * they live in the page header.\n *\n * ONE SEARCH DOOR (Arman, 2026-10-23: \"You cannot have a search icon and also a searchbar\"): a\n * sidebar whose top row carries a search icon (the web frame's Go to) passes no `search` — that icon\n * finds every place and page this field used to. The field is only a list's own filter.\n *\n * The product's own list sits below, outside this component. WHICH places sit above More is a\n * layered knob (system → organization → person) the HOST reads and writes; this component only\n * draws `chosen` and calls `onEditSidebar`. `SidebarPlacesChooser` is the \"Above More\" section of\n * the host's Edit sidebar dialog (`SidebarEditDialog` is the dialog's chrome).\n */\n\nimport type { ComponentType, KeyboardEvent, ReactNode } from \"react\";\nimport {\n ChevronRightIcon as ChevronRight,\n MoreHorizontalIcon as MoreHorizontal,\n PlusIcon as Plus,\n SearchIcon as Search,\n} from \"../icons\";\nimport { Button } from \"../button\";\nimport { Checkbox } from \"../checkbox\";\nimport { cn } from \"../cn\";\nimport { Dialog, DialogContent, DialogFooter, DialogHeader, DialogTitle } from \"../dialog\";\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"../dropdown-menu\";\nimport { InputWithPrefix } from \"../input\";\nimport { ItemRow } from \"./ItemRow\";\n\n/** One related place a product sidebar can offer (another product, a page, a list). */\nexport interface SidebarPlace {\n /** Stable id: what the layered \"above More\" knob stores. */\n id: string;\n label: string;\n icon: ComponentType<{ className?: string }>;\n /** Its address. Set it and the row is a real link (cmd/ctrl/middle-click opens a new tab). */\n href?: string | undefined;\n /** A sub-list: the row opens a flyout of these (the place itself first) instead of navigating. */\n children?: readonly SidebarPlace[] | undefined;\n}\n\n/** An extra group at the end of More (a product's own other pages, under its name). */\nexport interface SidebarMoreGroup {\n id: string;\n label?: string | undefined;\n places: readonly SidebarPlace[];\n}\n\nexport interface ProductSidebarTopSearch {\n value: string;\n onChange: (value: string) => void;\n /** Screen-reader name (\"Search conversations\"). */\n ariaLabel: string;\n placeholder?: string | undefined;\n}\n\nexport interface ProductSidebarTopProps {\n /** Above Search: one status line (a refusal, a notice). Render it only when it has something to say. */\n status?: ReactNode;\n search?: ProductSidebarTopSearch | undefined;\n /** \"New\" row; absent = none. */\n newItem?: { label?: string | undefined; href?: string | undefined; onOpen?: (() => void) | undefined } | undefined;\n /** Every related place, in order. */\n places: readonly SidebarPlace[];\n /** Ids shown above More, in this order (unknown ids are skipped). */\n chosen: readonly string[];\n /** A place was opened (plain click). Absent + `href` = the link navigates. */\n onOpenPlace?: ((place: SidebarPlace) => void) | undefined;\n /** Extra groups at the end of More, before \"Edit sidebar…\". */\n moreGroups?: readonly SidebarMoreGroup[] | undefined;\n /** \"Edit sidebar…\" in More; absent = not offered. */\n onEditSidebar?: (() => void) | undefined;\n /** Below the rows: the conversation sidebar's bucket toggles. */\n children?: ReactNode;\n /** The right-click menu's feature tag on every row. */\n sourceFeature: string;\n className?: string | undefined;\n}\n\n/** Places above More, in `chosen` order; the rest in `places` order. */\nexport function splitSidebarPlaces(\n places: readonly SidebarPlace[],\n chosen: readonly string[],\n): { above: SidebarPlace[]; more: SidebarPlace[] } {\n const byId = new Map(places.map((p) => [p.id, p]));\n const above = chosen.map((id) => byId.get(id)).filter((p): p is SidebarPlace => p != null);\n const aboveIds = new Set(above.map((p) => p.id));\n return { above, more: places.filter((p) => !aboveIds.has(p.id)) };\n}\n\nexport function ProductSidebarTop({\n status,\n search,\n newItem,\n places,\n chosen,\n onOpenPlace,\n moreGroups,\n onEditSidebar,\n children,\n sourceFeature,\n className,\n}: ProductSidebarTopProps) {\n const { above, more } = splitSidebarPlaces(places, chosen);\n const groups = (moreGroups ?? []).filter((g) => g.places.length > 0);\n const open = (place: SidebarPlace) => onOpenPlace?.(place);\n\n const onSearchKeyDown = (e: KeyboardEvent<HTMLInputElement>) => {\n if (search && e.key === \"Escape\" && search.value) {\n e.preventDefault();\n search.onChange(\"\");\n }\n };\n\n return (\n <div data-product-sidebar-top=\"\" className={cn(\"flex shrink-0 flex-col gap-1 px-2 pb-1 pt-2\", className)}>\n {status}\n <div className=\"flex flex-col\">\n {newItem ? (\n <ItemRow\n size=\"sm\"\n label={newItem.label ?? \"New\"}\n leading={<Plus className=\"size-4\" />}\n href={newItem.href}\n openInPlace={newItem.href ? true : undefined}\n onOpen={newItem.onOpen}\n sourceFeature={sourceFeature}\n disableContextMenu\n />\n ) : null}\n {above.map((p) => (\n <PlaceRow key={p.id} place={p} onOpen={onOpenPlace ? open : undefined} sourceFeature={sourceFeature} chevron />\n ))}\n {more.length > 0 || groups.length > 0 || onEditSidebar ? (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <div data-sidebar-more-trigger=\"\">\n <ItemRow\n size=\"sm\"\n label=\"More\"\n leading={<MoreHorizontal className=\"size-4\" />}\n sourceFeature={sourceFeature}\n disableContextMenu\n />\n </div>\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" className=\"w-56\">\n {more.map((p) => (\n <PlaceMenuItem key={p.id} place={p} onOpen={open} />\n ))}\n {groups.map((g, i) => (\n <div key={g.id} role=\"group\" aria-label={g.label}>\n {more.length > 0 || i > 0 ? <DropdownMenuSeparator /> : null}\n {g.label ? <DropdownMenuLabel>{g.label}</DropdownMenuLabel> : null}\n {g.places.map((p) => (\n <PlaceMenuItem key={p.id} place={p} onOpen={open} />\n ))}\n </div>\n ))}\n {onEditSidebar ? (\n <>\n {more.length > 0 || groups.length > 0 ? <DropdownMenuSeparator /> : null}\n <DropdownMenuItem onSelect={onEditSidebar}>Edit sidebar…</DropdownMenuItem>\n </>\n ) : null}\n </DropdownMenuContent>\n </DropdownMenu>\n ) : null}\n </div>\n\n {children}\n\n {search ? (\n <InputWithPrefix\n prefix={<Search className=\"size-4\" />}\n prefixInset=\"edge\"\n value={search.value}\n onChange={(e) => search.onChange(e.target.value)}\n onKeyDown={onSearchKeyDown}\n placeholder={search.placeholder ?? \"Search\"}\n aria-label={search.ariaLabel}\n className=\"h-8\"\n wrapperClassName=\"mt-1\"\n data-product-sidebar-search=\"\"\n />\n ) : null}\n </div>\n );\n}\n\n/** A place above More: a link row, or a flyout of its sub-list. */\nfunction PlaceRow({\n place,\n onOpen,\n sourceFeature,\n chevron,\n}: {\n place: SidebarPlace;\n onOpen: ((place: SidebarPlace) => void) | undefined;\n sourceFeature: string;\n chevron?: boolean;\n}) {\n const Icon = place.icon;\n const trailing = chevron ? <ChevronRight className=\"size-4 text-muted-foreground\" /> : undefined;\n if (place.children && place.children.length > 0) {\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <div data-sidebar-place={place.id} data-sidebar-place-flyout=\"\">\n <ItemRow\n size=\"sm\"\n label={place.label}\n leading={<Icon className=\"size-4\" />}\n trailing={trailing}\n sourceFeature={sourceFeature}\n disableContextMenu\n />\n </div>\n </DropdownMenuTrigger>\n <DropdownMenuContent side=\"right\" align=\"start\" className=\"w-56\">\n <FlyoutItems place={place} onOpen={(p) => (onOpen ? onOpen(p) : goTo(p))} />\n </DropdownMenuContent>\n </DropdownMenu>\n );\n }\n return (\n <div data-sidebar-place={place.id}>\n <ItemRow\n size=\"sm\"\n label={place.label}\n leading={<Icon className=\"size-4\" />}\n trailing={trailing}\n href={place.href}\n openInPlace={place.href && onOpen ? true : undefined}\n onOpen={onOpen ? () => onOpen(place) : undefined}\n sourceFeature={sourceFeature}\n disableContextMenu\n />\n </div>\n );\n}\n\n/** The place itself first, then its sub-list. */\nfunction FlyoutItems({ place, onOpen }: { place: SidebarPlace; onOpen: (place: SidebarPlace) => void }) {\n const Icon = place.icon;\n return (\n <>\n {place.href ? (\n <>\n <DropdownMenuItem onSelect={() => onOpen({ ...place, children: undefined })}>\n <Icon className=\"size-4\" />\n {place.label}\n </DropdownMenuItem>\n <DropdownMenuSeparator />\n </>\n ) : null}\n {(place.children ?? []).map((c) => {\n const CIcon = c.icon;\n return (\n <DropdownMenuItem key={c.id} onSelect={() => onOpen(c)}>\n <CIcon className=\"size-4\" />\n {c.label}\n </DropdownMenuItem>\n );\n })}\n </>\n );\n}\n\nfunction PlaceMenuItem({ place, onOpen }: { place: SidebarPlace; onOpen: (place: SidebarPlace) => void }) {\n const Icon = place.icon;\n if (place.children && place.children.length > 0) {\n return (\n <DropdownMenuSub>\n <DropdownMenuSubTrigger>\n <Icon className=\"size-4\" />\n {place.label}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent className=\"w-56\">\n <FlyoutItems place={place} onOpen={onOpen} />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n );\n }\n return (\n <DropdownMenuItem onSelect={() => onOpen(place)}>\n <Icon className=\"size-4\" />\n {place.label}\n </DropdownMenuItem>\n );\n}\n\n/** No host handler: a place with an address is a plain navigation. */\nfunction goTo(place: SidebarPlace) {\n if (place.href && typeof window !== \"undefined\") window.location.assign(place.href);\n}\n\n/** \"Above More\": which places sit above More (the host saves it on its layered knob). */\nexport function SidebarPlacesChooser({\n places,\n chosen,\n onChange,\n title = \"Above More\",\n}: {\n places: readonly SidebarPlace[];\n chosen: readonly string[];\n /** The next chosen ids, in `places` order. */\n onChange: (next: string[]) => void;\n title?: string;\n}) {\n const flip = (id: string) =>\n onChange(places.filter((p) => (p.id === id ? !chosen.includes(id) : chosen.includes(p.id))).map((p) => p.id));\n return (\n <section className=\"flex flex-col gap-1\" data-sidebar-places-chooser=\"\">\n <span className=\"text-sm font-medium text-foreground\">{title}</span>\n {places.map((p) => {\n const Icon = p.icon;\n return (\n <label key={p.id} className=\"flex h-8 cursor-pointer items-center gap-2 rounded-md px-1 text-sm hover:bg-muted\">\n <Checkbox size=\"sm\" checked={chosen.includes(p.id)} onCheckedChange={() => flip(p.id)} />\n <Icon className=\"size-4 text-muted-foreground\" />\n <span className=\"text-foreground\">{p.label}</span>\n </label>\n );\n })}\n </section>\n );\n}\n\n/** The Edit sidebar dialog's chrome: title, the host's sections, a refusal line, Cancel / Save. */\nexport function SidebarEditDialog({\n open,\n onOpenChange,\n onSave,\n refusal,\n saveLabel = \"Save as my default\",\n children,\n}: {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n onSave: () => void;\n /** Why the last save was refused; shown in the dialog. */\n refusal?: string | null | undefined;\n saveLabel?: string;\n children: ReactNode;\n}) {\n return (\n <Dialog open={open} onOpenChange={onOpenChange}>\n <DialogContent size=\"sm\" onOpenAutoFocus={(e) => e.preventDefault()}>\n <DialogHeader>\n <DialogTitle>Edit sidebar</DialogTitle>\n </DialogHeader>\n <div className=\"flex flex-col gap-4\">\n {children}\n <div className=\"h-5 truncate text-sm text-destructive\" role=\"status\">\n {refusal ?? \"\"}\n </div>\n </div>\n <DialogFooter>\n <Button variant=\"ghost\" onClick={() => onOpenChange(false)}>\n Cancel\n </Button>\n <Button onClick={onSave}>{saveLabel}</Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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