@arbidocs/blocks 0.4.30 → 0.4.32

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 (38) hide show
  1. package/dist/agents/index.cjs +211 -211
  2. package/dist/agents/index.js +2 -2
  3. package/dist/{chunk-CRIKTUEU.cjs → chunk-46IU3UPF.cjs} +3 -3
  4. package/dist/{chunk-CRIKTUEU.cjs.map → chunk-46IU3UPF.cjs.map} +1 -1
  5. package/dist/{chunk-ZJ6RIPFS.js → chunk-C75S6USL.js} +70 -11
  6. package/dist/chunk-C75S6USL.js.map +1 -0
  7. package/dist/{chunk-U2E3WT3J.js → chunk-D5T53XCL.js} +3 -3
  8. package/dist/{chunk-U2E3WT3J.js.map → chunk-D5T53XCL.js.map} +1 -1
  9. package/dist/{chunk-LXC5PTTI.cjs → chunk-GVQOBJKR.cjs} +71 -9
  10. package/dist/chunk-GVQOBJKR.cjs.map +1 -0
  11. package/dist/{chunk-G4YOH5DU.cjs → chunk-LPXAWW62.cjs} +4 -4
  12. package/dist/chunk-LPXAWW62.cjs.map +1 -0
  13. package/dist/{chunk-HER7MTRR.js → chunk-PH7YTYYH.js} +4 -4
  14. package/dist/chunk-PH7YTYYH.js.map +1 -0
  15. package/dist/{chunk-LGKYEAA3.cjs → chunk-PLGVMLBD.cjs} +5 -5
  16. package/dist/{chunk-LGKYEAA3.cjs.map → chunk-PLGVMLBD.cjs.map} +1 -1
  17. package/dist/{chunk-J7IXAJWT.js → chunk-TZ4QF7EP.js} +5 -5
  18. package/dist/{chunk-J7IXAJWT.js.map → chunk-TZ4QF7EP.js.map} +1 -1
  19. package/dist/index.cjs +303 -291
  20. package/dist/index.js +5 -5
  21. package/dist/retrieval/index.cjs +36 -36
  22. package/dist/retrieval/index.js +1 -1
  23. package/dist/settings/index.cjs +8 -8
  24. package/dist/settings/index.cjs.map +1 -1
  25. package/dist/settings/index.js +6 -6
  26. package/dist/settings/index.js.map +1 -1
  27. package/dist/shell/ActionCluster.d.ts +2 -1
  28. package/dist/shell/StatusRow.d.ts +8 -0
  29. package/dist/shell/index.cjs +54 -42
  30. package/dist/shell/index.d.ts +2 -1
  31. package/dist/shell/index.js +1 -1
  32. package/dist/shell/status-row-styles.d.ts +8 -0
  33. package/package.json +3 -3
  34. package/src/tokens.css +23 -23
  35. package/dist/chunk-G4YOH5DU.cjs.map +0 -1
  36. package/dist/chunk-HER7MTRR.js.map +0 -1
  37. package/dist/chunk-LXC5PTTI.cjs.map +0 -1
  38. package/dist/chunk-ZJ6RIPFS.js.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/shell/sidebar-context.ts","../src/shell/SidebarBadgeRow.tsx","../src/shell/Sidebar.tsx","../src/shell/SidebarRowAction.tsx","../src/shell/Workspace.tsx","../src/shell/AskField.tsx","../src/shell/MobileBars.tsx","../src/shell/install-instructions.ts","../src/shell/use-install-prompt.ts","../src/shell/InstallPrompt.tsx","../src/shell/ActionCluster.tsx","../src/shell/StatusRow.tsx","../src/shell/OfflinePill.tsx","../src/shell/RemoteControlPill.tsx","../src/shell/TipCard.tsx","../src/lib/sidebar-mode.ts","../src/shell/InfoBar.tsx","../src/shell/SplitLayout.tsx"],"names":["SidebarBadgeRow","jsxs","jsx","cn","Tooltip","TooltipTrigger","TooltipContent","useContext","Fragment","X","useRef","useState","TONES","TriangleAlert","Button","useEffect","Lightbulb"],"mappings":";;;;;;;;;;AAYO,IAAM,sBAAA,GAAwC;AAAA,EACnD,cAAA,EAAgB,iBAAA;AAAA,EAChB,WAAA,EAAa,cAAA;AAAA,EACb,WAAA,EAAa,cAAA;AAAA,EACb,mBAAA,EAAqB;AACvB;AAOO,IAAM,iBAAiB,aAAA,CAAmC;AAAA,EAC/D,QAAA,EAAU,IAAA;AAAA,EACV,MAAA,EAAQ;AACV,CAAC,CAAA;AACM,IAAM,iBAAA,GAAoB,MAA2B,UAAA,CAAW,cAAc;AAG9E,IAAM,sBAAA,GAAyB,cAAc,KAAK;AC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AA;AAAA,cACT,uBAAA;AAAA,cACA,gBAAgB,aAAa,CAAA;AAAA,cAC7B,yBAAA,IAA6B,SAAA;AAAA,cAC7B,mBAAmB,cAAA,GAAiB,cAAA;AAAA,cACpC;AAAA,aACF;AAAA,YAEC,QAAA,EAAA;AAAA;AAAA;AACH;AAAA;AAAA,GACF;AAEJ","file":"chunk-ZJ6RIPFS.js","sourcesContent":["import { createContext, useContext } from 'react'\n\n/** Fixed strings of the sidebar family. Set once on `Sidebar.Root`; parts read them from context. */\nexport interface SidebarLabels {\n /** The sidebar's accessible name (the Root `aria-label` prop wins). */\n mainNavigation: string\n hideSidebar: string\n showSidebar: string\n /** The drawer's close button (the `closeLabel` prop wins). */\n closeNavigationMenu: string\n}\n\nexport const DEFAULT_SIDEBAR_LABELS: SidebarLabels = {\n mainNavigation: 'Main navigation',\n hideSidebar: 'Hide sidebar',\n showSidebar: 'Show sidebar',\n closeNavigationMenu: 'Close navigation menu',\n}\n\nexport interface SidebarContextValue {\n /** Labels are visible (full width), as opposed to the icon-only rail. */\n expanded: boolean\n labels: SidebarLabels\n}\nexport const SidebarContext = createContext<SidebarContextValue>({\n expanded: true,\n labels: DEFAULT_SIDEBAR_LABELS,\n})\nexport const useSidebarContext = (): SidebarContextValue => useContext(SidebarContext)\n\n/** True while the surrounding row is hovered/focused; trailing controls may brighten on it. */\nexport const SidebarRowHoverContext = createContext(false)\n","import { forwardRef, type ButtonHTMLAttributes, type ReactNode } from 'react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { useSidebarContext } from './sidebar-context'\n\nexport interface SidebarBadgeRowProps extends Omit<\n ButtonHTMLAttributes<HTMLButtonElement>,\n 'children'\n> {\n /** Glyph (20px). */\n icon: ReactNode\n /** Visible label of the expanded row; the tooltip of the icon-only rail. */\n label: string\n /** Unread/pending number. Hidden at 0 or `undefined`; values above 9 read \"9+\". */\n count?: number\n /**\n * Accessible name including the count, for example \"Notifications, 2 unread\". Defaults to\n * `label` plus the count.\n */\n ariaLabel?: string\n /**\n * `row`: a labelled row styled like the module rows, badge at the right. `icon`: icon-only with\n * the badge on the corner. Default follows the sidebar (`row` expanded, `icon` on the rail).\n */\n variant?: 'row' | 'icon'\n /** Test id of the count badge. */\n badgeTestId?: string\n}\n\n/**\n * A sidebar row that carries a badge and may open something (a panel, a popover): the\n * notifications and contacts rows above the account bar. A real button that forwards its ref and\n * rest props, so it can be a popover trigger (`<DropdownMenuTrigger asChild>`). The badge is\n * visible in both the expanded row and the icon-only rail, and the accessible name carries the\n * count in both.\n */\nexport const SidebarBadgeRow = forwardRef<HTMLButtonElement, SidebarBadgeRowProps>(\n function SidebarBadgeRow(\n { icon, label, count, ariaLabel, variant, badgeTestId, className, type = 'button', ...rest },\n ref\n ) {\n const { expanded } = useSidebarContext()\n const resolved = variant ?? (expanded ? 'row' : 'icon')\n const hasCount = count !== undefined && count > 0\n const badgeText = hasCount ? (count > 9 ? '9+' : String(count)) : null\n const name = ariaLabel ?? (hasCount ? `${label}, ${count}` : label)\n\n if (resolved === 'row') {\n return (\n <button\n ref={ref}\n type={type}\n aria-label={name}\n data-slot=\"sidebar-badge-row\"\n data-variant=\"row\"\n className={cn(\n 'group flex h-9 w-full cursor-pointer items-center rounded-md px-3 text-left text-sm font-medium text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-11',\n className\n )}\n {...rest}\n >\n <span className=\"flex size-5 flex-shrink-0 items-center justify-center\" aria-hidden>\n {icon}\n </span>\n <span className=\"ml-3 min-w-0 truncate\" aria-hidden>\n {label}\n </span>\n {badgeText && (\n <span\n aria-hidden\n data-testid={badgeTestId}\n className=\"ml-auto inline-flex min-w-5 flex-shrink-0 items-center justify-center rounded-full bg-primary px-1.5 text-xs font-semibold leading-5 tabular-nums text-primary-foreground\"\n >\n {badgeText}\n </span>\n )}\n </button>\n )\n }\n\n const iconButton = (\n <button\n ref={ref}\n type={type}\n aria-label={name}\n data-slot=\"sidebar-badge-row\"\n data-variant=\"icon\"\n title={variant === 'icon' ? label : undefined}\n className={cn(\n 'relative m-0 flex h-9 w-12 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:h-11',\n className\n )}\n {...rest}\n >\n <span className=\"flex size-5 items-center justify-center\" aria-hidden>\n {icon}\n </span>\n {badgeText && (\n <span\n aria-hidden\n data-testid={badgeTestId}\n className=\"absolute right-1 top-0.5 flex min-w-4 items-center justify-center rounded-full bg-primary px-1 text-xs font-semibold leading-4 tabular-nums text-primary-foreground\"\n >\n {badgeText}\n </span>\n )}\n </button>\n )\n // A standalone icon button (the page header) keeps its native title; the rail uses a tooltip.\n if (variant === 'icon') return iconButton\n return (\n <Tooltip delayDuration={50}>\n <TooltipTrigger asChild>{iconButton}</TooltipTrigger>\n <TooltipContent side=\"right\" sideOffset={8}>\n {label}\n </TooltipContent>\n </Tooltip>\n )\n }\n)\n","import { useMemo, useRef, useState, type CSSProperties, type ReactNode } from 'react'\nimport { PanelLeftClose, PanelLeftOpen, X } from 'lucide-react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport {\n DEFAULT_SIDEBAR_LABELS,\n SidebarContext,\n SidebarRowHoverContext,\n useSidebarContext,\n type SidebarLabels,\n} from './sidebar-context'\nimport { SidebarBadgeRow } from './SidebarBadgeRow'\nimport { ActionLink } from '../components/ActionLink'\nimport { BlocksTooltipProvider } from '../provider/TooltipScope'\nimport { useDrawerBehavior } from '../lib/use-drawer'\nimport type { SidebarMode } from '../lib/sidebar-mode'\nimport type { NavItem } from './types'\n\n/**\n * Sidebar: the one tinted column that carries the app frame. Compound parts:\n * Sidebar.Root positioning shell for the four modes (drawer / collapsed / pinned / rail)\n * Sidebar.Header top block (switcher, ask field, pin toggle)\n * Sidebar.Nav the rows: pass `items` (NavItem[]) or compose Sidebar.NavItem children\n * Sidebar.Group a labelled run of rows (heading when expanded, divider on the rail)\n * Sidebar.Footer pinned to the bottom (offline pill, tips card, action cluster)\n * Sidebar.PinToggle / Sidebar.DrawerHeader the header's two stock controls\n *\n * Presentational and controlled: the app resolves `mode`/`expanded` (see `resolveSidebarLayout`\n * and `useSidebarSettle`) and owns where hover/pin/drawer state lives.\n */\n\nconst noop = () => {}\n\nconst COLLAPSED_WIDTH = '64px'\nconst EXPANDED_WIDTH = '256px'\n\nexport interface SidebarRootProps {\n mode: SidebarMode\n /** Labels visible. Provided to every part through context. */\n expanded: boolean\n /** `rail` mode: floats open to full width. */\n isHovering?: boolean\n /** `collapsed` mode: revealed (peek) at full width. */\n isPeeking?: boolean\n onBackdropClick?: () => void\n /** `rail` mode on touch: the floated-open rail dims the content behind it; tapping it closes. */\n hasRailBackdrop?: boolean\n onMouseEnter?: () => void\n onMouseLeave?: () => void\n children: ReactNode\n className?: string\n 'aria-label'?: string\n labels?: Partial<SidebarLabels>\n /** Root id (default `sidebar`). */\n 'data-testid'?: string\n /** Drawer backdrop id (default `sidebar-backdrop`). */\n backdropTestId?: string\n}\n\nfunction SidebarRoot({\n mode,\n expanded,\n isHovering = false,\n isPeeking = false,\n onBackdropClick,\n hasRailBackdrop = false,\n onMouseEnter,\n onMouseLeave,\n children,\n className,\n 'aria-label': ariaLabelProp,\n labels,\n 'data-testid': testId,\n backdropTestId,\n}: SidebarRootProps) {\n const mergedLabels = useMemo(() => ({ ...DEFAULT_SIDEBAR_LABELS, ...labels }), [labels])\n // The drawer is a modal: scroll lock, Escape, focus trap and focus return to the opener.\n const drawerRef = useRef<HTMLDivElement>(null)\n const isDrawer = mode === 'drawer'\n useDrawerBehavior(isDrawer, onBackdropClick ?? noop, drawerRef)\n const ariaLabel = ariaLabelProp ?? mergedLabels.mainNavigation\n const contextValue = useMemo(() => ({ expanded, labels: mergedLabels }), [expanded, mergedLabels])\n // `navBase` omits horizontal padding so each mode owns its own: the collapsed state must\n // reach a true 0 width, which an `!important` px would block.\n const navBase =\n 'group/sidebar bg-sidebar border-r border-border text-foreground scrollbar-themed flex flex-col h-full overflow-y-auto overflow-x-hidden pb-safe pt-3 transition-all duration-300 ease-in-out'\n const common = {\n 'aria-label': ariaLabel,\n 'data-testid': testIdOr(testId, { testId: 'sidebar' }),\n 'data-slot': 'sidebar',\n 'data-mode': mode,\n } as const\n const fixedWidth: CSSProperties = { width: EXPANDED_WIDTH, minWidth: EXPANDED_WIDTH }\n\n let body: ReactNode\n if (mode === 'drawer') {\n // Small-screen off-canvas panel + dismiss backdrop; bypasses the hover/collapse model. The\n // wrapper is the modal dialog; the nav landmark sits inside it.\n body = (\n <div\n ref={drawerRef}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={ariaLabel}\n data-slot=\"sidebar-drawer\"\n className=\"fixed inset-0 z-50\"\n >\n <div\n className=\"absolute inset-0 bg-black/50\"\n onClick={onBackdropClick}\n aria-hidden=\"true\"\n data-testid={testIdOr(backdropTestId, { testId: 'sidebar-backdrop' })}\n />\n <nav\n {...common}\n className={cn(navBase, '!px-3 absolute left-0 top-0 pt-safe shadow-xl', className)}\n style={fixedWidth}\n >\n {children}\n </nav>\n </div>\n )\n } else if (mode === 'collapsed') {\n // Stays mounted at width 0 so the transition runs on both enter and leave. Horizontal padding\n // is dropped when hidden or overflow-hidden would reveal a clipped sliver of the icons.\n body = (\n <nav\n {...common}\n className={cn(navBase, 'absolute left-0 top-0 z-[45]', isPeeking && 'shadow-xl', className)}\n style={{\n width: isPeeking ? EXPANDED_WIDTH : '0px',\n minWidth: 0,\n paddingLeft: isPeeking ? '0.75rem' : 0,\n paddingRight: isPeeking ? '0.75rem' : 0,\n borderRightWidth: isPeeking ? undefined : 0,\n pointerEvents: isPeeking ? 'auto' : 'none',\n }}\n // Width 0 hides the links visually; inert also takes them out of the tab order and the\n // accessibility tree until the sidebar is revealed.\n inert={!isPeeking}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n {children}\n </nav>\n )\n } else if (mode === 'pinned') {\n body = (\n <nav\n {...common}\n className={cn(navBase, '!px-3 relative flex-shrink-0', className)}\n style={fixedWidth}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n {children}\n </nav>\n )\n } else {\n // Rail: a permanent spacer keeps the flex layout still; the nav is always absolute so only\n // its width animates on hover (no layout jump).\n body = (\n <>\n <div\n className=\"bg-sidebar border-r border-border flex flex-col h-full relative px-0 pb-safe flex-shrink-0\"\n style={{ width: COLLAPSED_WIDTH, minWidth: COLLAPSED_WIDTH }}\n aria-hidden=\"true\"\n />\n {isHovering && hasRailBackdrop && (\n <div\n className=\"fixed inset-0 z-[44] bg-black/40\"\n onClick={onBackdropClick}\n aria-hidden=\"true\"\n data-testid={testIdOr(backdropTestId, { testId: 'sidebar-backdrop' })}\n />\n )}\n <nav\n {...common}\n className={cn(\n navBase,\n isHovering ? '!px-3 shadow-xl' : '!px-2',\n 'absolute left-0 top-0 z-[45]',\n className\n )}\n style={{\n width: isHovering ? EXPANDED_WIDTH : COLLAPSED_WIDTH,\n minWidth: isHovering ? EXPANDED_WIDTH : COLLAPSED_WIDTH,\n }}\n onMouseEnter={onMouseEnter}\n onMouseLeave={onMouseLeave}\n >\n {children}\n </nav>\n </>\n )\n }\n\n return (\n <SidebarContext.Provider value={contextValue}>\n <BlocksTooltipProvider>{body}</BlocksTooltipProvider>\n </SidebarContext.Provider>\n )\n}\n\nexport interface SidebarSectionProps {\n children: ReactNode\n className?: string\n 'data-testid'?: string\n}\n\nfunction SidebarHeader({ children, className, 'data-testid': testId }: SidebarSectionProps) {\n return (\n <div\n data-slot=\"sidebar-header\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-3 pb-3', className)}\n >\n {children}\n </div>\n )\n}\n\nexport interface SidebarNavProps extends Omit<SidebarSectionProps, 'children'> {\n children?: ReactNode\n /** Rows as data. Children render after them. */\n items?: NavItem[]\n}\n\nfunction SidebarNav({ items, children, className, 'data-testid': testId }: SidebarNavProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n data-slot=\"sidebar-nav\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-0.5', !expanded && 'items-center', className)}\n >\n {items?.map((item) => (\n <SidebarNavItem key={item.id} {...item} />\n ))}\n {children}\n </div>\n )\n}\n\nexport interface SidebarGroupProps extends SidebarSectionProps {\n /** Group heading. Shown above the rows when expanded; a thin divider stands in on the rail. */\n label?: ReactNode\n /** Accessible name when `label` is not plain text. */\n ariaLabel?: string\n}\n\n/** A labelled run of rows inside the nav (for example \"Workspace\", \"Tools\"). */\nfunction SidebarGroup({\n label,\n ariaLabel,\n children,\n className,\n 'data-testid': testId,\n}: SidebarGroupProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n role=\"group\"\n aria-label={ariaLabel ?? (typeof label === 'string' ? label : undefined)}\n data-slot=\"sidebar-group\"\n data-testid={testId}\n className={cn('flex flex-shrink-0 flex-col gap-0.5', !expanded && 'items-center', className)}\n >\n {label &&\n (expanded ? (\n <SidebarGroupLabel>{label}</SidebarGroupLabel>\n ) : (\n <div\n role=\"separator\"\n data-slot=\"sidebar-group-divider\"\n className=\"my-1 h-px w-6 bg-border\"\n />\n ))}\n {children}\n </div>\n )\n}\n\n/** The heading of a `Sidebar.Group` (exported for custom headings). Hidden by the group on the rail. */\nfunction SidebarGroupLabel({ children, className }: { children: ReactNode; className?: string }) {\n return (\n <div\n data-slot=\"sidebar-group-label\"\n className={cn(\n 'px-2 pb-0.5 pt-2 text-xs font-medium uppercase tracking-wide text-muted-foreground',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nfunction SidebarFooter({ children, className, 'data-testid': testId }: SidebarSectionProps) {\n const { expanded } = useSidebarContext()\n return (\n <div\n data-slot=\"sidebar-footer\"\n data-testid={testId}\n className={cn(\n 'mt-auto flex flex-shrink-0 flex-col gap-2 pt-3 pb-3',\n !expanded && 'items-center',\n className\n )}\n >\n {children}\n </div>\n )\n}\n\nexport type SidebarNavItemProps = Omit<NavItem, 'id'> & {\n id?: string\n className?: string\n /** Tooltip shown on the icon-only rail; defaults to the label. */\n tooltip?: string\n}\n\n/**\n * One row: [icon] [label] [count] [trailing]. 36px (44px on coarse pointers). The active row is\n * the selection tint, never a filled block; counts are quiet numbers, not pills.\n *\n * The expanded row is a div with role=\"button\" (not a native <button>) so an interactive\n * `trailing` control can be nested without producing button-in-button markup.\n */\nfunction SidebarNavItem({\n label,\n icon,\n active = false,\n onSelect,\n href,\n count,\n countIcon,\n testId,\n disabled = false,\n trailing,\n className,\n tooltip,\n}: SidebarNavItemProps) {\n const { expanded } = useSidebarContext()\n // Tracked as state (not CSS :hover) so a trailing control can read it via context.\n const [isRowActive, setIsRowActive] = useState(false)\n const tip = expanded ? undefined : (tooltip ?? label)\n\n if (!expanded) {\n const railButton = (\n <ActionLink\n href={href}\n onSelect={onSelect}\n disabled={disabled}\n aria-label={label}\n aria-current={active ? 'page' : undefined}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={cn(\n 'm-0 flex h-9 w-12 items-center justify-center rounded-md transition-colors pointer-coarse:h-11',\n active\n ? 'bg-accent text-accent-foreground'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground',\n disabled && 'pointer-events-none cursor-not-allowed opacity-30',\n className\n )}\n >\n <div className=\"flex size-5 items-center justify-center\">{icon}</div>\n </ActionLink>\n )\n if (!tip) return railButton\n return (\n <Tooltip delayDuration={50}>\n <TooltipTrigger asChild>{railButton}</TooltipTrigger>\n <TooltipContent side=\"right\" sideOffset={8}>\n {tip}\n </TooltipContent>\n </Tooltip>\n )\n }\n\n const rowClass = cn(\n 'group flex h-9 w-full cursor-pointer items-center rounded-md px-3 text-sm transition-colors pointer-coarse:h-11',\n active\n ? 'bg-accent font-semibold text-accent-foreground'\n : 'font-medium text-muted-foreground hover:bg-muted hover:text-foreground',\n disabled && 'pointer-events-none cursor-not-allowed opacity-30',\n className\n )\n const countNode = count !== undefined && (\n <span\n // `ml-auto` lines the counts up on the right edge as one column of numbers.\n className={cn(\n 'ml-auto inline-flex flex-shrink-0 items-center gap-0.5 pl-2 text-xs font-normal tabular-nums',\n active ? 'text-accent-foreground' : 'text-muted-foreground'\n )}\n >\n {countIcon}\n {count}\n </span>\n )\n\n // A link row without a nested control is the anchor itself.\n if (href && !disabled && !trailing) {\n return (\n <ActionLink\n href={href}\n onSelect={onSelect}\n aria-current={active ? 'page' : undefined}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={rowClass}\n >\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n </ActionLink>\n )\n }\n\n // A link row with a nested control: a stretched anchor sits under the content, and the\n // trailing control rises above it, so there is never an interactive element inside an anchor.\n if (href && !disabled) {\n return (\n <div\n onMouseEnter={() => setIsRowActive(true)}\n onMouseLeave={() => setIsRowActive(false)}\n onFocusCapture={() => setIsRowActive(true)}\n onBlurCapture={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setIsRowActive(false)\n }}\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={cn(rowClass, 'relative')}\n >\n <ActionLink\n href={href}\n onSelect={onSelect}\n aria-label={label}\n aria-current={active ? 'page' : undefined}\n className=\"absolute inset-0 rounded-md focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n />\n <div className=\"pointer-events-none flex min-w-0 flex-1 items-center\">\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n </div>\n <SidebarRowHoverContext.Provider value={isRowActive}>\n <span className=\"relative ml-2 flex flex-shrink-0 items-center\">{trailing}</span>\n </SidebarRowHoverContext.Provider>\n </div>\n )\n }\n\n return (\n <div\n role=\"button\"\n tabIndex={disabled ? -1 : 0}\n aria-current={active ? 'page' : undefined}\n onClick={disabled ? undefined : onSelect}\n onMouseEnter={() => setIsRowActive(true)}\n onMouseLeave={() => setIsRowActive(false)}\n onFocusCapture={() => setIsRowActive(true)}\n onBlurCapture={(e) => {\n if (!e.currentTarget.contains(e.relatedTarget as Node | null)) setIsRowActive(false)\n }}\n onKeyDown={\n disabled\n ? undefined\n : (e) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n onSelect()\n }\n }\n }\n data-slot=\"sidebar-nav-item\"\n data-testid={testId}\n className={rowClass}\n >\n <div className=\"flex size-5 flex-shrink-0 items-center justify-center\">{icon}</div>\n <span className=\"ml-3 min-w-0 truncate text-left\">{label}</span>\n {countNode}\n {trailing && (\n <SidebarRowHoverContext.Provider value={isRowActive}>\n <span className=\"ml-2 flex flex-shrink-0 items-center\">{trailing}</span>\n </SidebarRowHoverContext.Provider>\n )}\n </div>\n )\n}\n\nexport interface SidebarPinToggleProps {\n isPinned: boolean\n onToggle: () => void\n className?: string\n /** Default `sidebar-pin-button`. */\n 'data-testid'?: string\n}\n\n/**\n * Pin/unpin button, revealed while the pointer is over the sidebar. It is always visible on\n * coarse pointers (no hover on touch) and revealed by keyboard focus anywhere in the sidebar. It\n * is hidden with opacity and pointer-events, never display:none, so it keeps its accessible name\n * and stays in the tab order.\n */\nfunction SidebarPinToggle({\n isPinned,\n onToggle,\n className,\n 'data-testid': testId,\n}: SidebarPinToggleProps) {\n const { expanded, labels } = useSidebarContext()\n const label = isPinned ? labels.hideSidebar : labels.showSidebar\n return (\n <button\n type=\"button\"\n onClick={onToggle}\n title={label}\n aria-label={label}\n aria-pressed={isPinned}\n data-testid={testIdOr(testId, { testId: 'sidebar-pin-button' })}\n className={cn(\n 'flex flex-shrink-0 items-center justify-center rounded-md text-muted-foreground transition-[opacity,colors] hover:bg-muted hover:text-foreground pointer-coarse:size-11',\n 'pointer-events-none opacity-0 group-hover/sidebar:pointer-events-auto group-hover/sidebar:opacity-100',\n 'group-focus-within/sidebar:pointer-events-auto group-focus-within/sidebar:opacity-100',\n 'pointer-coarse:pointer-events-auto pointer-coarse:opacity-100 focus-visible:pointer-events-auto focus-visible:opacity-100',\n expanded ? 'size-9' : 'h-9 w-12',\n className\n )}\n >\n {isPinned ? <PanelLeftClose className=\"size-5\" /> : <PanelLeftOpen className=\"size-5\" />}\n </button>\n )\n}\n\nexport interface SidebarDrawerHeaderProps {\n /** Brand mark. */\n logo: ReactNode\n onClose: () => void\n closeLabel?: string\n /** Close button id (default `mobile-nav-close`). */\n 'data-testid'?: string\n}\n\n/** The phone drawer's header: brand mark and a 44px close button. */\nfunction SidebarDrawerHeader({\n logo,\n onClose,\n closeLabel: closeLabelProp,\n 'data-testid': testId,\n}: SidebarDrawerHeaderProps) {\n const { labels } = useSidebarContext()\n const closeLabel = closeLabelProp ?? labels.closeNavigationMenu\n return (\n <div\n data-slot=\"sidebar-drawer-header\"\n className=\"flex flex-shrink-0 items-center justify-between pb-2\"\n >\n {logo}\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={closeLabel}\n data-testid={testIdOr(testId, { testId: 'mobile-nav-close' })}\n className=\"flex size-11 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n )\n}\n\nexport { DEFAULT_SIDEBAR_LABELS, SidebarRowHoverContext, useSidebarContext, type SidebarLabels }\n\nexport const Sidebar = {\n Root: SidebarRoot,\n Header: SidebarHeader,\n Nav: SidebarNav,\n Group: SidebarGroup,\n GroupLabel: SidebarGroupLabel,\n NavItem: SidebarNavItem,\n Footer: SidebarFooter,\n PinToggle: SidebarPinToggle,\n BadgeRow: SidebarBadgeRow,\n DrawerHeader: SidebarDrawerHeader,\n}\n","import { useContext, type ReactNode } from 'react'\nimport { cn, Tooltip, TooltipContent, TooltipTrigger } from '@arbidocs/react/ui'\nimport { BlocksTooltipProvider } from '../provider/TooltipScope'\nimport { SidebarRowHoverContext } from './Sidebar'\n\nexport type SidebarRowActionPulse = 'active' | 'success' | 'error'\n\nexport interface SidebarRowActionProps {\n /** The row this control sits on is selected: the glyph takes the selection ink. */\n active?: boolean\n onClick?: () => void\n /** Tooltip text and accessible label. */\n label: string\n /** Reflected as aria-pressed for toggle controls. */\n pressed?: boolean\n /**\n * Demand attention while the row is idle: `active` pulses primary (work in progress),\n * `success` pulses green (just finished), `error` is a steady red alert. A selected row wins.\n */\n pulse?: SidebarRowActionPulse | null\n 'data-testid'?: string\n children: ReactNode\n}\n\nconst PULSE_STYLES: Record<SidebarRowActionPulse, string> = {\n active: 'animate-pulse-attention text-primary',\n success: 'animate-pulse-attention text-green-text',\n // Steady (not animated) so a failure stays put and reads as a standing alert.\n error: 'text-red-text opacity-100',\n}\n\n/**\n * The secondary control at the right edge of a sidebar row: a small muted glyph. Always visible\n * (touch has no hover); hovering or focusing the row only brightens it a tone, through\n * SidebarRowHoverContext. Stops propagation so it never triggers the row's own click.\n */\nexport function SidebarRowAction({\n active = false,\n onClick,\n label,\n pressed,\n pulse = null,\n 'data-testid': testId,\n children,\n}: SidebarRowActionProps) {\n const rowHovered = useContext(SidebarRowHoverContext)\n\n const tone = active\n ? 'text-accent-foreground hover:bg-background/60'\n : pulse\n ? `${PULSE_STYLES[pulse]} hover:bg-muted`\n : cn(\n 'text-muted-foreground hover:bg-muted hover:text-foreground',\n rowHovered ? 'opacity-100' : 'opacity-70'\n )\n\n return (\n <BlocksTooltipProvider>\n <Tooltip>\n <TooltipTrigger asChild onFocusCapture={(e) => e.stopPropagation()}>\n <button\n type=\"button\"\n onClick={(e) => {\n e.stopPropagation()\n onClick?.()\n }}\n aria-label={label}\n aria-pressed={pressed}\n data-slot=\"sidebar-row-action\"\n data-testid={testId}\n className={cn('rounded-md p-1 transition-colors pointer-coarse:p-2.5', tone)}\n >\n {children}\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"right\">{label}</TooltipContent>\n </Tooltip>\n </BlocksTooltipProvider>\n )\n}\n","import type { ComponentType } from 'react'\nimport { ChevronDown, Globe, LayoutGrid, Lock, Plus, Users } from 'lucide-react'\nimport {\n cn,\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '@arbidocs/react/ui'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport type { ShellRecentWorkspace, ShellWorkspace, ShellWorkspaceKind } from './types'\n\n/** The three workspace-kind names (badge title, type glyph name, subtitle). */\nexport interface WorkspaceKindLabels {\n common: string\n shared: string\n private: string\n}\n\nexport const DEFAULT_WORKSPACE_KIND_LABELS: WorkspaceKindLabels = {\n common: 'Common',\n shared: 'Shared',\n private: 'Private',\n}\n\n/**\n * Workspace type drives the initial-badge fill and a quiet secondary glyph:\n * private (just you) -> navy, lock shared (several) -> selection tint, people\n * common (public) -> neutral, globe\n * Navy is identity and cyan is reserved for ARBI/AI, so \"shared\" is the selection tint.\n */\nexport function workspaceKindMeta(\n kind: ShellWorkspaceKind,\n labels?: Partial<WorkspaceKindLabels>\n): {\n Icon: ComponentType<{ className?: string; 'aria-label'?: string; 'data-testid'?: string }>\n label: string\n fill: string\n} {\n const l = { ...DEFAULT_WORKSPACE_KIND_LABELS, ...labels }\n if (kind === 'common')\n return { Icon: Globe, label: l.common, fill: 'bg-muted text-muted-foreground' }\n if (kind === 'shared')\n return { Icon: Users, label: l.shared, fill: 'bg-accent text-accent-foreground' }\n return { Icon: Lock, label: l.private, fill: 'bg-primary text-primary-foreground' }\n}\n\n/** The kind's hue as a CSS colour, for glyphs painted by SVG fill (the workspace shield). */\nexport function workspaceKindColor(kind: ShellWorkspaceKind): string {\n if (kind === 'common') return 'var(--color-muted-foreground)'\n if (kind === 'shared') return 'var(--color-secondary)'\n return 'var(--color-primary)'\n}\n\n/** Overridable ids of the workspace identity; defaults are the current ids. */\nexport type WorkspaceIdentityTestIds = Partial<Record<'initial' | 'type' | 'projectName', string>>\n\nexport interface WorkspaceIdentityProps {\n workspace: ShellWorkspace\n /** Show name + type/project line beside the badge; otherwise the badge alone. */\n expanded: boolean\n /** Selected (nav-row) styling of the name. */\n isActive?: boolean\n /** Reword the kind names. */\n labels?: Partial<WorkspaceKindLabels>\n /** Part ids; defaults are the current ids. */\n testIds?: WorkspaceIdentityTestIds\n}\n\n/**\n * Non-interactive guts of the workspace head: the initial badge (with a tiny type glyph) and,\n * when expanded, the name and the project/type line. Hosted by the switcher trigger and by the\n * workspace settings header, so it never nests a button.\n */\nexport function WorkspaceIdentity({\n workspace,\n expanded,\n isActive = false,\n labels,\n testIds,\n}: WorkspaceIdentityProps) {\n const kind = workspaceKindMeta(workspace.kind, labels)\n const badge = (\n <span className=\"relative flex flex-shrink-0\" title={kind.label}>\n <span\n aria-hidden=\"true\"\n data-testid={testIdOr(testIds?.initial, { testId: 'sidebar-workspace-card-initial' })}\n className={cn(\n 'flex size-7 flex-shrink-0 items-center justify-center rounded-md text-sm font-semibold leading-none',\n kind.fill\n )}\n >\n {workspace.name.charAt(0).toUpperCase()}\n </span>\n {/* Type as a tiny overlay on the badge: status reads at the icon, not after the name. */}\n <span className=\"absolute -bottom-1 -right-1 flex size-3.5 items-center justify-center rounded-full bg-background ring-1 ring-border\">\n <kind.Icon\n aria-label={kind.label}\n data-testid={testIdOr(testIds?.type, { testId: 'sidebar-workspace-card-type' })}\n className=\"size-2.5 text-muted-foreground\"\n />\n </span>\n </span>\n )\n\n if (!expanded)\n return <div className=\"flex flex-shrink-0 items-center justify-center\">{badge}</div>\n\n return (\n <>\n <div className=\"flex flex-shrink-0 items-center justify-center\">{badge}</div>\n <div className=\"ml-2.5 flex min-w-0 flex-1 flex-col text-left\">\n <span\n // 600: the name of the thing you are inside, above a lighter project line.\n className={cn(\n 'min-w-0 truncate text-left text-sm font-semibold capitalize leading-tight transition-colors duration-100',\n isActive ? 'text-accent-foreground' : 'text-foreground'\n )}\n >\n {workspace.name}\n </span>\n {!workspace.projectName && (\n <span className=\"mt-0.5 truncate text-xs text-muted-foreground\">{kind.label}</span>\n )}\n {workspace.projectName && (\n <span\n className=\"mt-0.5 flex min-w-0\"\n data-testid={testIdOr(testIds?.projectName, {\n testId: 'sidebar-workspace-card-project-name',\n })}\n >\n {workspace.projectLine ?? (\n <span className=\"truncate text-xs text-muted-foreground\">\n {workspace.projectName}\n </span>\n )}\n </span>\n )}\n </div>\n </>\n )\n}\n\n/**\n * Entity nouns plus the switcher's strings. `plural` arrives lowercased and `singular`\n * capitalized in the functions below.\n */\nexport interface WorkspaceSwitcherLabels extends WorkspaceKindLabels {\n /** Entity nouns, e.g. { plural: 'workspaces', singular: 'workspace' }. */\n plural: string\n singular: string\n /** The trigger's accessible name. */\n switchWorkspace: (name: string, plural: string) => string\n allWorkspaces: (plural: string) => string\n newWorkspace: (singular: string) => string\n recentWorkspaces: (plural: string) => string\n}\n\nexport const DEFAULT_WORKSPACE_SWITCHER_LABELS: WorkspaceSwitcherLabels = {\n ...DEFAULT_WORKSPACE_KIND_LABELS,\n plural: 'workspaces',\n singular: 'workspace',\n switchWorkspace: (name, plural) => `${name} — switch ${plural}`,\n allWorkspaces: (plural) => `All ${plural}`,\n newWorkspace: (singular) => `New ${singular}`,\n recentWorkspaces: (plural) => `Recent ${plural}`,\n}\n\nexport interface WorkspaceSwitcherProps {\n workspace: ShellWorkspace\n /** Other workspaces to jump to (the app orders and caps them). */\n recent?: ShellRecentWorkspace[]\n /** Icon-only trigger (the sidebar rail). */\n compact?: boolean\n /** `appbar`: the phone app bar's title, name + chevron on one line. */\n variant?: 'sidebar' | 'appbar'\n onSwitch: (workspace: ShellWorkspace) => void\n /** Return to the workspaces list; leaves the workspace open. */\n onGoToList: () => void\n onNewWorkspace: () => void\n /** Entity nouns and menu strings; any subset (the nouns default to workspace(s)). */\n labels?: Partial<WorkspaceSwitcherLabels>\n className?: string\n /** Trigger id (default `workspace-switcher-trigger`). */\n testId?: string\n /**\n * Part ids; defaults are the current ids. `switchItem`, `type` and `lastSeen` are prefixes\n * (`<prefix>-<workspace id>`).\n */\n testIds?: Partial<Record<'menu' | 'all' | 'new' | 'switchItem' | 'type' | 'lastSeen', string>>\n /** Ids forwarded to the trigger's workspace identity. */\n identityTestIds?: WorkspaceIdentityTestIds\n}\n\n/**\n * The current-workspace control as a dropdown: \"All workspaces\", \"New workspace\", then the\n * recent workspaces to jump straight into.\n */\nexport function WorkspaceSwitcher({\n workspace,\n recent = [],\n compact = false,\n variant = 'sidebar',\n onSwitch,\n onGoToList,\n onNewWorkspace,\n labels,\n className,\n testId,\n testIds,\n identityTestIds,\n}: WorkspaceSwitcherProps) {\n const l = { ...DEFAULT_WORKSPACE_SWITCHER_LABELS, ...labels }\n const plural = l.plural.toLowerCase()\n const singular = l.singular.charAt(0).toUpperCase() + l.singular.slice(1)\n return (\n <DropdownMenu>\n <DropdownMenuTrigger asChild>\n <button\n type=\"button\"\n data-slot=\"workspace-switcher\"\n data-testid={testIdOr(testId, { testId: 'workspace-switcher-trigger' })}\n aria-label={l.switchWorkspace(workspace.name, plural)}\n className={cn(\n 'group flex min-w-0 items-center rounded-md transition-colors duration-100 hover:bg-muted focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',\n variant === 'appbar'\n ? 'h-11 max-w-full gap-1 px-2'\n : compact\n ? 'h-12 w-12 justify-center'\n : 'h-12 w-full px-2',\n className\n )}\n >\n {variant === 'appbar' ? (\n <span className=\"min-w-0 truncate text-base font-semibold text-foreground\">\n {workspace.name}\n </span>\n ) : (\n <WorkspaceIdentity\n workspace={workspace}\n expanded={!compact}\n labels={l}\n testIds={identityTestIds}\n />\n )}\n {!(compact && variant === 'sidebar') && (\n <ChevronDown\n aria-hidden=\"true\"\n className=\"ml-auto size-4 flex-shrink-0 text-muted-foreground transition-transform duration-150 group-data-[state=open]:rotate-180\"\n />\n )}\n </button>\n </DropdownMenuTrigger>\n {/* 256px: lines up with the sidebar's expanded width right under the trigger. */}\n <DropdownMenuContent\n align=\"start\"\n className=\"w-64 max-w-[calc(100vw-1.5rem)]\"\n data-testid={testIdOr(testIds?.menu, { testId: 'workspace-switcher-menu' })}\n >\n <DropdownMenuItem\n onClick={onGoToList}\n data-testid={testIdOr(testIds?.all, { testId: 'workspace-switcher-all' })}\n className=\"gap-2\"\n >\n <LayoutGrid className=\"size-4 flex-shrink-0 text-muted-foreground\" />\n {l.allWorkspaces(plural)}\n </DropdownMenuItem>\n <DropdownMenuItem\n onClick={onNewWorkspace}\n data-testid={testIdOr(testIds?.new, { testId: 'workspace-switcher-new' })}\n className=\"gap-2\"\n >\n <Plus className=\"size-4 flex-shrink-0 text-muted-foreground\" />\n {l.newWorkspace(singular)}\n </DropdownMenuItem>\n {recent.length > 0 && (\n <>\n <DropdownMenuSeparator />\n <DropdownMenuLabel className=\"text-xs font-normal text-muted-foreground\">\n {l.recentWorkspaces(plural)}\n </DropdownMenuLabel>\n {recent.map((w) => {\n const kind = workspaceKindMeta(w.kind, l)\n return (\n <DropdownMenuItem\n key={w.id}\n onClick={() => onSwitch(w)}\n data-testid={prefixedTestId(testIds?.switchItem, w.id, {\n testId: `workspace-switch-${w.id}`,\n })}\n className=\"gap-2\"\n >\n <span className=\"relative flex flex-shrink-0\" title={kind.label}>\n <span\n aria-hidden=\"true\"\n className={cn(\n 'flex size-6 flex-shrink-0 items-center justify-center rounded text-xs font-semibold leading-none',\n kind.fill\n )}\n >\n {w.name.charAt(0).toUpperCase()}\n </span>\n <span className=\"absolute -bottom-1 -right-1 flex size-3 items-center justify-center rounded-full bg-background ring-1 ring-border\">\n <kind.Icon\n aria-label={kind.label}\n data-testid={prefixedTestId(testIds?.type, w.id, {\n testId: `workspace-type-${w.id}`,\n })}\n className=\"size-2 text-muted-foreground\"\n />\n </span>\n </span>\n <span className=\"min-w-0 flex-1 truncate capitalize\">{w.name}</span>\n {w.lastSeen && (\n <span\n className=\"ml-2 flex-shrink-0 text-xs tabular-nums text-muted-foreground\"\n data-testid={prefixedTestId(testIds?.lastSeen, w.id, {\n testId: `workspace-last-seen-${w.id}`,\n })}\n >\n {w.lastSeen}\n </span>\n )}\n </DropdownMenuItem>\n )\n })}\n </>\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n","import type { InputHTMLAttributes, KeyboardEvent, ReactNode, Ref } from 'react'\nimport { ArrowUp, Search, Sparkles, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the ask field, its trigger and the expanded row. */\nexport interface AskFieldLabels {\n /** Input placeholder (the `placeholder` prop wins). */\n placeholder: string\n /** The input's accessible name. */\n inputLabel: string\n search: string\n askAi: string\n /** The icon-only trigger. */\n askOrSearch: string\n closeSearch: string\n}\n\nexport const DEFAULT_ASK_FIELD_LABELS: AskFieldLabels = {\n placeholder: 'Ask or search…',\n inputLabel: 'Ask AI or search your documents',\n search: 'Search',\n askAi: 'Ask AI',\n askOrSearch: 'Ask AI or search',\n closeSearch: 'Close search',\n}\n\nexport interface AskFieldProps {\n value: string\n onValueChange: (value: string) => void\n /** Enter / the arrow button: ask AI. */\n onAsk: (text: string) => void\n /** The magnifier button: semantic search. */\n onSearch: (text: string) => void\n /** Intercept keys first (e.g. a slash menu); call `preventDefault` to stop the default Enter-asks. */\n onInputKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void\n /** Rendered just under the field at its width (a slash/autocomplete menu). */\n menu?: ReactNode\n inputRef?: Ref<HTMLInputElement>\n /** Extra attributes for the input, e.g. the combobox props of `useListKeyNav` for a slash menu. */\n inputProps?: InputHTMLAttributes<HTMLInputElement>\n placeholder?: string\n labels?: Partial<AskFieldLabels>\n autoFocus?: boolean\n className?: string\n /** Root id (default `workspace-ask-bar`); the input/search/submit ids are `<root>-input|search|submit`. */\n 'data-testid'?: string\n}\n\n/**\n * The compact one-line ask/search field: sparkle, input, then two icon doors (Search, Ask AI).\n * Text and the menu are controlled by the host, so the same field serves the sidebar, the phone\n * app bar and any custom shell.\n */\nexport function AskField({\n value,\n onValueChange,\n onAsk,\n onSearch,\n onInputKeyDown,\n menu,\n inputRef,\n inputProps,\n placeholder,\n labels,\n autoFocus = false,\n className,\n 'data-testid': testIdProp,\n}: AskFieldProps) {\n const testId = testIdOr(testIdProp, { testId: 'workspace-ask-bar' })\n const l = { ...DEFAULT_ASK_FIELD_LABELS, ...labels }\n const isEmpty = !value.trim()\n const submit = (handler: (text: string) => void) => {\n const text = value.trim()\n if (text) handler(text)\n }\n\n return (\n <div className={cn('relative', className)} data-slot=\"ask-field\" data-testid={testId}>\n {menu && <div className=\"absolute inset-x-0 top-9 z-30\">{menu}</div>}\n <div\n role=\"search\"\n className=\"flex h-9 items-center gap-0.5 rounded-md border border-border bg-background pl-2.5 pr-0.5 transition-colors focus-within:ring-1 focus-within:ring-ring pointer-coarse:h-11\"\n >\n <Sparkles aria-hidden=\"true\" className=\"size-4 shrink-0 text-ai-ink\" />\n <input\n {...inputProps}\n ref={inputRef}\n type=\"text\"\n value={value}\n onChange={(e) => onValueChange(e.target.value)}\n onKeyDown={(e) => {\n onInputKeyDown?.(e)\n // Enter asks (not mid-IME-composition). A plain div, not a <form>.\n if (e.defaultPrevented) return\n if (e.key === 'Enter' && !e.nativeEvent.isComposing) {\n e.preventDefault()\n submit(onAsk)\n }\n }}\n placeholder={placeholder ?? l.placeholder}\n aria-label={l.inputLabel}\n autoFocus={autoFocus}\n className=\"ml-1.5 h-8 min-w-0 flex-1 bg-transparent pointer-coarse:h-11 text-sm text-foreground outline-none placeholder:text-muted-foreground\"\n data-testid={`${testId}-input`}\n />\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={isEmpty}\n onClick={() => submit(onSearch)}\n title={l.search}\n aria-label={l.search}\n className=\"size-7 shrink-0 text-muted-foreground hover:text-foreground pointer-coarse:size-10\"\n data-testid={`${testId}-search`}\n >\n <Search className=\"size-4\" />\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n disabled={isEmpty}\n onClick={() => submit(onAsk)}\n title={l.askAi}\n aria-label={l.askAi}\n className=\"!inline-flex size-7 shrink-0 text-ai-ink hover:bg-ai-soft hover:text-ai-ink pointer-coarse:size-10\"\n data-testid={`${testId}-submit`}\n >\n <ArrowUp className=\"size-4\" />\n </Button>\n </div>\n </div>\n )\n}\n\nexport interface AskTriggerProps {\n /** Opens the ask field (the single-action variants) or asks AI (`split`). */\n onClick: () => void\n /**\n * `rail`: the icon-only sidebar's bordered tile; `appbar`: the phone app bar's bare icon;\n * `split`: two icon buttons side by side, Search (`onSearch`) and Ask AI (`onClick`).\n */\n variant?: 'rail' | 'appbar' | 'split'\n /** The Search action of the `split` variant. */\n onSearch?: () => void\n labels?: Partial<Pick<AskFieldLabels, 'askOrSearch' | 'search' | 'askAi'>>\n /**\n * `split` only: show the Search and Ask AI texts beside the icons (from `sm` up; phones keep\n * icons, the texts stay as accessible names and tooltips) instead of icon-only buttons.\n */\n showLabels?: boolean\n /** Root id; the split buttons get `<root>-search` and `<root>-ask` unless overridden. */\n 'data-testid'?: string\n searchTestId?: string\n askTestId?: string\n}\n\n/** The icon that stands in for the field where there is no room for it. */\nexport function AskTrigger({\n onClick,\n variant = 'rail',\n onSearch,\n labels,\n showLabels = false,\n 'data-testid': testId,\n searchTestId,\n askTestId,\n}: AskTriggerProps) {\n const text = labels?.askOrSearch ?? DEFAULT_ASK_FIELD_LABELS.askOrSearch\n if (variant === 'split') {\n const searchText = labels?.search ?? DEFAULT_ASK_FIELD_LABELS.search\n const askText = labels?.askAi ?? DEFAULT_ASK_FIELD_LABELS.askAi\n return (\n <div\n role=\"group\"\n aria-label={text}\n data-slot=\"ask-trigger\"\n data-variant=\"split\"\n data-testid={testId}\n className=\"inline-flex items-center rounded-md border border-border bg-background\"\n >\n <button\n type=\"button\"\n onClick={onSearch}\n title={searchText}\n aria-label={searchText}\n data-testid={searchTestId ?? (testId ? `${testId}-search` : undefined)}\n className={cn(\n 'flex h-9 items-center justify-center gap-1.5 rounded-l-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground pointer-coarse:h-11',\n showLabels\n ? 'min-w-9 px-2.5 text-sm pointer-coarse:min-w-11'\n : 'w-9 pointer-coarse:w-11'\n )}\n >\n <Search className=\"size-4\" />\n {showLabels && <span className=\"hidden sm:inline\">{searchText}</span>}\n </button>\n <button\n type=\"button\"\n onClick={onClick}\n title={askText}\n aria-label={askText}\n data-testid={askTestId ?? (testId ? `${testId}-ask` : undefined)}\n className={cn(\n 'flex h-9 items-center justify-center gap-1.5 rounded-r-md border-l border-border text-ai-ink transition-colors hover:bg-ai-soft pointer-coarse:h-11',\n showLabels\n ? 'min-w-9 px-2.5 text-sm pointer-coarse:min-w-11'\n : 'w-9 pointer-coarse:w-11'\n )}\n >\n <Sparkles className=\"size-4\" />\n {showLabels && <span className=\"hidden sm:inline\">{askText}</span>}\n </button>\n </div>\n )\n }\n return (\n <button\n type=\"button\"\n onClick={onClick}\n title={text}\n aria-label={text}\n data-slot=\"ask-trigger\"\n data-testid={testId}\n className={cn(\n 'flex items-center justify-center rounded-md text-ai-ink transition-colors hover:bg-ai-soft',\n variant === 'rail'\n ? 'h-9 w-12 border border-border bg-background pointer-coarse:h-11'\n : 'size-11'\n )}\n >\n <Sparkles className={variant === 'rail' ? 'size-4' : 'size-5'} />\n </button>\n )\n}\n\nexport interface AskRowProps {\n /** The field (an AskField). */\n children: ReactNode\n onClose: () => void\n labels?: Partial<Pick<AskFieldLabels, 'closeSearch'>>\n /** Row id (default `workspace-ask-bar-expanded`). */\n 'data-testid'?: string\n /** Collapse button id (default `workspace-ask-bar-collapse`). */\n collapseTestId?: string\n}\n\n/** The phone's expanded ask row: takes over the app bar so there is room to type; Escape closes. */\nexport function AskRow({\n children,\n onClose,\n labels,\n 'data-testid': testId,\n collapseTestId,\n}: AskRowProps) {\n return (\n <div\n className=\"flex h-14 flex-shrink-0 items-center gap-1 bg-background px-3 pt-safe\"\n data-slot=\"ask-row\"\n data-testid={testIdOr(testId, { testId: 'workspace-ask-bar-expanded' })}\n onKeyDown={(e) => {\n if (e.key === 'Escape' && !e.defaultPrevented) onClose()\n }}\n >\n <div className=\"min-w-0 flex-1\">{children}</div>\n <button\n type=\"button\"\n onClick={onClose}\n aria-label={labels?.closeSearch ?? DEFAULT_ASK_FIELD_LABELS.closeSearch}\n data-testid={testIdOr(collapseTestId, { testId: 'workspace-ask-bar-collapse' })}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground\"\n >\n <X className=\"size-5\" />\n </button>\n </div>\n )\n}\n","import { useRef, type ReactNode } from 'react'\nimport { Menu } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { ActionLink } from '../components/ActionLink'\nimport { prefixedTestId, testIdOr } from '../chat/test-id'\nimport { useShellBottomInset } from '../lib/bottom-inset'\nimport type { NavItem } from './types'\n\n/** Fixed strings of the phone bars. */\nexport interface MobileBarsLabels {\n /** The menu button (the `menuLabel` prop wins). */\n openNavigationMenu: string\n /** The tab bar's accessible name (the `label` prop wins). */\n workspaceSections: string\n}\n\nexport const DEFAULT_MOBILE_BARS_LABELS: MobileBarsLabels = {\n openNavigationMenu: 'Open navigation menu',\n workspaceSections: 'Workspace sections',\n}\n\nexport interface MobileAppBarProps {\n /** Show the menu button that opens the drawer (nothing to open on a list page with no sidebar). */\n showMenu?: boolean\n onMenu?: () => void\n /** Replaces the brand mark (e.g. the workspace switcher). */\n title?: ReactNode\n /** Brand mark shown when there is no `title`. */\n logo?: ReactNode\n /** Right-aligned controls that fit (ask, offline pill, bell, account). */\n actions?: ReactNode\n menuLabel?: string\n labels?: Partial<Pick<MobileBarsLabels, 'openNavigationMenu'>>\n className?: string\n 'data-testid'?: string\n /** Menu button id (default `mobile-nav-toggle`). */\n menuTestId?: string\n}\n\n/**\n * The slim phone app bar (56px): menu button, a title slot and an actions slot. The app mounts\n * it only on small screens; the controls that do not fit live in the drawer.\n */\nexport function MobileAppBar({\n showMenu = true,\n onMenu,\n title,\n logo,\n actions,\n menuLabel,\n labels,\n className,\n 'data-testid': testId,\n menuTestId,\n}: MobileAppBarProps) {\n return (\n <div\n data-slot=\"mobile-app-bar\"\n data-testid={testId}\n className={cn(\n 'sm:hidden flex h-14 flex-shrink-0 items-center gap-1 bg-background pl-1 pr-2 pt-safe',\n className\n )}\n >\n {showMenu && (\n <button\n type=\"button\"\n onClick={onMenu}\n className=\"flex size-11 shrink-0 items-center justify-center rounded-md text-foreground transition-colors hover:bg-muted\"\n aria-label={\n menuLabel ?? labels?.openNavigationMenu ?? DEFAULT_MOBILE_BARS_LABELS.openNavigationMenu\n }\n data-testid={testIdOr(menuTestId, { testId: 'mobile-nav-toggle' })}\n >\n <Menu className=\"size-5\" />\n </button>\n )}\n <div className={cn('flex min-w-0 flex-1 items-center', !showMenu && 'pl-3')}>\n {title ?? logo}\n </div>\n {actions && <div className=\"flex shrink-0 items-center gap-0.5\">{actions}</div>}\n </div>\n )\n}\n\n/**\n * A tab's label. It wraps at word boundaries and is never clipped or cut with an ellipsis; a tab\n * narrower than 4.5rem sets it one size smaller so a long single word still fits, and an item with\n * a `shortLabel` shows that one while its tab is narrower than 5.5rem.\n */\nfunction TabLabel({ item }: { item: NavItem }) {\n const wrap =\n 'max-w-full text-balance px-0.5 text-center [overflow-wrap:normal] @max-[4.5rem]:text-[10px]'\n if (!item.shortLabel) return <span className={wrap}>{item.label}</span>\n return (\n <>\n <span data-slot=\"tab-short-label\" aria-hidden=\"true\" className={cn(wrap, '@[5.5rem]:hidden')}>\n {item.shortLabel}\n </span>\n <span className={cn(wrap, 'hidden @[5.5rem]:block')}>{item.label}</span>\n <span className=\"sr-only @[5.5rem]:hidden\">{item.label}</span>\n </>\n )\n}\n\nexport interface MobileTabBarProps {\n /** The workspace's main areas; test ids are `{testIdPrefix}-{id}` (prefix default `mobile-tab`). */\n items: NavItem[]\n label?: string\n labels?: Partial<Pick<MobileBarsLabels, 'workspaceSections'>>\n testIdPrefix?: string\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * Phone bottom navigation: a 64px tinted bar of the main areas. The drawer carries the same\n * destinations with counts, so nothing is reachable only here. The app mounts it on small\n * screens only.\n */\nexport function MobileTabBar({\n items,\n label,\n labels,\n testIdPrefix,\n className,\n 'data-testid': testId,\n}: MobileTabBarProps) {\n const navRef = useRef<HTMLElement>(null)\n // Floating elements (install prompt, toasts) read the bar's height from `--shell-bottom-inset`.\n useShellBottomInset(navRef)\n return (\n <nav\n ref={navRef}\n aria-label={\n label ?? labels?.workspaceSections ?? DEFAULT_MOBILE_BARS_LABELS.workspaceSections\n }\n data-slot=\"mobile-tab-bar\"\n data-testid={testIdOr(testId, { testId: 'mobile-tab-bar' })}\n className={cn(\n 'flex min-h-16 flex-shrink-0 items-stretch bg-sidebar px-2 pb-safe sm:hidden',\n className\n )}\n >\n {items.map((item) => (\n <ActionLink\n key={item.id}\n href={item.href}\n onSelect={item.onSelect}\n disabled={item.disabled}\n aria-current={item.active ? 'page' : undefined}\n className={cn(\n // Each tab is a size container: a `shortLabel` replaces the label when it is narrow.\n '@container flex min-h-12 min-w-0 flex-1 flex-col items-center justify-center gap-0.5 rounded-md text-[11px] leading-tight transition-colors',\n item.active\n ? 'font-semibold text-primary'\n : 'font-medium text-muted-foreground hover:text-foreground'\n )}\n data-testid={prefixedTestId(testIdPrefix, item.id, { testId: `mobile-tab-${item.id}` })}\n >\n {item.icon}\n <TabLabel item={item} />\n </ActionLink>\n ))}\n </nav>\n )\n}\n","/**\n * Per-browser PWA install instructions, for when the browser cannot open the install dialog\n * directly (iOS Safari, Safari on macOS, Firefox, or a Chromium browser that never fired\n * `beforeinstallprompt`). Only Chromium exposes a JS trigger, so off that path we tell the user\n * the right gesture for their browser.\n */\n\nexport interface InstallGuide {\n heading: string\n steps: string[]\n note?: string\n}\n\nexport interface InstallInstructionsOptions {\n /** Name shown in the steps. Default `this app`. */\n appName?: string\n}\n\n/** True on iPhone/iPad/iPod, including iPadOS reporting as a Mac. */\nexport function isIosDevice(): boolean {\n if (typeof navigator === 'undefined') return false\n return (\n /iPad|iPhone|iPod/.test(navigator.userAgent) ||\n (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1)\n )\n}\n\n/** Pick install steps for the current browser/platform. */\nexport function getInstallInstructions({\n appName = 'this app',\n}: InstallInstructionsOptions = {}): InstallGuide {\n if (typeof navigator === 'undefined' || typeof window === 'undefined') {\n return {\n heading: `Install ${appName}`,\n steps: [`Open ${appName} in Chrome, Edge, or Safari to install it.`],\n }\n }\n\n const ua = navigator.userAgent\n const isChromium = 'onbeforeinstallprompt' in window\n const isFirefox = /firefox|fxios/i.test(ua)\n const isMac = /Macintosh|Mac OS X/.test(ua)\n\n if (isIosDevice()) {\n return {\n heading: 'Install on iPhone or iPad',\n steps: [\n `Open ${appName} in Safari, then tap the Share button.`,\n 'Scroll down and tap “Add to Home Screen”.',\n `Tap “Add”: ${appName} appears on your home screen.`,\n ],\n }\n }\n\n if (isChromium) {\n return {\n heading: `Install ${appName}`,\n steps: [\n 'Click the install icon at the right of the address bar (a small monitor with a down arrow).',\n 'Choose “Install” in the dialog that appears.',\n ],\n note: `On a phone, open the browser menu and choose “Install app” / “Add to Home screen”. If you don’t see the option, ${appName} may already be installed.`,\n }\n }\n\n if (isMac && !isFirefox) {\n return {\n heading: 'Install on macOS Safari',\n steps: ['In the menu bar, open the File menu.', 'Choose “Add to Dock”.'],\n note: 'Requires Safari 17 or later (macOS Sonoma). On older Safari, use Chrome or Edge to install.',\n }\n }\n\n if (isFirefox) {\n return {\n heading: 'Firefox can’t install web apps',\n steps: [`Open ${appName} in Chrome, Edge, or Safari to install it as an app.`],\n }\n }\n\n return {\n heading: `Install ${appName}`,\n steps: [\n 'Look for an “Install” or “Add to Home Screen” option in your browser’s menu or address bar.',\n ],\n }\n}\n","import { useCallback, useEffect, useState } from 'react'\nimport { getInstallInstructions, isIosDevice, type InstallGuide } from './install-instructions'\n\n/** Non-standard Chromium event, not in lib.dom types. */\ninterface BeforeInstallPromptEvent extends Event {\n readonly platforms: string[]\n readonly userChoice: Promise<{ outcome: 'accepted' | 'dismissed'; platform: string }>\n prompt(): Promise<void>\n}\n\nlet deferredPrompt: BeforeInstallPromptEvent | null = null\nlet installed = false\nlet initialized = false\nlet autoPromptParam: string | null = null\n\nconst subscribers = new Set<() => void>()\nconst notify = () => subscribers.forEach((fn) => fn())\n\nfunction isStandalone(): boolean {\n if (typeof window === 'undefined') return false\n const iosStandalone = (navigator as Navigator & { standalone?: boolean }).standalone === true\n return window.matchMedia?.('(display-mode: standalone)').matches === true || iosStandalone\n}\n\nfunction wantsAutoPrompt(): boolean {\n if (!autoPromptParam) return false\n return new URLSearchParams(window.location.search).get(autoPromptParam) === 'true'\n}\n\nfunction onBeforeInstallPrompt(event: Event): void {\n event.preventDefault()\n deferredPrompt = event as BeforeInstallPromptEvent\n notify()\n if (wantsAutoPrompt()) void promptAppInstall()\n}\n\nfunction onAppInstalled(): void {\n installed = true\n deferredPrompt = null\n notify()\n}\n\n/**\n * Begin capturing install events. Idempotent. Chromium fires `beforeinstallprompt` once, early,\n * usually before a lazy route has mounted, so call this at app startup (before the first render);\n * `useInstallPrompt` also calls it, which is enough when the hook mounts at the root.\n *\n * `options.autoPromptParam`: a share link `/?{param}=true` opens the native dialog as soon as the\n * browser is ready (Chromium).\n */\nexport function initInstallPrompt(options: { autoPromptParam?: string } = {}): void {\n if (options.autoPromptParam) autoPromptParam = options.autoPromptParam\n if (initialized || typeof window === 'undefined') return\n initialized = true\n installed = isStandalone()\n\n window.addEventListener('beforeinstallprompt', onBeforeInstallPrompt)\n window.addEventListener('appinstalled', onAppInstalled)\n}\n\n/**\n * Open the browser's install dialog if one was captured. Returns false when there is none (the\n * caller then shows {@link getInstallInstructions}). A captured prompt works once.\n */\nexport async function promptAppInstall(): Promise<boolean> {\n if (!deferredPrompt) return false\n const prompt = deferredPrompt\n deferredPrompt = null\n notify()\n try {\n await prompt.prompt()\n } catch {\n // The user dismissed it or the browser rejected it: nothing actionable.\n }\n return true\n}\n\n/** Default storage key of the remembered dismissal. */\nexport const INSTALL_PROMPT_DISMISSED_KEY = 'arbi-blocks:install-prompt-dismissed'\nconst DAY_MS = 24 * 60 * 60 * 1000\n\nfunction readDismissedAt(key: string): number | null {\n try {\n const raw = window.localStorage.getItem(key)\n const at = raw ? Number(raw) : NaN\n return Number.isFinite(at) ? at : null\n } catch {\n return null\n }\n}\n\nexport interface UseInstallPromptOptions {\n /** localStorage key remembering a dismissal. */\n storageKey?: string\n /** Days a dismissal is remembered. Default 30. */\n dismissDays?: number\n /** Query param that turns a share link into a one-click install (`install` for `?install=true`). */\n autoPromptParam?: string\n /** App name used in the manual instructions. */\n appName?: string\n}\n\nexport interface UseInstallPromptResult {\n /** A native install dialog can be opened right now (Chromium, once the event fired). */\n canPrompt: boolean\n /** Running as an installed app, or `appinstalled` fired. */\n isInstalled: boolean\n /** iOS has no install API: offer manual instructions instead. */\n isIos: boolean\n /** The user dismissed the offer (remembered across visits). */\n isDismissed: boolean\n /** Open the native dialog; false when none is available. */\n promptInstall: () => Promise<boolean>\n /** Hide the offer and remember it. */\n dismiss: () => void\n /** Manual steps for this browser. */\n instructions: InstallGuide\n}\n\n/** The install state of the app, framework-neutral logic behind `InstallPrompt`. */\nexport function useInstallPrompt({\n storageKey = INSTALL_PROMPT_DISMISSED_KEY,\n dismissDays = 30,\n autoPromptParam: autoParam,\n appName,\n}: UseInstallPromptOptions = {}): UseInstallPromptResult {\n const [, forceRender] = useState(0)\n const [dismissedAt, setDismissedAt] = useState<number | null>(() =>\n typeof window === 'undefined' ? null : readDismissedAt(storageKey)\n )\n\n useEffect(() => {\n initInstallPrompt({ autoPromptParam: autoParam })\n const onChange = () => forceRender((n) => n + 1)\n subscribers.add(onChange)\n // The singleton may have started before this mount: pick up the current state.\n onChange()\n return () => {\n subscribers.delete(onChange)\n }\n }, [autoParam])\n\n const dismiss = useCallback(() => {\n const now = Date.now()\n setDismissedAt(now)\n try {\n window.localStorage.setItem(storageKey, String(now))\n } catch {\n // Storage blocked: the dismissal lasts for this page view only.\n }\n }, [storageKey])\n\n const isDismissed = dismissedAt !== null && Date.now() - dismissedAt < dismissDays * DAY_MS\n const isInstalled = installed || isStandalone()\n return {\n canPrompt: !isInstalled && deferredPrompt !== null,\n isInstalled,\n isIos: isIosDevice(),\n isDismissed,\n promptInstall: promptAppInstall,\n dismiss,\n instructions: getInstallInstructions({ appName }),\n }\n}\n\n/** Test seam: forget captured state (the singleton lives for the page). */\nexport function resetInstallPromptForTests(): void {\n if (typeof window !== 'undefined') {\n window.removeEventListener('beforeinstallprompt', onBeforeInstallPrompt)\n window.removeEventListener('appinstalled', onAppInstalled)\n }\n deferredPrompt = null\n installed = false\n initialized = false\n autoPromptParam = null\n subscribers.clear()\n}\n","import { useState } from 'react'\nimport { Download, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { useInstallPrompt, type UseInstallPromptOptions } from './use-install-prompt'\n\n/** Fixed strings of the install prompt. */\nexport interface InstallPromptLabels {\n /** The pill's text. */\n install: string\n /** The dismiss button's accessible name. */\n dismiss: string\n /** Accessible name of the pill (`{app}` is replaced by `appName`). */\n installAs: string\n}\n\nexport const DEFAULT_INSTALL_PROMPT_LABELS: InstallPromptLabels = {\n install: 'Install app',\n dismiss: 'Dismiss install prompt',\n installAs: 'Install {app} as an app',\n}\n\nexport interface InstallPromptProps extends UseInstallPromptOptions {\n /** Which bottom corner the pill sits in. Default `start` (clear of a bottom-right toaster). */\n placement?: 'start' | 'end'\n labels?: Partial<InstallPromptLabels>\n className?: string\n 'data-testid'?: string\n}\n\n/**\n * A small floating \"Install app\" pill. Renders only while the app can be installed (the browser\n * fired `beforeinstallprompt`, or on iOS where it shows the Add to Home Screen steps), is not\n * already installed, and was not dismissed (the dismissal is remembered for `dismissDays`).\n *\n * It sits above whatever is pinned to the bottom of the screen: it reads `--shell-bottom-inset`\n * (set by `MobileTabBar` and the chat composer, see `useShellBottomInset`) plus the device\n * safe area, so it never covers the tab bar or the composer. Both controls are 44px tall on a phone.\n */\nexport function InstallPrompt({\n placement = 'start',\n labels,\n className,\n 'data-testid': testId,\n ...options\n}: InstallPromptProps) {\n const l = { ...DEFAULT_INSTALL_PROMPT_LABELS, ...labels }\n const install = useInstallPrompt(options)\n const [showSteps, setShowSteps] = useState(false)\n\n const isOffer = install.canPrompt || install.isIos\n if (install.isInstalled || install.isDismissed || !isOffer) return null\n\n const appName = options.appName ?? 'this app'\n const onInstall = async () => {\n if (install.canPrompt) await install.promptInstall()\n else setShowSteps((open) => !open)\n }\n\n return (\n <div\n data-slot=\"install-prompt\"\n data-testid={testIdOr(testId, { testId: 'install-app-prompt' })}\n className={cn(\n 'fixed z-30 flex max-w-[calc(100vw-1.5rem)] flex-col gap-2',\n // Above the bottom bars (tab bar / composer) and the home indicator on a phone, a plain\n // corner offset from `sm` up where the tab bar is gone.\n 'bottom-[calc(max(var(--shell-bottom-inset,0px),env(safe-area-inset-bottom,0px))+0.75rem)] sm:bottom-[calc(env(safe-area-inset-bottom,0px)+0.75rem)]',\n placement === 'start' ? 'left-3 items-start' : 'right-3 items-end',\n className\n )}\n >\n {showSteps && (\n <div\n data-slot=\"install-prompt-steps\"\n className=\"w-72 max-w-full rounded-lg border border-border bg-card p-3 text-sm text-card-foreground shadow-lg\"\n >\n <p className=\"font-medium\">{install.instructions.heading}</p>\n <ol className=\"mt-2 list-decimal space-y-1 pl-5 text-muted-foreground\">\n {install.instructions.steps.map((step) => (\n <li key={step}>{step}</li>\n ))}\n </ol>\n </div>\n )}\n <div className=\"inline-flex items-center rounded-full border border-border bg-card/95 text-foreground shadow-sm backdrop-blur\">\n <button\n type=\"button\"\n onClick={() => void onInstall()}\n aria-label={l.installAs.replace('{app}', appName)}\n aria-expanded={install.canPrompt ? undefined : showSteps}\n data-slot=\"install-prompt-action\"\n className=\"inline-flex min-h-11 items-center gap-1.5 rounded-full pl-4 pr-2 text-xs font-medium transition-colors hover:bg-accent sm:min-h-9 sm:pl-3\"\n >\n <Download className=\"size-3.5\" aria-hidden=\"true\" />\n {l.install}\n </button>\n <button\n type=\"button\"\n onClick={install.dismiss}\n aria-label={l.dismiss}\n data-slot=\"install-prompt-dismiss\"\n className=\"inline-flex size-11 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground sm:size-9\"\n >\n <X className=\"size-3.5\" aria-hidden=\"true\" />\n </button>\n </div>\n </div>\n )\n}\n","import { useId, type MouseEvent, type ReactNode } from 'react'\nimport type { ShellActionLayout } from './types'\n\nexport interface ActionClusterProps {\n /**\n * `bar`: one row for a page header or phone app bar (status, bell, contacts, account).\n * `sidebar`: the bottom of the expanded sidebar: the bell and contacts rows stacked above the\n * account row.\n * `rail`: the same stack on the icon-only rail (same order, icon-only rows).\n * `drawer`: the phone drawer's rows (bell and contacts only; the app bar carries the account).\n */\n layout?: ShellActionLayout\n /** Status pill (remote control); `bar` only. Other layouts show status in their own rows. */\n status?: ReactNode\n /** Notification bell (the kit's NotificationBell, or a `Sidebar.BadgeRow`). */\n bell?: ReactNode\n /** Contacts / messages entry with its own badge (a `Sidebar.BadgeRow`). */\n contacts?: ReactNode\n /** Account menu (the kit's UserMenu). */\n account?: ReactNode\n /**\n * Names the cluster: the group's accessible name in every layout, and a visible heading above\n * the rows in the `drawer` layout (where phones otherwise get unlabelled rows).\n */\n label?: string\n 'data-testid'?: string\n}\n\n/**\n * The account area: notifications, contacts and the account menu, in one of four placements. In\n * the sidebar and on the rail the two badge rows are stacked above the account row in the same\n * order, so nothing moves when the rail expands; the account menu holds everything else (help,\n * settings, tips, processing).\n */\nexport function ActionCluster({\n layout = 'bar',\n status,\n bell,\n contacts,\n account,\n label,\n 'data-testid': testId = 'sidebar-actions',\n}: ActionClusterProps) {\n const labelId = useId()\n // Dashboard's content area resets focus on click, and Radix PORTALS bubble through the React\n // tree: stop clicks here or a dropdown item (e.g. \"View all\") would un-focus the panel it opened.\n const stop = (e: MouseEvent) => e.stopPropagation()\n\n if (layout === 'sidebar' || layout === 'rail' || layout === 'drawer') {\n const rail = layout === 'rail'\n return (\n <div\n className={rail ? 'flex flex-col items-center gap-0.5' : 'flex flex-col gap-0.5'}\n onClick={stop}\n role={label ? 'group' : undefined}\n aria-labelledby={label && layout === 'drawer' ? labelId : undefined}\n aria-label={label && layout !== 'drawer' ? label : undefined}\n data-slot=\"action-cluster\"\n data-layout={layout}\n data-testid={testId}\n >\n {label && layout === 'drawer' && (\n <p\n id={labelId}\n className=\"px-3 pb-1 pt-2 text-xs font-semibold uppercase tracking-wider text-muted-foreground\"\n data-slot=\"action-cluster-label\"\n >\n {label}\n </p>\n )}\n {bell}\n {contacts}\n {account && layout !== 'drawer' && (\n <div className={rail ? 'mt-1' : 'mt-1 min-w-0'}>{account}</div>\n )}\n </div>\n )\n }\n\n return (\n <div\n className=\"flex items-center gap-1\"\n onClick={stop}\n role={label ? 'group' : undefined}\n aria-label={label}\n data-slot=\"action-cluster\"\n >\n {status}\n {bell}\n {contacts}\n {account}\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { CheckCircle2, Loader2, TriangleAlert } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\n\nexport type StatusRowTone = 'progress' | 'success' | 'error'\n\nexport interface StatusRowProps {\n tone: StatusRowTone\n /** e.g. \"Processing 3 files…\". Always the accessible name; hidden visually when `compact`. */\n label: string\n /** Opens the thing the status is about (the processing panel). */\n onClick: () => void\n /** Icon-only (the collapsed rail). */\n compact?: boolean\n /** Replaces the tone's default glyph. */\n icon?: ReactNode\n 'data-testid'?: string\n}\n\nconst TONES: Record<StatusRowTone, { className: string; Icon: typeof Loader2; spin?: boolean }> = {\n progress: { className: 'bg-muted text-foreground', Icon: Loader2, spin: true },\n success: { className: 'bg-green-bg text-green-text', Icon: CheckCircle2 },\n error: { className: 'bg-red-bg text-red-text', Icon: TriangleAlert },\n}\n\n/**\n * A live status line for the sidebar footer: a spinner and a short sentence that opens the\n * thing it reports on. The host renders it ONLY while the state is relevant (work running,\n * something failed), so a quiet app shows nothing. Announced politely to screen readers.\n */\nexport function StatusRow({\n tone,\n label,\n onClick,\n compact = false,\n icon,\n 'data-testid': testId,\n}: StatusRowProps) {\n const { className, Icon, spin } = TONES[tone]\n return (\n <div role=\"status\" data-slot=\"status-row\" className={cn(compact && 'flex justify-center')}>\n <button\n type=\"button\"\n onClick={onClick}\n aria-label={label}\n title={label}\n data-testid={testId}\n data-tone={tone}\n className={cn(\n 'flex items-center gap-2 rounded-md text-sm font-medium transition-colors hover:brightness-95 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11',\n compact ? 'size-9 justify-center pointer-coarse:size-11' : 'w-full px-2.5 py-1.5',\n className\n )}\n >\n {icon ?? (\n <Icon\n className={cn('size-4 shrink-0', spin && 'animate-spin motion-reduce:animate-none')}\n />\n )}\n {!compact && <span className=\"min-w-0 flex-1 truncate text-left\">{label}</span>}\n </button>\n </div>\n )\n}\n","import { RefreshCw, TriangleAlert, WifiOff } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\nimport { SidebarRowHoverContext } from './Sidebar'\nimport { SidebarRowAction } from './SidebarRowAction'\n\nexport type OfflinePillTone = 'offline' | 'failed' | 'syncing'\n\n/** Fixed strings of the offline pill. */\nexport interface OfflinePillLabels {\n reconnect: string\n}\n\nexport const DEFAULT_OFFLINE_PILL_LABELS: OfflinePillLabels = {\n reconnect: 'Reconnect',\n}\n\nexport interface OfflinePillProps {\n tone: OfflinePillTone\n /** e.g. \"Offline · 3 pending\", \"2 failed to sync\", \"Syncing 4…\". */\n label: string\n /** Icon-only (the collapsed rail / app bar). */\n compact?: boolean\n /** Opens the pending-changes list. */\n onOpen: () => void\n /** Offered beside the pill (only when not compact); pass it only while it can do something. */\n onReconnect?: () => void\n labels?: Partial<OfflinePillLabels>\n /** Pill button id (default `offline-sync-status`). */\n 'data-testid'?: string\n /** Reconnect button id (default `offline-reconnect-button`). */\n reconnectTestId?: string\n}\n\nconst TONES: Record<OfflinePillTone, { className: string; Icon: typeof WifiOff }> = {\n offline: { className: 'bg-yellow-bg text-yellow-text', Icon: WifiOff },\n failed: { className: 'bg-red-bg text-red-text', Icon: TriangleAlert },\n syncing: { className: 'bg-blue-bg text-blue-text', Icon: RefreshCw },\n}\n\n/**\n * Connection + sync indicator: a status pill that opens the pending-changes list, plus an\n * optional Reconnect button beside it. The app renders it only when there is something to say\n * (offline, or changes waiting/failing), so online-and-synced stays clean.\n */\nexport function OfflinePill({\n tone,\n label,\n compact = false,\n onOpen,\n onReconnect,\n labels,\n 'data-testid': testId,\n reconnectTestId,\n}: OfflinePillProps) {\n const { className, Icon } = TONES[tone]\n return (\n <div\n className={cn('flex items-center gap-1', compact && 'justify-center')}\n data-slot=\"offline-pill\"\n >\n <button\n type=\"button\"\n data-testid={testIdOr(testId, { testId: 'offline-sync-status' })}\n aria-label={label}\n title={label}\n onClick={onOpen}\n className={cn(\n 'flex min-w-0 flex-1 items-center gap-2 rounded-md px-2.5 py-1.5 text-sm font-medium transition-colors hover:brightness-95 pointer-coarse:min-h-11',\n compact && 'flex-none justify-center',\n className\n )}\n >\n <Icon className={cn('size-4 shrink-0', tone === 'syncing' && 'animate-spin')} />\n {!compact && <span className=\"truncate\">{label}</span>}\n </button>\n {!compact && onReconnect && (\n // Forced visible (context true): there is no row to hover.\n <SidebarRowHoverContext.Provider value={true}>\n <SidebarRowAction\n label={labels?.reconnect ?? DEFAULT_OFFLINE_PILL_LABELS.reconnect}\n onClick={onReconnect}\n data-testid={testIdOr(reconnectTestId, { testId: 'offline-reconnect-button' })}\n >\n <RefreshCw className=\"size-5\" />\n </SidebarRowAction>\n </SidebarRowHoverContext.Provider>\n )}\n </div>\n )\n}\n","import { MousePointerClick, X } from 'lucide-react'\nimport { cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the remote-control pill. */\nexport interface RemoteControlPillLabels {\n /** The disable button (the `disableLabel` prop wins). */\n turnOffRemoteControl: string\n}\n\nexport const DEFAULT_REMOTE_CONTROL_PILL_LABELS: RemoteControlPillLabels = {\n turnOffRemoteControl: 'Turn off remote control',\n}\n\nexport interface RemoteControlPillProps {\n /** A run is actively driving the screen (tinted + pulsing). */\n isActive: boolean\n label: string\n onDisable: () => void\n disableLabel?: string\n labels?: Partial<RemoteControlPillLabels>\n /** Root id (default `remote-control-indicator`). */\n 'data-testid'?: string\n /** Disable button id (default `remote-control-indicator-disable`). */\n disableTestId?: string\n}\n\n/**\n * Persistent, unobtrusive status pill shown while remote control is on or a run is executing,\n * with a one-click disable. The app decides when to mount it.\n */\nexport function RemoteControlPill({\n isActive,\n label,\n onDisable,\n disableLabel: disableLabelProp,\n labels,\n 'data-testid': testId,\n disableTestId,\n}: RemoteControlPillProps) {\n const disableLabel =\n disableLabelProp ??\n labels?.turnOffRemoteControl ??\n DEFAULT_REMOTE_CONTROL_PILL_LABELS.turnOffRemoteControl\n return (\n <div\n data-slot=\"remote-control-pill\"\n data-testid={testIdOr(testId, { testId: 'remote-control-indicator' })}\n className={cn(\n 'flex min-w-0 max-w-full items-center gap-1.5 rounded-full py-1 pl-2.5 pr-1 text-xs font-medium',\n isActive ? 'bg-accent text-accent-foreground' : 'bg-muted text-muted-foreground'\n )}\n >\n <MousePointerClick className={cn('size-3.5 shrink-0', isActive && 'animate-pulse')} />\n <span className=\"min-w-0 max-w-[16rem] truncate\">{label}</span>\n <button\n type=\"button\"\n onClick={onDisable}\n title={disableLabel}\n aria-label={disableLabel}\n data-testid={testIdOr(disableTestId, { testId: 'remote-control-indicator-disable' })}\n className=\"flex size-5 shrink-0 items-center justify-center rounded-full transition-colors hover:bg-foreground/10 hover:text-foreground pointer-coarse:size-8\"\n >\n <X className=\"size-3.5\" />\n </button>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { ChevronLeft, ChevronRight, Lightbulb, Pencil, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\nimport { testIdOr } from '../chat/test-id'\n\n/** Fixed strings of the tip card. */\nexport interface TipCardLabels {\n /** Default CTA text (the `ctaLabel` prop wins). */\n showMe: string\n previousTip: string\n nextTip: string\n editTip: string\n /** The card's heading and accessible name. */\n tip: string\n /** The dismiss button: it turns tips off (they come back from the account menu). */\n hideTips: string\n /** \"1 of 3\". */\n position: (index: number, count: number) => string\n}\n\nexport const DEFAULT_TIP_CARD_LABELS: TipCardLabels = {\n showMe: 'Show me',\n previousTip: 'Previous tip',\n nextTip: 'Next tip',\n editTip: 'Edit tip',\n tip: 'Tip',\n hideTips: 'Hide tips',\n position: (index, count) => `${index} of ${count}`,\n}\n\nexport interface TipCardProps {\n /** The tip text: one sentence. */\n message: ReactNode\n /** Which tip is showing (0-based) out of `count`; the pager appears when `count` > 1. */\n index?: number\n count?: number\n onPrev?: () => void\n onNext?: () => void\n /** The single primary action; omit when the tip has none. */\n ctaLabel?: string\n onCta?: () => void\n /** Turns tips off. The card is dismissible so it never becomes permanent furniture. */\n onDismiss?: () => void\n /** Dev-only edit affordance: the host passes it only in development builds. */\n onEdit?: () => void\n /** Hover pauses the host's tip rotation (desktop enhancement). */\n onHoverChange?: (hovered: boolean) => void\n labels?: Partial<TipCardLabels>\n className?: string\n /** Card id (default `tip-row`). */\n testId?: string\n /** Control ids; defaults are the current ids. */\n testIds?: Partial<Record<'prev' | 'next' | 'cta' | 'edit' | 'dismiss', string>>\n}\n\nconst ICON_BUTTON =\n 'flex size-7 shrink-0 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:size-11'\n\n/**\n * The Smart Tips card: a compact muted tile. Header (bulb, \"Tip\", dismiss), one sentence, then\n * ONE primary action with a quiet \"n of m\" pager. It is shown only while tips are on and a tip\n * applies; the host owns which tip is current, rotation and the on/off preference.\n */\nexport function TipCard({\n message,\n index = 0,\n count = 1,\n onPrev,\n onNext,\n ctaLabel,\n onCta,\n onDismiss,\n onEdit,\n onHoverChange,\n labels,\n className,\n testId,\n testIds,\n}: TipCardProps) {\n const l = { ...DEFAULT_TIP_CARD_LABELS, ...labels }\n const hasMany = count > 1\n\n return (\n <section\n data-slot=\"tip-card\"\n aria-label={l.tip}\n className={cn('min-w-0 rounded-lg bg-muted p-3 text-sm', className)}\n onMouseEnter={() => onHoverChange?.(true)}\n onMouseLeave={() => onHoverChange?.(false)}\n data-testid={testIdOr(testId, { testId: 'tip-row' })}\n >\n <div className=\"-my-1 flex items-center gap-1.5 text-xs font-medium text-muted-foreground\">\n <Lightbulb className=\"size-4 shrink-0 text-primary\" aria-hidden />\n <span>{l.tip}</span>\n <span className=\"-mr-1.5 ml-auto flex items-center\">\n {onEdit && (\n <button\n type=\"button\"\n onClick={onEdit}\n aria-label={l.editTip}\n title={l.editTip}\n className={cn(ICON_BUTTON, 'text-red-text hover:bg-red-bg hover:text-red-text')}\n data-testid={testIdOr(testIds?.edit, { testId: 'tip-edit' })}\n >\n <Pencil className=\"size-3.5\" />\n </button>\n )}\n {onDismiss && (\n <button\n type=\"button\"\n onClick={onDismiss}\n aria-label={l.hideTips}\n title={l.hideTips}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.dismiss, { testId: 'tip-dismiss' })}\n >\n <X className=\"size-4\" />\n </button>\n )}\n </span>\n </div>\n <p className=\"mt-2 text-foreground\">{message}</p>\n {(onCta || hasMany) && (\n <div className=\"mt-3 flex items-center justify-between gap-2\">\n {onCta ? (\n <Button\n type=\"button\"\n variant=\"outline\"\n size=\"sm\"\n onClick={onCta}\n className=\"font-medium text-primary\"\n data-testid={testIdOr(testIds?.cta, { testId: 'page-header-info-cta' })}\n >\n {ctaLabel ?? l.showMe}\n </Button>\n ) : (\n <span />\n )}\n {hasMany && (\n <span className=\"-mr-1.5 flex items-center text-xs text-muted-foreground\">\n <button\n type=\"button\"\n onClick={onPrev}\n aria-label={l.previousTip}\n title={l.previousTip}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.prev, { testId: 'tip-prev' })}\n >\n <ChevronLeft className=\"size-4\" />\n </button>\n <span className=\"min-w-10 text-center tabular-nums\" aria-live=\"polite\">\n {l.position(index + 1, count)}\n </span>\n <button\n type=\"button\"\n onClick={onNext}\n aria-label={l.nextTip}\n title={l.nextTip}\n className={ICON_BUTTON}\n data-testid={testIdOr(testIds?.next, { testId: 'tip-next' })}\n >\n <ChevronRight className=\"size-4\" />\n </button>\n </span>\n )}\n </div>\n )}\n </section>\n )\n}\n","import { useEffect, useRef, useState } from 'react'\n\n/**\n * Headless sidebar behaviour (no DOM, no store): how the sidebar lays out for a given set of\n * inputs, and the settle timing that keeps labels/tips from squeezing during the width transition.\n *\n * - `drawer` small-screen off-canvas panel (opened by the app bar's menu button)\n * - `collapsed` hidden (width 0) and only revealed while `isPeeking` is on\n * - `pinned` full width, inline, pushes the content\n * - `rail` icon strip that floats open to full width while hovered\n */\nexport type SidebarMode = 'drawer' | 'collapsed' | 'pinned' | 'rail'\n\nexport interface SidebarModeInput {\n isSmallScreen: boolean\n /** The phone drawer was requested open. */\n isDrawerRequested: boolean\n isCollapsed: boolean\n isPinned: boolean\n isHovering: boolean\n /** The pointer is over the collapsed-sidebar reveal target. */\n isPeeking?: boolean\n /**\n * Tablet-width viewport (above the phone drawer breakpoint but too narrow to give the content a\n * usable column next to a 255px panel): pinning is ignored and the sidebar stays an icon rail.\n */\n isNarrow?: boolean\n}\n\nexport interface SidebarLayout {\n mode: SidebarMode\n /** Labels should be shown (the panel is, or is becoming, full width). */\n expanded: boolean\n /** Phones: nothing is rendered until the drawer opens. */\n hidden: boolean\n /** Hover state that actually applies (never on touch-sized screens). */\n hovering: boolean\n}\n\nexport function resolveSidebarLayout(input: SidebarModeInput): SidebarLayout {\n const { isSmallScreen, isDrawerRequested, isCollapsed, isPinned, isHovering } = input\n const isPeeking = input.isPeeking ?? false\n const canPin = isPinned && !isSmallScreen && !input.isNarrow\n const drawerOpen = isSmallScreen && isDrawerRequested\n // Small screens are drawer-only: when it is closed the panel is fully off-canvas\n // regardless of pinning (pinning is a desktop concept), and hover never expands.\n const effectiveCollapsed = isCollapsed || (isSmallScreen && !drawerOpen)\n const hovering = isHovering && !isSmallScreen\n\n let mode: SidebarMode\n if (drawerOpen) mode = 'drawer'\n else if (effectiveCollapsed) mode = 'collapsed'\n else if (canPin) mode = 'pinned'\n else mode = 'rail'\n\n const expanded =\n drawerOpen || canPin || (!isCollapsed && isHovering) || (isCollapsed && isPeeking)\n\n return { mode, expanded, hidden: isSmallScreen && !drawerOpen, hovering }\n}\n\n/**\n * Settle timing around the width transition (default 300ms):\n * - `labelsExpanded` switches on immediately but off only after the transition, so labels do not\n * snap to icon-only while the panel is still wide;\n * - `tipsVisible` is the opposite: width-bound content (a tip card) appears only once the panel\n * has fully opened and disappears the instant collapse starts.\n */\nexport function useSidebarSettle(expanded: boolean, settleMs = 300) {\n const [labelsExpanded, setLabelsExpanded] = useState(expanded)\n const [tipsVisible, setTipsVisible] = useState(expanded)\n const labelsTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n const tipsTimer = useRef<ReturnType<typeof setTimeout> | null>(null)\n\n useEffect(() => {\n if (labelsTimer.current) clearTimeout(labelsTimer.current)\n if (expanded) setLabelsExpanded(true)\n else labelsTimer.current = setTimeout(() => setLabelsExpanded(false), settleMs)\n return () => {\n if (labelsTimer.current) clearTimeout(labelsTimer.current)\n }\n }, [expanded, settleMs])\n\n useEffect(() => {\n if (tipsTimer.current) clearTimeout(tipsTimer.current)\n if (expanded) tipsTimer.current = setTimeout(() => setTipsVisible(true), settleMs)\n else setTipsVisible(false)\n return () => {\n if (tipsTimer.current) clearTimeout(tipsTimer.current)\n }\n }, [expanded, settleMs])\n\n return { labelsExpanded, tipsVisible }\n}\n","import type { ReactNode } from 'react'\nimport { Info, Lightbulb, X } from 'lucide-react'\nimport { Button, cn } from '@arbidocs/react/ui'\n\nexport type InfoBarVariant = 'info' | 'warning' | 'success' | 'hint'\n\nconst VARIANT_TONE: Record<InfoBarVariant, string> = {\n info: 'bg-blue-bg text-primary border-blue-border',\n warning: 'bg-yellow-bg text-yellow-text border-yellow-border',\n success: 'bg-green-bg text-green-text border-green-border',\n hint: 'bg-blue-bg text-foreground border-blue-border',\n}\n\nexport interface InfoBarProps {\n message: ReactNode\n variant?: InfoBarVariant\n /** Suppress the leading variant icon (e.g. tips render their own \"Tip:\" label). */\n hideIcon?: boolean\n /** Element pinned to the right of the bar (e.g. a reward balance). */\n rightSlot?: ReactNode\n cta?: { label: string; onClick: () => void; icon?: ReactNode }\n onDismiss?: () => void\n dismissLabel?: string\n className?: string\n}\n\n/** Full-width page banner: icon, message, optional right slot, CTA and dismiss. */\nexport function InfoBar({\n message,\n variant = 'info',\n hideIcon,\n rightSlot,\n cta,\n onDismiss,\n dismissLabel = 'Dismiss',\n className,\n}: InfoBarProps) {\n const VariantIcon = variant === 'hint' ? Lightbulb : Info\n return (\n <div\n className={cn('relative z-10 flex w-full items-center pt-1', className)}\n data-slot=\"info-bar\"\n >\n <div\n className={cn(\n 'flex w-full flex-wrap items-center gap-3 rounded-md border px-3 py-[7px]',\n VARIANT_TONE[variant]\n )}\n data-testid=\"page-header-info-box\"\n >\n <div className=\"flex min-w-0 flex-1 items-center gap-3\">\n {!hideIcon && <VariantIcon className=\"hidden size-4 shrink-0 sm:block\" />}\n <div className=\"min-w-0 flex-1 text-sm\">{message}</div>\n </div>\n <div className=\"flex w-full items-center gap-2 sm:ml-auto sm:w-auto\">\n {rightSlot}\n {cta && (\n <Button\n variant=\"outline\"\n size=\"sm\"\n onClick={cta.onClick}\n className=\"h-8 flex-1 shrink-0 sm:flex-initial pointer-coarse:h-11\"\n data-testid=\"page-header-info-cta\"\n >\n {cta.icon && <span className=\"mr-1\">{cta.icon}</span>}\n {cta.label}\n </Button>\n )}\n {onDismiss && (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n onClick={onDismiss}\n aria-label={dismissLabel}\n className=\"size-8 shrink-0 p-0 hover:bg-foreground/5 pointer-coarse:size-11\"\n data-testid=\"page-header-info-dismiss\"\n >\n <X className=\"size-4\" />\n </Button>\n )}\n </div>\n </div>\n </div>\n )\n}\n","import type { ReactNode } from 'react'\nimport { cn } from '@arbidocs/react/ui'\n\nconst SECONDARY_WIDTH = {\n sm: '@3xl:w-72',\n md: '@3xl:w-80',\n lg: '@3xl:w-96',\n xl: '@3xl:w-[28rem]',\n} as const\n\nexport interface SplitLayoutProps {\n /** The main pane (the detail, the form, the transcript): takes the remaining width. */\n primary: ReactNode\n /** The side pane (the list, the preview, the launcher): fixed width beside, full width below. */\n secondary: ReactNode\n /** Width of the side pane once beside the main one. Default `md` (20rem). */\n secondarySize?: keyof typeof SECONDARY_WIDTH\n /** Which side the secondary pane sits on once side by side. Default `end`. */\n secondaryPosition?: 'start' | 'end'\n /** When stacked, show the secondary pane first. Default false (primary first). */\n secondaryFirstWhenStacked?: boolean\n className?: string\n primaryClassName?: string\n secondaryClassName?: string\n testId?: string\n}\n\n/**\n * Two panes (list and detail, form and preview) that stack by the width of their CONTAINER,\n * not the viewport: side by side from 48rem of container width, stacked below. Inside\n * `Shell.Content` / `PageContainer` (both are containers) an open dock or a narrow window\n * therefore stacks the panes instead of squeezing the main one to a sliver. Every pane has\n * `min-w-0`, so long words and wide tables shrink instead of stretching the grid.\n */\nexport function SplitLayout({\n primary,\n secondary,\n secondarySize = 'md',\n secondaryPosition = 'end',\n secondaryFirstWhenStacked = false,\n className,\n primaryClassName,\n secondaryClassName,\n testId = 'split-layout',\n}: SplitLayoutProps) {\n const secondaryAtStart = secondaryPosition === 'start'\n return (\n <div\n data-slot=\"split-layout\"\n data-testid={testId}\n className={cn('flex flex-col gap-6 @3xl:flex-row @3xl:items-start', className)}\n >\n <div\n data-slot=\"split-primary\"\n className={cn(\n 'min-w-0 @3xl:flex-1',\n secondaryFirstWhenStacked && 'order-2',\n secondaryAtStart ? '@3xl:order-2' : '@3xl:order-1',\n primaryClassName\n )}\n >\n {primary}\n </div>\n <div\n data-slot=\"split-secondary\"\n className={cn(\n 'min-w-0 @3xl:shrink-0',\n SECONDARY_WIDTH[secondarySize],\n secondaryFirstWhenStacked && 'order-1',\n secondaryAtStart ? '@3xl:order-1' : '@3xl:order-2',\n secondaryClassName\n )}\n >\n {secondary}\n </div>\n </div>\n )\n}\n"]}