@adea-ai/ui 0.142.3 → 0.143.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/components/composites/accent-picker/accent-picker.d.ts +28 -0
  2. package/dist/components/composites/accent-picker/accent-picker.d.ts.map +1 -0
  3. package/dist/components/composites/accent-picker/accent-picker.js +97 -0
  4. package/dist/components/composites/accent-picker/accent-picker.js.map +1 -0
  5. package/dist/components/composites/accent-picker/index.d.ts +2 -0
  6. package/dist/components/composites/accent-picker/index.d.ts.map +1 -0
  7. package/dist/components/composites/accent-picker/index.js +2 -0
  8. package/dist/components/composites/icon-picker/icon-picker.d.ts +37 -0
  9. package/dist/components/composites/icon-picker/icon-picker.d.ts.map +1 -0
  10. package/dist/components/composites/icon-picker/icon-picker.js +187 -0
  11. package/dist/components/composites/icon-picker/icon-picker.js.map +1 -0
  12. package/dist/components/composites/icon-picker/image-data-url.d.ts +42 -0
  13. package/dist/components/composites/icon-picker/image-data-url.d.ts.map +1 -0
  14. package/dist/components/composites/icon-picker/image-data-url.js +90 -0
  15. package/dist/components/composites/icon-picker/image-data-url.js.map +1 -0
  16. package/dist/components/composites/icon-picker/index.d.ts +4 -0
  17. package/dist/components/composites/icon-picker/index.d.ts.map +1 -0
  18. package/dist/components/composites/icon-picker/index.js +4 -0
  19. package/dist/components/composites/icon-picker/shell-icons.d.ts +264 -0
  20. package/dist/components/composites/icon-picker/shell-icons.d.ts.map +1 -0
  21. package/dist/components/composites/icon-picker/shell-icons.js +334 -0
  22. package/dist/components/composites/icon-picker/shell-icons.js.map +1 -0
  23. package/dist/components/composites/terminal/terminal.js +2 -2
  24. package/dist/components/composites/terminal/terminal.js.map +1 -1
  25. package/dist/components/composites/workspace-switcher/index.d.ts +2 -0
  26. package/dist/components/composites/workspace-switcher/index.d.ts.map +1 -0
  27. package/dist/components/composites/workspace-switcher/index.js +2 -0
  28. package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts +44 -0
  29. package/dist/components/composites/workspace-switcher/workspace-switcher.d.ts.map +1 -0
  30. package/dist/components/composites/workspace-switcher/workspace-switcher.js +157 -0
  31. package/dist/components/composites/workspace-switcher/workspace-switcher.js.map +1 -0
  32. package/dist/components/layout/shell-rail/index.d.ts +2 -0
  33. package/dist/components/layout/shell-rail/index.d.ts.map +1 -0
  34. package/dist/components/layout/shell-rail/index.js +2 -0
  35. package/dist/components/layout/shell-rail/shell-rail.d.ts +36 -0
  36. package/dist/components/layout/shell-rail/shell-rail.d.ts.map +1 -0
  37. package/dist/components/layout/shell-rail/shell-rail.js +124 -0
  38. package/dist/components/layout/shell-rail/shell-rail.js.map +1 -0
  39. package/dist/components/layout/shell-top-bar/index.d.ts +2 -0
  40. package/dist/components/layout/shell-top-bar/index.d.ts.map +1 -0
  41. package/dist/components/layout/shell-top-bar/index.js +2 -0
  42. package/dist/components/layout/shell-top-bar/shell-top-bar.d.ts +68 -0
  43. package/dist/components/layout/shell-top-bar/shell-top-bar.d.ts.map +1 -0
  44. package/dist/components/layout/shell-top-bar/shell-top-bar.js +135 -0
  45. package/dist/components/layout/shell-top-bar/shell-top-bar.js.map +1 -0
  46. package/dist/components/layout/top-bar/top-bar.d.ts +21 -6
  47. package/dist/components/layout/top-bar/top-bar.d.ts.map +1 -1
  48. package/dist/components/layout/top-bar/top-bar.js +2 -2
  49. package/dist/components/layout/top-bar/top-bar.js.map +1 -1
  50. package/dist/index.d.ts +5 -0
  51. package/dist/index.d.ts.map +1 -1
  52. package/dist/index.js +8 -1
  53. package/dist/r/accent-picker.json +25 -0
  54. package/dist/r/icon-picker.json +36 -0
  55. package/dist/r/registry.json +137 -0
  56. package/dist/r/shell-rail.json +27 -0
  57. package/dist/r/shell-top-bar.json +23 -0
  58. package/dist/r/src/components/composites/accent-picker/accent-picker.tsx +85 -0
  59. package/dist/r/src/components/composites/accent-picker/index.ts +1 -0
  60. package/dist/r/src/components/composites/icon-picker/icon-picker.tsx +184 -0
  61. package/dist/r/src/components/composites/icon-picker/image-data-url.ts +107 -0
  62. package/dist/r/src/components/composites/icon-picker/index.ts +20 -0
  63. package/dist/r/src/components/composites/icon-picker/shell-icons.ts +166 -0
  64. package/dist/r/src/components/composites/workspace-switcher/index.ts +5 -0
  65. package/dist/r/src/components/composites/workspace-switcher/workspace-switcher.tsx +128 -0
  66. package/dist/r/src/components/layout/shell-rail/index.ts +1 -0
  67. package/dist/r/src/components/layout/shell-rail/shell-rail.tsx +120 -0
  68. package/dist/r/src/components/layout/shell-top-bar/index.ts +1 -0
  69. package/dist/r/src/components/layout/shell-top-bar/shell-top-bar.tsx +185 -0
  70. package/dist/r/src/components/layout/top-bar/top-bar.tsx +27 -8
  71. package/dist/r/workspace-switcher.json +26 -0
  72. package/package.json +1 -1
  73. package/registry.json +137 -0
  74. package/src/components/composites/accent-picker/accent-picker.tsx +85 -0
  75. package/src/components/composites/accent-picker/index.ts +1 -0
  76. package/src/components/composites/icon-picker/icon-picker.tsx +184 -0
  77. package/src/components/composites/icon-picker/image-data-url.ts +107 -0
  78. package/src/components/composites/icon-picker/index.ts +20 -0
  79. package/src/components/composites/icon-picker/shell-icons.ts +166 -0
  80. package/src/components/composites/workspace-switcher/index.ts +5 -0
  81. package/src/components/composites/workspace-switcher/workspace-switcher.tsx +128 -0
  82. package/src/components/layout/shell-rail/index.ts +1 -0
  83. package/src/components/layout/shell-rail/shell-rail.tsx +120 -0
  84. package/src/components/layout/shell-top-bar/index.ts +1 -0
  85. package/src/components/layout/shell-top-bar/shell-top-bar.tsx +185 -0
  86. package/src/components/layout/top-bar/top-bar.tsx +27 -8
  87. package/src/index.ts +5 -0
@@ -1 +1 @@
1
- {"version":3,"file":"terminal.js","names":["ArrowDown","Check","CircleAlert","CircleSlash","Copy","Eraser","LoaderCircle","createEffect","createMemo","createSignal","For","on","Show","splitProps","ComponentProps","writeClipboardText","cn","Button","createAnsiParser","isPlainStyle","resolveColors","AnsiLine","AnsiStyle","isAtBottom","isFailedExit","revealEarlier","terminalStatusLabel","terminalWindow","TerminalStatus","TerminalProps","Omit","output","command","status","maxLines","retainLines","maxHeight","wrap","size","onClear","copyLabel","copiedLabel","clearLabel","onCopy","ok","TERMINAL_MAX_LINES","FG_CLASS","const","BG_CLASS","segmentClass","style","fg","bg","bold","dim","italic","underline","strike","LineView","props","line","_el$","_tmpl$2","_$insert","_$createComponent","each","segments","children","segment","text","_el$7","_tmpl$3","_$effect","_$className","when","truncated","_el$2","_tmpl$","_el$3","firstChild","_el$6","nextSibling","_el$5","toLocaleString","sameAnsiLine","left","right","length","every","index","StatusReadout","_el$8","_tmpl$5","state","_el$9","_tmpl$4","fallback","_p$","_v$","_v$2","e","_$setAttribute","t","undefined","Terminal","local","rest","small","pageSize","Math","max","floor","newParser","parser","consumed","epoch","revision","next","startsWith","write","slice","equals","limit","setLimit","defer","empty","outputRows","rows","lines","open","openLine","push","parked","setParked","end","total","droppedLines","anchorEnd","current","position","lineWindow","visibleRows","start","retainedIndex","changedParkedLine","newerRows","later","scroller","HTMLDivElement","following","onScroll","atEnd","scrollHeight","scrollTop","clientHeight","currentEpoch","jumpToLatest","focus","copied","setCopied","copyFailed","setCopyFailed","copy","setTimeout","regionLabel","_el$0","_tmpl$0","_el$1","_el$13","_el$16","_el$17","_$spread","_$mergeProps","data-size","aria-busy","class","_tmpl$1","_el$10","_tmpl$6","_el$11","_el$12","_$memo","variant","aria-label","onClick","title","hidden","evicted","_el$14","_tmpl$7","_el$15","lost","revealable","min","addEventListener","_$use","element","_el$26","_tmpl$10","_el$27","_el$18","_tmpl$8","_el$19","_tmpl$9","_el$20","_el$23","_el$21","_el$24","_el$22","_v$3","_v$4","_v$5","a","_$setStyleProperty","_$createComponent","_$className","_$setAttribute","_$mergeProps","_$memo","_$setStyleProperty"],"sources":["../../../../src/components/composites/terminal/terminal.tsx"],"sourcesContent":["import {\n ArrowDown,\n Check,\n CircleAlert,\n CircleSlash,\n Copy,\n Eraser,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n For,\n on,\n Show,\n splitProps,\n type ComponentProps,\n} from 'solid-js'\nimport { writeClipboardText } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n createAnsiParser,\n isPlainStyle,\n resolveColors,\n type AnsiLine,\n type AnsiStyle,\n} from './ansi'\nimport {\n isAtBottom,\n isFailedExit,\n revealEarlier,\n terminalStatusLabel,\n terminalWindow,\n type TerminalStatus,\n} from './terminal-model'\n\n/**\n * Terminal.\n *\n * A command and its output, as it arrives. It is the thing to put inside an\n * agent's \"ran a command\" line (a `TraceLine`, with `size=\"sm\"`) when the output\n * is the evidence; reach for `CodeBlock` instead when the text is source or a\n * finished log that needs no live behaviour, and for `TestResults` when the\n * output is a test run the host can structure.\n *\n * It does not wrap `CodeBlock`. A block's `highlight` seam re-renders the whole\n * body whenever the code changes, which is exactly wrong for output that grows a\n * line at a time, and a terminal has to own its scroller to follow the tail. It\n * keeps the block's header and surface vocabulary so the two read as one family.\n *\n * ## What the output is allowed to do\n *\n * Output is untrusted bytes. It is parsed by `createAnsiParser` into plain text\n * and a fixed set of styles — sixteen theme colours, bold, dim, italic,\n * underline, strike-through, reverse — and everything else (cursor movement,\n * title and clipboard sequences, anything malformed) is dropped, never echoed.\n * Colours come from the theme's `--terminal-ansi-*` tokens, painted on the\n * theme's own terminal background, so a program's colours keep the contrast the\n * theme measured for them. Nothing is rendered as markup.\n *\n * ## Streaming\n *\n * `output` is the whole string so far. When the new value begins with the old\n * one, only the appended text is parsed, so a chunk costs the size of the chunk\n * and not of the transcript. Finished lines are keyed by identity and are never\n * re-rendered; only the line still being written changes, which is what makes a\n * `\\r` progress bar redraw in place. Batch appends per frame — the host sees a\n * prefix check proportional to the output on every change.\n *\n * Only the last `maxLines` finished lines are mounted. The rest are counted in\n * an explicit note with a control to show them a page at a time, because tens of\n * thousands of row elements are a frozen page, not a transcript. Copy still\n * writes `output` exactly as given — not the rendered lines, not the visible tail.\n *\n * ## Following the tail\n *\n * The terminal scrolls inside its own bounded box and follows new output only\n * while the reader is at the bottom of that box. Scrolling up *parks* the view:\n * the lines mounted are the ones that were there when they left, however much\n * output arrives, and \"Jump to latest\" is the only way back to the tail (reaching\n * the bottom of a parked view with nothing newer resumes it, because nothing was\n * missed). If retention discards the lines they were reading the note says how\n * many, and when none are left the oldest retained lines are shown. The page\n * itself is never scrolled. Scrolling is instant, so there is no animation to\n * reduce.\n *\n * ## Status is a claim\n *\n * `status` is drawn only when the host passes it, in words as well as an icon,\n * and only a non-zero exit is toned as a failure: this component does not decide\n * that a command \"passed\". Without a status the header says nothing about whether\n * the command is still running. `onClear` adds a clear button; without it the\n * output is the host's record and nothing here offers to erase it.\n */\nexport type TerminalProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** Everything the command has printed so far, exactly as received. */\n output: string\n /** The command line. Shown as text; the prompt glyph is decoration. */\n command?: string\n status?: TerminalStatus\n /** Finished lines mounted at once; earlier ones are counted and revealed a page at a time. */\n maxLines?: number\n /** Finished lines kept at all; older ones are discarded and counted. Default 200 000. */\n retainLines?: number\n /** Height of the output box, which scrolls past it. A number is pixels. Default `20rem`. */\n maxHeight?: number | string\n /** Soft-wrap long lines instead of scrolling sideways. Off: terminal columns keep their alignment. */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /** Show a clear button. The host empties `output`; the terminal erases nothing itself. */\n onClear?: () => void\n copyLabel?: string\n copiedLabel?: string\n clearLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\n/** Finished lines mounted by default. */\nexport const TERMINAL_MAX_LINES = 1000\n\n// One literal class per colour, written out in full so the stylesheet generator\n// can see each of them; a class assembled from an index would never be emitted.\nconst FG_CLASS = [\n 'text-(color:--terminal-ansi-black)',\n 'text-(color:--terminal-ansi-red)',\n 'text-(color:--terminal-ansi-green)',\n 'text-(color:--terminal-ansi-yellow)',\n 'text-(color:--terminal-ansi-blue)',\n 'text-(color:--terminal-ansi-magenta)',\n 'text-(color:--terminal-ansi-cyan)',\n 'text-(color:--terminal-ansi-white)',\n 'text-(color:--terminal-ansi-bright-black)',\n 'text-(color:--terminal-ansi-bright-red)',\n 'text-(color:--terminal-ansi-bright-green)',\n 'text-(color:--terminal-ansi-bright-yellow)',\n 'text-(color:--terminal-ansi-bright-blue)',\n 'text-(color:--terminal-ansi-bright-magenta)',\n 'text-(color:--terminal-ansi-bright-cyan)',\n 'text-(color:--terminal-ansi-bright-white)',\n] as const\nconst BG_CLASS = [\n 'bg-(--terminal-ansi-black)',\n 'bg-(--terminal-ansi-red)',\n 'bg-(--terminal-ansi-green)',\n 'bg-(--terminal-ansi-yellow)',\n 'bg-(--terminal-ansi-blue)',\n 'bg-(--terminal-ansi-magenta)',\n 'bg-(--terminal-ansi-cyan)',\n 'bg-(--terminal-ansi-white)',\n 'bg-(--terminal-ansi-bright-black)',\n 'bg-(--terminal-ansi-bright-red)',\n 'bg-(--terminal-ansi-bright-green)',\n 'bg-(--terminal-ansi-bright-yellow)',\n 'bg-(--terminal-ansi-bright-blue)',\n 'bg-(--terminal-ansi-bright-magenta)',\n 'bg-(--terminal-ansi-bright-cyan)',\n 'bg-(--terminal-ansi-bright-white)',\n] as const\n\nfunction segmentClass(style: AnsiStyle): string {\n const { fg, bg } = resolveColors(style)\n return cn(\n {\n 'font-bold': style.bold,\n 'opacity-70': style.dim,\n italic: style.italic,\n underline: style.underline && !style.strike,\n 'line-through': style.strike && !style.underline,\n '[text-decoration-line:underline_line-through]': style.underline && style.strike,\n 'text-(color:--terminal-background)': fg === 'default-bg',\n 'bg-(--terminal-foreground)': bg === 'default-fg',\n },\n typeof fg === 'number' && FG_CLASS[fg],\n typeof bg === 'number' && BG_CLASS[bg]\n )\n}\n\nfunction LineView(props: { line: AnsiLine; wrap: boolean }) {\n return (\n // `min-h-lh` keeps an empty line one line tall; a block with no text would\n // collapse and the transcript would lose its blank lines.\n <div\n class={cn('min-h-lh', {\n 'whitespace-pre-wrap [overflow-wrap:anywhere]': props.wrap,\n 'w-max min-w-full': !props.wrap,\n })}\n >\n <For each={props.line.segments}>\n {(segment) =>\n isPlainStyle(segment.style) ? (\n segment.text\n ) : (\n <span class={segmentClass(segment.style)}>{segment.text}</span>\n )\n }\n </For>\n <Show when={props.line.truncated > 0}>\n <span class=\"opacity-70 select-none\">\n {' '}\n … {props.line.truncated.toLocaleString()} more characters not shown\n </span>\n </Show>\n </div>\n )\n}\n\nfunction sameAnsiLine(left: AnsiLine, right: AnsiLine): boolean {\n return (\n left.truncated === right.truncated &&\n left.segments.length === right.segments.length &&\n left.segments.every(\n (segment, index) =>\n segment.text === right.segments[index]?.text &&\n segment.style === right.segments[index]?.style\n )\n )\n}\n\nfunction StatusReadout(props: { status: TerminalStatus }) {\n return (\n // A live region, so a command that finishes while the reader is elsewhere is\n // announced once, in words.\n <span\n role=\"status\"\n data-slot=\"terminal-status\"\n data-state={props.status.state}\n class={cn('flex shrink-0 items-center gap-1 text-xs', {\n 'text-destructive': isFailedExit(props.status),\n 'text-info': props.status.state === 'running',\n 'text-muted-foreground': props.status.state !== 'running' && !isFailedExit(props.status),\n })}\n >\n {/* A zero exit gets no glyph: a tick would be this component deciding the\n command succeeded, and some tools exit non-zero on purpose or zero on\n failure. The words carry the fact; only a non-zero code is toned. */}\n <Show when={props.status.state !== 'exited' || isFailedExit(props.status)}>\n <span aria-hidden=\"true\" class=\"grid size-3.5 place-items-center [&_svg]:size-3.5\">\n <Show\n when={props.status.state === 'running'}\n fallback={\n <Show when={props.status.state === 'cancelled'} fallback={<CircleAlert />}>\n <CircleSlash />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>\n </Show>\n {terminalStatusLabel(props.status)}\n </span>\n )\n}\n\nexport function Terminal(props: TerminalProps) {\n const [local, rest] = splitProps(props, [\n 'output',\n 'command',\n 'status',\n 'maxLines',\n 'retainLines',\n 'maxHeight',\n 'wrap',\n 'size',\n 'onClear',\n 'copyLabel',\n 'copiedLabel',\n 'clearLabel',\n 'onCopy',\n 'class',\n ])\n\n const small = () => local.size === 'sm'\n const pageSize = () => Math.max(1, Math.floor(local.maxLines ?? TERMINAL_MAX_LINES))\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : (local.maxHeight ?? '20rem')\n\n // The parser outlives renders: it holds the half-read escape sequence, the\n // current style and the open line. A new `output` that extends the old one is\n // fed only its tail; anything else (a clear, a different command) starts over.\n const newParser = () => createAnsiParser({ retainLines: local.retainLines })\n let parser = newParser()\n let consumed = ''\n // Bumped when the output restarts, so a parked position from the old output\n // is never applied to the new one.\n let epoch = 0\n const revision = createMemo(\n () => {\n const next = local.output\n if (next.length >= consumed.length && next.startsWith(consumed)) {\n parser.write(next.slice(consumed.length))\n } else {\n parser = newParser()\n parser.write(next)\n epoch += 1\n }\n consumed = next\n return epoch\n },\n undefined,\n { equals: false }\n )\n\n const [limit, setLimit] = createSignal(pageSize())\n createEffect(on(pageSize, (size) => setLimit(size), { defer: true }))\n // A cleared terminal is a fresh one: the next command starts at the page size.\n createEffect(\n on(\n () => local.output === '',\n (empty) => {\n if (empty) setLimit(pageSize())\n },\n { defer: true }\n )\n )\n\n const outputRows = createMemo(\n () => {\n revision()\n const rows = parser.lines.slice()\n const open = parser.openLine()\n if (open) rows.push(open)\n return rows\n },\n [],\n { equals: false }\n )\n // Where the reader parked, as a count of lines since the output began. An open\n // line is a row too: freeze its snapshot so streamed characters and CR redraws\n // do not rewrite the text under a parked reader.\n const [parked, setParked] = createSignal<{ epoch: number; end: number; open?: AnsiLine }>()\n const total = () => parser.droppedLines + outputRows().length\n const anchorEnd = () => {\n const current = revision()\n const position = parked()\n return position && position.epoch === current ? position.end : undefined\n }\n const lineWindow = createMemo(() => {\n revision()\n return terminalWindow(outputRows().length, parser.droppedLines, limit(), anchorEnd())\n })\n // Finished rows keep their parser identity. If an open row existed when the\n // reader parked, substitute its immutable snapshot until they jump to latest.\n const visibleRows = createMemo(\n () => {\n revision()\n const start = lineWindow().start\n const end = lineWindow().end\n const rows = outputRows().slice(start, end)\n const position = parked()\n if (position?.epoch === revision() && position.open) {\n const retainedIndex = position.end - 1 - parser.droppedLines\n if (retainedIndex >= start && retainedIndex < end) {\n rows[retainedIndex - start] = position.open\n }\n }\n return rows\n },\n [],\n { equals: false }\n )\n const changedParkedLine = () => {\n const position = parked()\n if (position?.epoch !== revision() || !position.open) return false\n const retainedIndex = position.end - 1 - parser.droppedLines\n const current = outputRows()[retainedIndex]\n return current !== undefined && !sameAnsiLine(position.open, current)\n }\n const newerRows = () => lineWindow().later + (changedParkedLine() ? 1 : 0)\n\n let scroller: HTMLDivElement | undefined\n const following = () => anchorEnd() === undefined\n\n const onScroll = () => {\n if (!scroller) return\n const atEnd = isAtBottom(scroller.scrollHeight, scroller.scrollTop, scroller.clientHeight)\n const position = anchorEnd()\n if (!atEnd) {\n if (position === undefined) {\n const currentEpoch = revision()\n setParked({ epoch: currentEpoch, end: total(), open: parser.openLine() })\n }\n } else if (position !== undefined && position >= total() && !changedParkedLine()) {\n // Back at the end of a view with nothing newer: nothing was missed.\n setParked(undefined)\n }\n }\n createEffect(\n on(revision, () => {\n if (scroller && following()) scroller.scrollTop = scroller.scrollHeight\n })\n )\n const jumpToLatest = () => {\n if (!scroller) return\n setParked(undefined)\n scroller.scrollTop = scroller.scrollHeight\n // The button is about to disappear; leave focus somewhere real.\n scroller.focus()\n }\n\n const [copied, setCopied] = createSignal(false)\n const [copyFailed, setCopyFailed] = createSignal(false)\n const copy = async () => {\n let ok = true\n try {\n await writeClipboardText(local.output)\n } catch {\n ok = false\n }\n setCopied(ok)\n setCopyFailed(!ok)\n local.onCopy?.(ok)\n if (ok) setTimeout(() => setCopied(false), 1500)\n }\n\n const empty = () => local.output === ''\n const regionLabel = () =>\n local.command ? `Output of ${local.command.slice(0, 120)}` : 'Terminal output'\n\n return (\n <div\n data-slot=\"terminal\"\n data-size={local.size ?? 'default'}\n aria-busy={local.status?.state === 'running' || undefined}\n class={cn(\n 'group/terminal overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n >\n <div class={cn('flex items-center gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}>\n <Show\n when={local.command !== undefined}\n fallback={<span class=\"flex-1 text-xs text-muted-foreground\">Terminal</span>}\n >\n <span class=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"shrink-0 font-code text-code text-muted-foreground select-none\"\n >\n $\n </span>\n <code\n title={local.command}\n class=\"line-clamp-2 min-w-0 font-code text-code text-foreground [overflow-wrap:anywhere]\"\n >\n {local.command}\n </code>\n </span>\n </Show>\n <Show when={local.status}>{(status) => <StatusReadout status={status()} />}</Show>\n {/* Hidden until the terminal is hovered or holds focus, never removed:\n a control that only exists under the pointer is unreachable by\n keyboard, and a touch screen has no hover, so it always shows there. */}\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/terminal:opacity-100 group-hover/terminal:opacity-100 [@media(hover:none)]:opacity-100\">\n <Show when={local.onClear !== undefined && !empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={local.clearLabel ?? 'Clear output'}\n onClick={() => local.onClear?.()}\n >\n <Eraser aria-hidden=\"true\" />\n </Button>\n </Show>\n <Show when={!empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy output')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </Show>\n </div>\n </div>\n\n <Show when={lineWindow().hidden > 0 || lineWindow().evicted > 0}>\n <div\n data-slot=\"terminal-hidden-note\"\n class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\"\n >\n <span>\n <Show when={lineWindow().hidden > 0}>\n {lineWindow().hidden.toLocaleString()} earlier{' '}\n {lineWindow().hidden === 1 ? 'line' : 'lines'} hidden\n <Show when={parser.droppedLines > 0}>\n {' '}\n ({parser.droppedLines.toLocaleString()} only in the copy)\n </Show>\n .\n </Show>\n <Show when={lineWindow().evicted > 0}>\n {' '}\n {lineWindow().lost\n ? `The lines you were reading were discarded to keep memory bounded; showing the oldest ${lineWindow().end.toLocaleString()} still kept.`\n : `${lineWindow().evicted.toLocaleString()} of the lines you were reading were discarded to keep memory bounded.`}\n </Show>\n </span>\n <Show when={lineWindow().revealable > 0}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => setLimit(revealEarlier(limit(), pageSize(), outputRows().length))}\n >\n Show {Math.min(pageSize(), lineWindow().revealable).toLocaleString()} earlier\n </Button>\n </Show>\n </div>\n </Show>\n\n <div class=\"relative\">\n <div\n ref={(element) => (scroller = element)}\n data-slot=\"terminal-body\"\n // A region that scrolls must be focusable, and a tab stop needs a name.\n role=\"region\"\n tabindex=\"0\"\n aria-label={regionLabel()}\n onScroll={onScroll}\n style={{ 'max-height': maxHeight() }}\n class=\"scroll-fade overflow-auto border-t border-border bg-(--terminal-background) text-(color:--terminal-foreground)\"\n >\n <Show\n when={!empty()}\n fallback={\n <p class={cn('m-0 opacity-70', small() ? 'px-2 py-1.5' : 'px-3 py-2')}>\n <span class=\"font-code text-code\">\n {local.status?.state === 'running' ? 'Waiting for output…' : 'No output'}\n </span>\n </p>\n }\n >\n <pre\n class={cn(\n 'm-0 font-code text-code leading-normal',\n small() ? 'px-2 py-1.5' : 'px-3 py-2'\n )}\n >\n <For each={visibleRows()}>\n {(line) => <LineView line={line} wrap={local.wrap === true} />}\n </For>\n </pre>\n </Show>\n </div>\n <Show when={newerRows() > 0}>\n <Button\n variant=\"secondary\"\n size=\"2xs\"\n class=\"absolute end-3 bottom-2 shadow-sm\"\n onClick={jumpToLatest}\n >\n <ArrowDown aria-hidden=\"true\" />\n Jump to latest\n <span class=\"text-muted-foreground tabular-nums\">\n ({newerRows().toLocaleString()} newer {newerRows() === 1 ? 'line' : 'lines'})\n </span>\n </Button>\n </Show>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0HA,IAAa6C,qBAAqB;AAIlC,IAAMC,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAA2C;AAE7C,IAAME,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAAmC;AAGrC,SAASC,aAAaC,OAA0B;CAC9C,MAAM,EAAEC,IAAIC,OAAOhC,cAAc8B,KAAK;CACtC,OAAOlC,GACL;EACE,aAAakC,MAAMG;EACnB,cAAcH,MAAMI;EACpBC,QAAQL,MAAMK;EACdC,WAAWN,MAAMM,aAAa,CAACN,MAAMO;EACrC,gBAAgBP,MAAMO,UAAU,CAACP,MAAMM;EACvC,iDAAiDN,MAAMM,aAAaN,MAAMO;EAC1E,sCAAsCN,OAAO;EAC7C,8BAA8BC,OAAO;CACvC,GACA,OAAOD,OAAO,YAAYL,SAASK,KACnC,OAAOC,OAAO,YAAYJ,SAASI,GACrC;AACF;AAEA,SAASM,SAASC,OAA0C;CAC1D,cAEE;EAAA,IAAAE,OAAAC,QAAA;EAAAC,OAAAF,MAAAG,gBAOGtD,KAAG;GAAA,IAACuD,OAAI;IAAA,OAAEN,MAAMC,KAAKM;GAAQ;GAAAC,WAC1BC,YACAjD,aAAaiD,QAAQlB,KAAK,IACxBkB,QAAQC,cAAI;IAAA,IAAAC,QAAAC,QAAA;IAAAR,OAAAO,aAE+BF,QAAQC,IAAI;IAAAG,aAAAC,UAAAH,OAA1CrB,aAAamB,QAAQlB,KAAK,CAAC,CAAA;IAAA,OAAAoB;GAAA,EAAA,CAAA;EACz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AAA,CAAA,GAAA,IAAA;EAAAlI,QAAAyB,QAAA;GAAA,IAAAgH,OAnIvEjM,GAAG,2BAA2B2F,MAAM,IAAI,gBAAgB,WAAW,GAACuG,OA8FhE9C,YAAY,GAAC+C,OAEF/K,UAAU;GAAC6K,SAAAhH,IAAAG,KAAA3B,UAAA8F,OAAAtE,IAAAG,IAAA6G,IAAA;GAAAC,SAAAjH,IAAAK,KAAAD,aAAAqE,QAAA,cAAAzE,IAAAK,IAAA4G,IAAA;GAAAC,SAAAlH,IAAAmH,KAAAC,iBAAA3C,QAAA,cAAAzE,IAAAmH,IAAAD,IAAA;GAAA,OAAAlH;EAAA,GAAA;GAAAG,GAAAG,KAAAA;GAAAD,GAAAC,KAAAA;GAAA6G,GAAA7G,KAAAA;EAAA,CAAA;EAAA,OAAA8D;CAAA,EAAA,CAAA;AA0C5C"}
1
+ {"version":3,"file":"terminal.js","names":["ArrowDown","Check","CircleAlert","CircleSlash","Copy","Eraser","LoaderCircle","createEffect","createMemo","createSignal","For","on","Show","splitProps","ComponentProps","writeClipboardText","cn","Button","createAnsiParser","isPlainStyle","resolveColors","AnsiLine","AnsiStyle","isAtBottom","isFailedExit","revealEarlier","terminalStatusLabel","terminalWindow","TerminalStatus","TerminalProps","Omit","output","command","status","maxLines","retainLines","maxHeight","wrap","size","onClear","copyLabel","copiedLabel","clearLabel","onCopy","ok","TERMINAL_MAX_LINES","FG_CLASS","const","BG_CLASS","segmentClass","style","fg","bg","bold","dim","italic","underline","strike","LineView","props","line","_el$","_tmpl$2","_$insert","_$createComponent","each","segments","children","segment","text","_el$7","_tmpl$3","_$effect","_$className","when","truncated","_el$2","_tmpl$","_el$3","firstChild","_el$6","nextSibling","_el$5","toLocaleString","sameAnsiLine","left","right","length","every","index","StatusReadout","_el$8","_tmpl$5","state","_el$9","_tmpl$4","fallback","_p$","_v$","_v$2","e","_$setAttribute","t","undefined","Terminal","local","rest","small","pageSize","Math","max","floor","newParser","parser","consumed","epoch","revision","next","startsWith","write","slice","equals","limit","setLimit","defer","empty","outputRows","rows","lines","open","openLine","push","parked","setParked","end","total","droppedLines","anchorEnd","current","position","lineWindow","visibleRows","start","retainedIndex","changedParkedLine","newerRows","later","scroller","HTMLDivElement","following","onScroll","atEnd","scrollHeight","scrollTop","clientHeight","currentEpoch","jumpToLatest","focus","copied","setCopied","copyFailed","setCopyFailed","copy","setTimeout","regionLabel","_el$0","_tmpl$0","_el$1","_el$13","_el$16","_el$17","_$spread","_$mergeProps","data-size","aria-busy","class","_tmpl$1","_el$10","_tmpl$6","_el$11","_el$12","_$memo","variant","aria-label","onClick","title","hidden","evicted","_el$14","_tmpl$7","_el$15","lost","revealable","min","addEventListener","_$use","element","_el$26","_tmpl$10","_el$27","_el$18","_tmpl$8","_el$19","_tmpl$9","_el$20","_el$23","_el$21","_el$24","_el$22","_v$3","_v$4","_v$5","a","_$setStyleProperty","_$createComponent","_$className","_$setAttribute","Terminal","_$mergeProps","_$memo","_$setStyleProperty"],"sources":["../../../../src/components/composites/terminal/terminal.tsx"],"sourcesContent":["import {\n ArrowDown,\n Check,\n CircleAlert,\n CircleSlash,\n Copy,\n Eraser,\n LoaderCircle,\n} from 'lucide-solid'\nimport {\n createEffect,\n createMemo,\n createSignal,\n For,\n on,\n Show,\n splitProps,\n type ComponentProps,\n} from 'solid-js'\nimport { writeClipboardText } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { Button } from '../../ui/button'\nimport {\n createAnsiParser,\n isPlainStyle,\n resolveColors,\n type AnsiLine,\n type AnsiStyle,\n} from './ansi'\nimport {\n isAtBottom,\n isFailedExit,\n revealEarlier,\n terminalStatusLabel,\n terminalWindow,\n type TerminalStatus,\n} from './terminal-model'\n\n/**\n * Terminal.\n *\n * A command and its output, as it arrives. It is the thing to put inside an\n * agent's \"ran a command\" line (a `TraceLine`, with `size=\"sm\"`) when the output\n * is the evidence; reach for `CodeBlock` instead when the text is source or a\n * finished log that needs no live behaviour, and for `TestResults` when the\n * output is a test run the host can structure.\n *\n * It does not wrap `CodeBlock`. A block's `highlight` seam re-renders the whole\n * body whenever the code changes, which is exactly wrong for output that grows a\n * line at a time, and a terminal has to own its scroller to follow the tail. It\n * keeps the block's header and surface vocabulary so the two read as one family.\n *\n * ## What the output is allowed to do\n *\n * Output is untrusted bytes. It is parsed by `createAnsiParser` into plain text\n * and a fixed set of styles — sixteen theme colours, bold, dim, italic,\n * underline, strike-through, reverse — and everything else (cursor movement,\n * title and clipboard sequences, anything malformed) is dropped, never echoed.\n * Colours come from the theme's `--terminal-ansi-*` tokens, painted on the\n * theme's own terminal background, so a program's colours keep the contrast the\n * theme measured for them. Nothing is rendered as markup.\n *\n * ## Streaming\n *\n * `output` is the whole string so far. When the new value begins with the old\n * one, only the appended text is parsed, so a chunk costs the size of the chunk\n * and not of the transcript. Finished lines are keyed by identity and are never\n * re-rendered; only the line still being written changes, which is what makes a\n * `\\r` progress bar redraw in place. Batch appends per frame — the host sees a\n * prefix check proportional to the output on every change.\n *\n * Only the last `maxLines` finished lines are mounted. The rest are counted in\n * an explicit note with a control to show them a page at a time, because tens of\n * thousands of row elements are a frozen page, not a transcript. Copy still\n * writes `output` exactly as given — not the rendered lines, not the visible tail.\n *\n * ## Following the tail\n *\n * The terminal scrolls inside its own bounded box and follows new output only\n * while the reader is at the bottom of that box. Scrolling up *parks* the view:\n * the lines mounted are the ones that were there when they left, however much\n * output arrives, and \"Jump to latest\" is the only way back to the tail (reaching\n * the bottom of a parked view with nothing newer resumes it, because nothing was\n * missed). If retention discards the lines they were reading the note says how\n * many, and when none are left the oldest retained lines are shown. The page\n * itself is never scrolled. Scrolling is instant, so there is no animation to\n * reduce.\n *\n * ## Status is a claim\n *\n * `status` is drawn only when the host passes it, in words as well as an icon,\n * and only a non-zero exit is toned as a failure: this component does not decide\n * that a command \"passed\". Without a status the header says nothing about whether\n * the command is still running. `onClear` adds a clear button; without it the\n * output is the host's record and nothing here offers to erase it.\n */\nexport type TerminalProps = Omit<ComponentProps<'div'>, 'children'> & {\n /** Everything the command has printed so far, exactly as received. */\n output: string\n /** The command line. Shown as text; the prompt glyph is decoration. */\n command?: string\n status?: TerminalStatus\n /** Finished lines mounted at once; earlier ones are counted and revealed a page at a time. */\n maxLines?: number\n /** Finished lines kept at all; older ones are discarded and counted. Default 200 000. */\n retainLines?: number\n /** Height of the output box, which scrolls past it. A number is pixels. Default `20rem`. */\n maxHeight?: number | string\n /** Soft-wrap long lines instead of scrolling sideways. Off: terminal columns keep their alignment. */\n wrap?: boolean\n /** `sm` is the compact chrome for output nested inside a Trace line. */\n size?: 'default' | 'sm'\n /** Show a clear button. The host empties `output`; the terminal erases nothing itself. */\n onClear?: () => void\n copyLabel?: string\n copiedLabel?: string\n clearLabel?: string\n /** Called after each copy attempt with whether the clipboard accepted it. */\n onCopy?: (ok: boolean) => void\n}\n\n/** Finished lines mounted by default. */\nexport const TERMINAL_MAX_LINES = 1000\n\n// One literal class per colour, written out in full so the stylesheet generator\n// can see each of them; a class assembled from an index would never be emitted.\nconst FG_CLASS = [\n 'text-(color:--terminal-ansi-black)',\n 'text-(color:--terminal-ansi-red)',\n 'text-(color:--terminal-ansi-green)',\n 'text-(color:--terminal-ansi-yellow)',\n 'text-(color:--terminal-ansi-blue)',\n 'text-(color:--terminal-ansi-magenta)',\n 'text-(color:--terminal-ansi-cyan)',\n 'text-(color:--terminal-ansi-white)',\n 'text-(color:--terminal-ansi-bright-black)',\n 'text-(color:--terminal-ansi-bright-red)',\n 'text-(color:--terminal-ansi-bright-green)',\n 'text-(color:--terminal-ansi-bright-yellow)',\n 'text-(color:--terminal-ansi-bright-blue)',\n 'text-(color:--terminal-ansi-bright-magenta)',\n 'text-(color:--terminal-ansi-bright-cyan)',\n 'text-(color:--terminal-ansi-bright-white)',\n] as const\nconst BG_CLASS = [\n 'bg-(--terminal-ansi-black)',\n 'bg-(--terminal-ansi-red)',\n 'bg-(--terminal-ansi-green)',\n 'bg-(--terminal-ansi-yellow)',\n 'bg-(--terminal-ansi-blue)',\n 'bg-(--terminal-ansi-magenta)',\n 'bg-(--terminal-ansi-cyan)',\n 'bg-(--terminal-ansi-white)',\n 'bg-(--terminal-ansi-bright-black)',\n 'bg-(--terminal-ansi-bright-red)',\n 'bg-(--terminal-ansi-bright-green)',\n 'bg-(--terminal-ansi-bright-yellow)',\n 'bg-(--terminal-ansi-bright-blue)',\n 'bg-(--terminal-ansi-bright-magenta)',\n 'bg-(--terminal-ansi-bright-cyan)',\n 'bg-(--terminal-ansi-bright-white)',\n] as const\n\nfunction segmentClass(style: AnsiStyle): string {\n const { fg, bg } = resolveColors(style)\n return cn(\n {\n 'font-bold': style.bold,\n 'opacity-70': style.dim,\n italic: style.italic,\n underline: style.underline && !style.strike,\n 'line-through': style.strike && !style.underline,\n '[text-decoration-line:underline_line-through]': style.underline && style.strike,\n 'text-(color:--terminal-background)': fg === 'default-bg',\n 'bg-(--terminal-foreground)': bg === 'default-fg',\n },\n typeof fg === 'number' && FG_CLASS[fg],\n typeof bg === 'number' && BG_CLASS[bg]\n )\n}\n\nfunction LineView(props: { line: AnsiLine; wrap: boolean }) {\n return (\n // `min-h-lh` keeps an empty line one line tall; a block with no text would\n // collapse and the transcript would lose its blank lines.\n <div\n class={cn('min-h-lh', {\n 'whitespace-pre-wrap [overflow-wrap:anywhere]': props.wrap,\n 'w-max min-w-full': !props.wrap,\n })}\n >\n <For each={props.line.segments}>\n {(segment) =>\n isPlainStyle(segment.style) ? (\n segment.text\n ) : (\n <span class={segmentClass(segment.style)}>{segment.text}</span>\n )\n }\n </For>\n <Show when={props.line.truncated > 0}>\n <span class=\"opacity-70 select-none\">\n {' '}\n … {props.line.truncated.toLocaleString()} more characters not shown\n </span>\n </Show>\n </div>\n )\n}\n\nfunction sameAnsiLine(left: AnsiLine, right: AnsiLine): boolean {\n return (\n left.truncated === right.truncated &&\n left.segments.length === right.segments.length &&\n left.segments.every(\n (segment, index) =>\n segment.text === right.segments[index]?.text &&\n segment.style === right.segments[index]?.style\n )\n )\n}\n\nfunction StatusReadout(props: { status: TerminalStatus }) {\n return (\n // A live region, so a command that finishes while the reader is elsewhere is\n // announced once, in words.\n <span\n role=\"status\"\n data-slot=\"terminal-status\"\n data-state={props.status.state}\n class={cn('flex shrink-0 items-center gap-1 text-xs', {\n 'text-destructive': isFailedExit(props.status),\n 'text-info': props.status.state === 'running',\n 'text-muted-foreground': props.status.state !== 'running' && !isFailedExit(props.status),\n })}\n >\n {/* A zero exit gets no glyph: a tick would be this component deciding the\n command succeeded, and some tools exit non-zero on purpose or zero on\n failure. The words carry the fact; only a non-zero code is toned. */}\n <Show when={props.status.state !== 'exited' || isFailedExit(props.status)}>\n <span aria-hidden=\"true\" class=\"grid size-3.5 place-items-center [&_svg]:size-3.5\">\n <Show\n when={props.status.state === 'running'}\n fallback={\n <Show when={props.status.state === 'cancelled'} fallback={<CircleAlert />}>\n <CircleSlash />\n </Show>\n }\n >\n <LoaderCircle class=\"motion-safe:animate-spin\" />\n </Show>\n </span>\n </Show>\n {terminalStatusLabel(props.status)}\n </span>\n )\n}\n\nexport function Terminal(props: TerminalProps) {\n const [local, rest] = splitProps(props, [\n 'output',\n 'command',\n 'status',\n 'maxLines',\n 'retainLines',\n 'maxHeight',\n 'wrap',\n 'size',\n 'onClear',\n 'copyLabel',\n 'copiedLabel',\n 'clearLabel',\n 'onCopy',\n 'class',\n ])\n\n const small = () => local.size === 'sm'\n const pageSize = () => Math.max(1, Math.floor(local.maxLines ?? TERMINAL_MAX_LINES))\n const maxHeight = () =>\n typeof local.maxHeight === 'number' ? `${local.maxHeight}px` : (local.maxHeight ?? '20rem')\n\n // The parser outlives renders: it holds the half-read escape sequence, the\n // current style and the open line. A new `output` that extends the old one is\n // fed only its tail; anything else (a clear, a different command) starts over.\n const newParser = () => createAnsiParser({ retainLines: local.retainLines })\n let parser = newParser()\n let consumed = ''\n // Bumped when the output restarts, so a parked position from the old output\n // is never applied to the new one.\n let epoch = 0\n const revision = createMemo(\n () => {\n const next = local.output\n if (next.length >= consumed.length && next.startsWith(consumed)) {\n parser.write(next.slice(consumed.length))\n } else {\n parser = newParser()\n parser.write(next)\n epoch += 1\n }\n consumed = next\n return epoch\n },\n undefined,\n { equals: false }\n )\n\n const [limit, setLimit] = createSignal(pageSize())\n createEffect(on(pageSize, (size) => setLimit(size), { defer: true }))\n // A cleared terminal is a fresh one: the next command starts at the page size.\n createEffect(\n on(\n () => local.output === '',\n (empty) => {\n if (empty) setLimit(pageSize())\n },\n { defer: true }\n )\n )\n\n const outputRows = createMemo(\n () => {\n revision()\n const rows = parser.lines.slice()\n const open = parser.openLine()\n if (open) rows.push(open)\n return rows\n },\n [],\n { equals: false }\n )\n // Where the reader parked, as a count of lines since the output began. An open\n // line is a row too: freeze its snapshot so streamed characters and CR redraws\n // do not rewrite the text under a parked reader.\n const [parked, setParked] = createSignal<{ epoch: number; end: number; open?: AnsiLine }>()\n const total = () => parser.droppedLines + outputRows().length\n const anchorEnd = () => {\n const current = revision()\n const position = parked()\n return position && position.epoch === current ? position.end : undefined\n }\n const lineWindow = createMemo(() => {\n revision()\n return terminalWindow(outputRows().length, parser.droppedLines, limit(), anchorEnd())\n })\n // Finished rows keep their parser identity. If an open row existed when the\n // reader parked, substitute its immutable snapshot until they jump to latest.\n const visibleRows = createMemo(\n () => {\n revision()\n const start = lineWindow().start\n const end = lineWindow().end\n const rows = outputRows().slice(start, end)\n const position = parked()\n if (position?.epoch === revision() && position.open) {\n const retainedIndex = position.end - 1 - parser.droppedLines\n if (retainedIndex >= start && retainedIndex < end) {\n rows[retainedIndex - start] = position.open\n }\n }\n return rows\n },\n [],\n { equals: false }\n )\n const changedParkedLine = () => {\n const position = parked()\n if (position?.epoch !== revision() || !position.open) return false\n const retainedIndex = position.end - 1 - parser.droppedLines\n const current = outputRows()[retainedIndex]\n return current !== undefined && !sameAnsiLine(position.open, current)\n }\n const newerRows = () => lineWindow().later + (changedParkedLine() ? 1 : 0)\n\n let scroller: HTMLDivElement | undefined\n const following = () => anchorEnd() === undefined\n\n const onScroll = () => {\n if (!scroller) return\n const atEnd = isAtBottom(scroller.scrollHeight, scroller.scrollTop, scroller.clientHeight)\n const position = anchorEnd()\n if (!atEnd) {\n if (position === undefined) {\n const currentEpoch = revision()\n setParked({ epoch: currentEpoch, end: total(), open: parser.openLine() })\n }\n } else if (position !== undefined && position >= total() && !changedParkedLine()) {\n // Back at the end of a view with nothing newer: nothing was missed.\n setParked(undefined)\n }\n }\n createEffect(\n on(revision, () => {\n if (scroller && following()) scroller.scrollTop = scroller.scrollHeight\n })\n )\n const jumpToLatest = () => {\n if (!scroller) return\n setParked(undefined)\n scroller.scrollTop = scroller.scrollHeight\n // The button is about to disappear; leave focus somewhere real.\n scroller.focus()\n }\n\n const [copied, setCopied] = createSignal(false)\n const [copyFailed, setCopyFailed] = createSignal(false)\n const copy = async () => {\n let ok = true\n try {\n await writeClipboardText(local.output)\n } catch {\n ok = false\n }\n setCopied(ok)\n setCopyFailed(!ok)\n local.onCopy?.(ok)\n if (ok) setTimeout(() => setCopied(false), 1500)\n }\n\n const empty = () => local.output === ''\n const regionLabel = () =>\n local.command ? `Output of ${local.command.slice(0, 120)}` : 'Terminal output'\n\n return (\n <div\n data-slot=\"terminal\"\n data-size={local.size ?? 'default'}\n aria-busy={local.status?.state === 'running' || undefined}\n class={cn(\n 'group/terminal overflow-hidden border border-border bg-card',\n small() ? 'rounded-lg' : 'rounded-xl',\n local.class\n )}\n {...rest}\n >\n <div class={cn('flex items-center gap-2', small() ? 'px-2 py-0.5' : 'px-3 py-1')}>\n <Show\n when={local.command !== undefined}\n fallback={<span class=\"flex-1 text-xs text-muted-foreground\">Terminal</span>}\n >\n <span class=\"flex min-w-0 flex-1 items-baseline gap-2\">\n <span\n aria-hidden=\"true\"\n class=\"shrink-0 font-code text-code text-muted-foreground select-none\"\n >\n $\n </span>\n <code\n title={local.command}\n class=\"line-clamp-2 min-w-0 font-code text-code text-foreground [overflow-wrap:anywhere]\"\n >\n {local.command}\n </code>\n </span>\n </Show>\n <Show when={local.status}>{(status) => <StatusReadout status={status()} />}</Show>\n {/* Hidden until the terminal is hovered or holds focus, never removed:\n a control that only exists under the pointer is unreachable by\n keyboard, and a touch screen has no hover, so it always shows there. */}\n <div class=\"flex items-center gap-1 opacity-0 transition-opacity group-focus-within/terminal:opacity-100 group-hover/terminal:opacity-100 [@media(hover:none)]:opacity-100\">\n <Show when={local.onClear !== undefined && !empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={local.clearLabel ?? 'Clear output'}\n onClick={() => local.onClear?.()}\n >\n <Eraser aria-hidden=\"true\" />\n </Button>\n </Show>\n <Show when={!empty()}>\n <Button\n variant=\"ghost\"\n size=\"icon-2xs\"\n aria-label={\n copied() ? (local.copiedLabel ?? 'Copied') : (local.copyLabel ?? 'Copy output')\n }\n title={copyFailed() ? 'Copying is unavailable in this context' : undefined}\n onClick={() => void copy()}\n >\n <Show when={copied()} fallback={<Copy aria-hidden=\"true\" />}>\n <Check aria-hidden=\"true\" />\n </Show>\n </Button>\n </Show>\n </div>\n </div>\n\n <Show when={lineWindow().hidden > 0 || lineWindow().evicted > 0}>\n <div\n data-slot=\"terminal-hidden-note\"\n class=\"flex items-center gap-2 border-t border-border px-3 py-1 text-xs text-muted-foreground\"\n >\n <span>\n <Show when={lineWindow().hidden > 0}>\n {lineWindow().hidden.toLocaleString()} earlier{' '}\n {lineWindow().hidden === 1 ? 'line' : 'lines'} hidden\n <Show when={parser.droppedLines > 0}>\n {' '}\n ({parser.droppedLines.toLocaleString()} only in the copy)\n </Show>\n .\n </Show>\n <Show when={lineWindow().evicted > 0}>\n {' '}\n {lineWindow().lost\n ? `The lines you were reading were discarded to keep memory bounded; showing the oldest ${lineWindow().end.toLocaleString()} still kept.`\n : `${lineWindow().evicted.toLocaleString()} of the lines you were reading were discarded to keep memory bounded.`}\n </Show>\n </span>\n <Show when={lineWindow().revealable > 0}>\n <Button\n variant=\"ghost\"\n size=\"2xs\"\n onClick={() => setLimit(revealEarlier(limit(), pageSize(), outputRows().length))}\n >\n Show {Math.min(pageSize(), lineWindow().revealable).toLocaleString()} earlier\n </Button>\n </Show>\n </div>\n </Show>\n\n <div class=\"relative\">\n <div\n ref={(element) => (scroller = element)}\n data-slot=\"terminal-body\"\n // A region that scrolls must be focusable, and a tab stop needs a name.\n role=\"region\"\n tabindex=\"0\"\n aria-label={regionLabel()}\n onScroll={onScroll}\n style={{ 'max-height': maxHeight() }}\n class=\"scroll-fade overflow-auto border-t border-border bg-(--terminal-background) text-(color:--terminal-foreground)\"\n >\n <Show\n when={!empty()}\n fallback={\n <p class={cn('m-0 opacity-70', small() ? 'px-2 py-1.5' : 'px-3 py-2')}>\n <span class=\"font-code text-code\">\n {local.status?.state === 'running' ? 'Waiting for output…' : 'No output'}\n </span>\n </p>\n }\n >\n <pre\n class={cn(\n 'm-0 font-code text-code leading-normal',\n small() ? 'px-2 py-1.5' : 'px-3 py-2'\n )}\n >\n <For each={visibleRows()}>\n {(line) => <LineView line={line} wrap={local.wrap === true} />}\n </For>\n </pre>\n </Show>\n </div>\n <Show when={newerRows() > 0}>\n <Button\n variant=\"secondary\"\n size=\"2xs\"\n class=\"absolute end-3 bottom-2 shadow-sm\"\n onClick={jumpToLatest}\n >\n <ArrowDown aria-hidden=\"true\" />\n Jump to latest\n <span class=\"text-muted-foreground tabular-nums\">\n ({newerRows().toLocaleString()} newer {newerRows() === 1 ? 'line' : 'lines'})\n </span>\n </Button>\n </Show>\n </div>\n </div>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AA0HA,IAAa6C,qBAAqB;AAIlC,IAAMC,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAA2C;AAE7C,IAAME,WAAW;CACf;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AAAmC;AAGrC,SAASC,aAAaC,OAA0B;CAC9C,MAAM,EAAEC,IAAIC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A,OAAA8D;CAAA,EAAA,CAAA;AA0C5C"}
@@ -0,0 +1,2 @@
1
+ export { WorkspaceSwitcher, type WorkspaceSwitcherItem, type WorkspaceSwitcherProps, } from './workspace-switcher';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,GAC5B,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { WorkspaceSwitcher } from "./workspace-switcher.js";
2
+ export { WorkspaceSwitcher };
@@ -0,0 +1,44 @@
1
+ import type { JSX } from 'solid-js';
2
+ /**
3
+ * WorkspaceSwitcher.
4
+ *
5
+ * The workspace picker that sits in the top bar beside the sidebar toggle. One
6
+ * ghost button shows the current workspace's mark and name; pressing it opens a
7
+ * radio list of the others. Choosing one only changes what the window is
8
+ * looking at: the switcher reports the id and the host decides what that means,
9
+ * which is why it carries no status of its own and never closes, restarts or
10
+ * moves anything.
11
+ *
12
+ * It is deliberately the simple interaction (a single menu, not a nested
13
+ * accordion): the sidebar below it already shows what is inside the chosen
14
+ * workspace, so the switcher's only job is to name the workspace and let the
15
+ * user change it.
16
+ */
17
+ export type WorkspaceSwitcherItem = {
18
+ id: string;
19
+ name: string;
20
+ /** The workspace's mark, drawn in the trigger and its row. Decorative. */
21
+ mark: JSX.Element;
22
+ /** A quiet trailing readout in the row, e.g. an unread count. Optional. */
23
+ detail?: JSX.Element;
24
+ };
25
+ export type WorkspaceSwitcherProps = {
26
+ workspaces: readonly WorkspaceSwitcherItem[];
27
+ /** The current workspace's id. */
28
+ value: string | undefined;
29
+ onValueChange(id: string): void;
30
+ /** Offered at the foot of the menu when present. */
31
+ onCreate?(): void;
32
+ createLabel?: string;
33
+ /** Offered beside the create action when present: open the current workspace's settings. */
34
+ onManage?(): void;
35
+ manageLabel?: string;
36
+ /** The menu's heading; also the trigger's accessible-name prefix. */
37
+ label?: string;
38
+ /** Shown while no workspace is current. */
39
+ placeholder?: string;
40
+ disabled?: boolean;
41
+ class?: string;
42
+ };
43
+ export declare function WorkspaceSwitcher(props: WorkspaceSwitcherProps): JSX.Element;
44
+ //# sourceMappingURL=workspace-switcher.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-switcher.d.ts","sourceRoot":"","sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAgBnC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,0EAA0E;IAC1E,IAAI,EAAE,GAAG,CAAC,OAAO,CAAA;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,SAAS,qBAAqB,EAAE,CAAA;IAC5C,kCAAkC;IAClC,KAAK,EAAE,MAAM,GAAG,SAAS,CAAA;IACzB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,CAAA;IAC/B,oDAAoD;IACpD,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,IAAI,CAAA;IACjB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,2CAA2C;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,eAmE9D"}
@@ -0,0 +1,157 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuTrigger } from "../../ui/dropdown-menu/dropdown-menu.js";
3
+ import { ActionButton } from "../action-button/action-button.js";
4
+ import { createComponent, insert, memo, template } from "solid-js/web";
5
+ import { ChevronDown, Plus, Settings } from "lucide-solid";
6
+ import { For, Show, createSignal } from "solid-js";
7
+ //#region src/components/composites/workspace-switcher/workspace-switcher.tsx
8
+ var _tmpl$ = /*#__PURE__*/ template(`<span aria-hidden=true class="flex shrink-0">`);
9
+ var _tmpl$2 = /*#__PURE__*/ template(`<span class="min-w-0 max-w-40 truncate">`);
10
+ var _tmpl$3 = /*#__PURE__*/ template(`<span class="min-w-0 flex-1 truncate">`);
11
+ function WorkspaceSwitcher(props) {
12
+ const [open, setOpen] = createSignal(false);
13
+ const current = () => props.workspaces.find((item) => item.id === props.value);
14
+ const label = () => props.label ?? "Workspaces";
15
+ return createComponent(DropdownMenu, {
16
+ modal: false,
17
+ get open() {
18
+ return open();
19
+ },
20
+ onOpenChange: setOpen,
21
+ get children() {
22
+ return [createComponent(DropdownMenuTrigger, {
23
+ as: ActionButton,
24
+ variant: "ghost",
25
+ size: "sm",
26
+ get disabled() {
27
+ return props.disabled;
28
+ },
29
+ "data-slot": "workspace-switcher",
30
+ get tooltip() {
31
+ return `Workspace: ${current()?.name ?? props.placeholder ?? "Choose workspace"}`;
32
+ },
33
+ get ["aria-label"]() {
34
+ return `Switch workspace, current: ${current()?.name ?? "none"}`;
35
+ },
36
+ get ["class"]() {
37
+ return cn("max-w-full min-w-0 shrink", props.class);
38
+ },
39
+ get children() {
40
+ return [
41
+ (() => {
42
+ var _el$ = _tmpl$();
43
+ insert(_el$, () => current()?.mark);
44
+ return _el$;
45
+ })(),
46
+ (() => {
47
+ var _el$2 = _tmpl$2();
48
+ insert(_el$2, () => current()?.name ?? props.placeholder ?? "Choose workspace");
49
+ return _el$2;
50
+ })(),
51
+ createComponent(ChevronDown, {
52
+ "aria-hidden": "true",
53
+ "class": "size-3.5 shrink-0 text-muted-foreground"
54
+ })
55
+ ];
56
+ }
57
+ }), createComponent(DropdownMenuContent, {
58
+ align: "start",
59
+ sideOffset: 6,
60
+ "class": "min-w-56",
61
+ get children() {
62
+ return [createComponent(DropdownMenuGroup, { get children() {
63
+ return [createComponent(DropdownMenuLabel, { get children() {
64
+ return label();
65
+ } }), createComponent(DropdownMenuRadioGroup, {
66
+ get value() {
67
+ return props.value;
68
+ },
69
+ onChange: (value) => {
70
+ setOpen(false);
71
+ const id = String(value);
72
+ if (id !== props.value) props.onValueChange(id);
73
+ },
74
+ get children() {
75
+ return createComponent(For, {
76
+ get each() {
77
+ return props.workspaces;
78
+ },
79
+ children: (item) => createComponent(DropdownMenuRadioItem, {
80
+ get value() {
81
+ return item.id;
82
+ },
83
+ closeOnSelect: true,
84
+ get ["data-workspace-id"]() {
85
+ return item.id;
86
+ },
87
+ get children() {
88
+ return [
89
+ (() => {
90
+ var _el$3 = _tmpl$();
91
+ insert(_el$3, () => item.mark);
92
+ return _el$3;
93
+ })(),
94
+ (() => {
95
+ var _el$4 = _tmpl$3();
96
+ insert(_el$4, () => item.name);
97
+ return _el$4;
98
+ })(),
99
+ createComponent(Show, {
100
+ get when() {
101
+ return item.detail;
102
+ },
103
+ get children() {
104
+ return item.detail;
105
+ }
106
+ })
107
+ ];
108
+ }
109
+ })
110
+ });
111
+ }
112
+ })];
113
+ } }), createComponent(Show, {
114
+ get when() {
115
+ return props.onCreate || props.onManage;
116
+ },
117
+ get children() {
118
+ return [
119
+ createComponent(DropdownMenuSeparator, {}),
120
+ createComponent(Show, {
121
+ get when() {
122
+ return props.onCreate;
123
+ },
124
+ get children() {
125
+ return createComponent(DropdownMenuItem, {
126
+ onSelect: () => props.onCreate?.(),
127
+ get children() {
128
+ return [createComponent(Plus, { "aria-hidden": "true" }), memo(() => props.createLabel ?? "New workspace")];
129
+ }
130
+ });
131
+ }
132
+ }),
133
+ createComponent(Show, {
134
+ get when() {
135
+ return props.onManage;
136
+ },
137
+ get children() {
138
+ return createComponent(DropdownMenuItem, {
139
+ onSelect: () => props.onManage?.(),
140
+ get children() {
141
+ return [createComponent(Settings, { "aria-hidden": "true" }), memo(() => props.manageLabel ?? "Workspace settings…")];
142
+ }
143
+ });
144
+ }
145
+ })
146
+ ];
147
+ }
148
+ })];
149
+ }
150
+ })];
151
+ }
152
+ });
153
+ }
154
+ //#endregion
155
+ export { WorkspaceSwitcher };
156
+
157
+ //# sourceMappingURL=workspace-switcher.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace-switcher.js","names":["ChevronDown","Plus","Settings","JSX","For","Show","createSignal","cn","DropdownMenu","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","DropdownMenuLabel","DropdownMenuRadioGroup","DropdownMenuRadioItem","DropdownMenuSeparator","DropdownMenuTrigger","ActionButton","WorkspaceSwitcherItem","id","name","mark","Element","detail","WorkspaceSwitcherProps","workspaces","value","onValueChange","onCreate","createLabel","onManage","manageLabel","label","placeholder","disabled","class","WorkspaceSwitcher","props","open","setOpen","current","find","item","_$createComponent","modal","onOpenChange","children","as","variant","size","tooltip","aria-label","_el$","_tmpl$","_$insert","_el$2","_tmpl$2","align","sideOffset","onChange","String","each","closeOnSelect","data-workspace-id","_el$3","_el$4","_tmpl$3","when","onSelect","_$memo","_$createComponent","_$memo"],"sources":["../../../../src/components/composites/workspace-switcher/workspace-switcher.tsx"],"sourcesContent":["import { ChevronDown, Plus, Settings } from 'lucide-solid'\nimport type { JSX } from 'solid-js'\nimport { For, Show, createSignal } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuRadioGroup,\n DropdownMenuRadioItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from '../../ui/dropdown-menu'\nimport { ActionButton } from '../action-button'\n\n/**\n * WorkspaceSwitcher.\n *\n * The workspace picker that sits in the top bar beside the sidebar toggle. One\n * ghost button shows the current workspace's mark and name; pressing it opens a\n * radio list of the others. Choosing one only changes what the window is\n * looking at: the switcher reports the id and the host decides what that means,\n * which is why it carries no status of its own and never closes, restarts or\n * moves anything.\n *\n * It is deliberately the simple interaction (a single menu, not a nested\n * accordion): the sidebar below it already shows what is inside the chosen\n * workspace, so the switcher's only job is to name the workspace and let the\n * user change it.\n */\nexport type WorkspaceSwitcherItem = {\n id: string\n name: string\n /** The workspace's mark, drawn in the trigger and its row. Decorative. */\n mark: JSX.Element\n /** A quiet trailing readout in the row, e.g. an unread count. Optional. */\n detail?: JSX.Element\n}\n\nexport type WorkspaceSwitcherProps = {\n workspaces: readonly WorkspaceSwitcherItem[]\n /** The current workspace's id. */\n value: string | undefined\n onValueChange(id: string): void\n /** Offered at the foot of the menu when present. */\n onCreate?(): void\n createLabel?: string\n /** Offered beside the create action when present: open the current workspace's settings. */\n onManage?(): void\n manageLabel?: string\n /** The menu's heading; also the trigger's accessible-name prefix. */\n label?: string\n /** Shown while no workspace is current. */\n placeholder?: string\n disabled?: boolean\n class?: string\n}\n\nexport function WorkspaceSwitcher(props: WorkspaceSwitcherProps) {\n const [open, setOpen] = createSignal(false)\n const current = () => props.workspaces.find((item) => item.id === props.value)\n const label = () => props.label ?? 'Workspaces'\n\n return (\n <DropdownMenu modal={false} open={open()} onOpenChange={setOpen}>\n <DropdownMenuTrigger\n as={ActionButton}\n variant=\"ghost\"\n size=\"sm\"\n disabled={props.disabled}\n data-slot=\"workspace-switcher\"\n tooltip={`Workspace: ${current()?.name ?? props.placeholder ?? 'Choose workspace'}`}\n aria-label={`Switch workspace, current: ${current()?.name ?? 'none'}`}\n class={cn('max-w-full min-w-0 shrink', props.class)}\n >\n <span aria-hidden=\"true\" class=\"flex shrink-0\">\n {current()?.mark}\n </span>\n <span class=\"min-w-0 max-w-40 truncate\">\n {current()?.name ?? props.placeholder ?? 'Choose workspace'}\n </span>\n <ChevronDown aria-hidden=\"true\" class=\"size-3.5 shrink-0 text-muted-foreground\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent align=\"start\" sideOffset={6} class=\"min-w-56\">\n <DropdownMenuGroup>\n <DropdownMenuLabel>{label()}</DropdownMenuLabel>\n <DropdownMenuRadioGroup\n value={props.value}\n onChange={(value) => {\n setOpen(false)\n const id = String(value)\n if (id !== props.value) props.onValueChange(id)\n }}\n >\n <For each={props.workspaces}>\n {(item) => (\n <DropdownMenuRadioItem value={item.id} closeOnSelect data-workspace-id={item.id}>\n <span aria-hidden=\"true\" class=\"flex shrink-0\">\n {item.mark}\n </span>\n <span class=\"min-w-0 flex-1 truncate\">{item.name}</span>\n <Show when={item.detail}>{item.detail}</Show>\n </DropdownMenuRadioItem>\n )}\n </For>\n </DropdownMenuRadioGroup>\n </DropdownMenuGroup>\n <Show when={props.onCreate || props.onManage}>\n <DropdownMenuSeparator />\n <Show when={props.onCreate}>\n <DropdownMenuItem onSelect={() => props.onCreate?.()}>\n <Plus aria-hidden=\"true\" />\n {props.createLabel ?? 'New workspace'}\n </DropdownMenuItem>\n </Show>\n <Show when={props.onManage}>\n <DropdownMenuItem onSelect={() => props.onManage?.()}>\n <Settings aria-hidden=\"true\" />\n {props.manageLabel ?? 'Workspace settings…'}\n </DropdownMenuItem>\n </Show>\n </Show>\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n"],"mappings":";;;;;;;;;;AA4DA,SAAgBoC,kBAAkBC,OAA+B;CAC/D,MAAM,CAACC,MAAMC,WAAWjC,aAAa,KAAK;CAC1C,MAAMkC,gBAAgBH,MAAMZ,WAAWgB,MAAMC,SAASA,KAAKvB,OAAOkB,MAAMX,KAAK;CAC7E,MAAMM,cAAcK,MAAML,SAAS;CAEnC,OAAAW,gBACGnC,cAAY;EAACoC,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c,gBAGxCtC,MAAI;SAAA,IAAC8D,OAAI;UAAA,OAAE9B,MAAMP;SAAQ;SAAA,IAAAgB,WAAA;UAAA,OAAAH,gBACvBhC,kBAAgB;WAACyD,gBAAgB/B,MAAMP,WAAW;WAAC,IAAAgB,WAAA;YAAA,OAAA,CAAAH,gBACjDzC,UAAQ,EAAA,eAAA,OAAA,CAAA,GAAAmE,WACRhC,MAAMN,eAAe,qBAAqB,CAAA;WAAA;UAAA,CAAA;SAAA;QAAA,CAAA;OAAA;MAAA;KAAA,CAAA,CAAA;IAAA;GAAA,CAAA,CAAA;EAAA;CAAA,CAAA;AAOzD"}
@@ -0,0 +1,2 @@
1
+ export { ShellRail, type ShellRailProps } from './shell-rail';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/shell-rail/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,cAAc,CAAA"}
@@ -0,0 +1,2 @@
1
+ import { ShellRail } from "./shell-rail.js";
2
+ export { ShellRail };
@@ -0,0 +1,36 @@
1
+ import type { ComponentProps, JSX } from 'solid-js';
2
+ /**
3
+ * ShellRail.
4
+ *
5
+ * The side rail both applications put at the window's leading edge: always the
6
+ * collapsed icon column, with the app's mark at the top, a search entry point
7
+ * under it, the app's destinations in the middle and a footer for account and
8
+ * settings.
9
+ *
10
+ * The rail is never the thing the sidebar toggle collapses. The toggle belongs
11
+ * to the sidebar beside the rail, which is why this component takes no
12
+ * `collapsed` prop: a rail that could be expanded would be a second sidebar,
13
+ * and the two apps would drift on which of them the toggle meant.
14
+ *
15
+ * Destinations are the caller's: pass `SideRailItem`s (or a `SideRailSection`)
16
+ * as children. The mark, the search row and the footer are slots with the
17
+ * geometry decided here, so the rail's rhythm cannot differ between apps.
18
+ */
19
+ export type ShellRailProps = Omit<ComponentProps<'nav'>, 'children'> & {
20
+ /** The app's mark. Decorative: the rail names itself through `aria-label`. */
21
+ mark: JSX.Element;
22
+ /** Opens search. Omit to leave the search row out. */
23
+ onSearch?: () => void;
24
+ /** The search row's accessible name. */
25
+ searchLabel?: string;
26
+ /** The chord as it is announced, e.g. `Meta+K Control+K`. */
27
+ searchKeyshortcuts?: string;
28
+ /** The cap labels drawn under the icon, in press order, e.g. `['⌘', 'K']`. */
29
+ searchKeys?: readonly string[];
30
+ /** Destinations between the search row and the footer. */
31
+ children?: JSX.Element;
32
+ /** Account, plugins, settings. Pinned to the rail's foot. */
33
+ footer?: JSX.Element;
34
+ };
35
+ export declare function ShellRail(props: ShellRailProps): JSX.Element;
36
+ //# sourceMappingURL=shell-rail.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-rail.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/shell-rail/shell-rail.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAanD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC,GAAG;IACrE,8EAA8E;IAC9E,IAAI,EAAE,GAAG,CAAC,OAAO,CAAA;IACjB,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAA;IACrB,wCAAwC;IACxC,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,6DAA6D;IAC7D,kBAAkB,CAAC,EAAE,MAAM,CAAA;IAC3B,8EAA8E;IAC9E,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IAC9B,0DAA0D;IAC1D,QAAQ,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;IACtB,6DAA6D;IAC7D,MAAM,CAAC,EAAE,GAAG,CAAC,OAAO,CAAA;CACrB,CAAA;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,eAuE9C"}
@@ -0,0 +1,124 @@
1
+ import { cn } from "../../../lib/utils.js";
2
+ import { Separator } from "../../ui/separator/separator.js";
3
+ import { Kbd, KbdGroup } from "../../ui/kbd/kbd.js";
4
+ import { SideRail, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem } from "../side-rail/side-rail.js";
5
+ import { createComponent, insert, memo, mergeProps, template } from "solid-js/web";
6
+ import { Search } from "lucide-solid";
7
+ import { For, Show, children, splitProps } from "solid-js";
8
+ //#region src/components/layout/shell-rail/shell-rail.tsx
9
+ var _tmpl$ = /*#__PURE__*/ template(`<span data-slot=shell-rail-mark aria-hidden=true class="flex h-rail-item items-center justify-center">`);
10
+ var _tmpl$2 = /*#__PURE__*/ template(`<div data-slot=shell-rail-search class="flex min-w-0 flex-col gap-0.5">`);
11
+ function ShellRail(props) {
12
+ const [local, rest] = splitProps(props, [
13
+ "class",
14
+ "mark",
15
+ "onSearch",
16
+ "searchLabel",
17
+ "searchKeyshortcuts",
18
+ "searchKeys",
19
+ "children",
20
+ "footer",
21
+ "aria-label"
22
+ ]);
23
+ const footer = children(() => local.footer);
24
+ const content = children(() => local.children);
25
+ return createComponent(SideRail, mergeProps({
26
+ collapsed: true,
27
+ "data-slot": "shell-rail",
28
+ get ["aria-label"]() {
29
+ return local["aria-label"] ?? "Global navigation";
30
+ },
31
+ get ["class"]() {
32
+ return cn("relative z-(--z-sticky) min-w-0", local.class);
33
+ }
34
+ }, rest, { get children() {
35
+ return [
36
+ createComponent(SideRailHeader, {
37
+ "data-slot": "shell-rail-header",
38
+ "class": "h-auto justify-center px-0 pt-1",
39
+ get children() {
40
+ var _el$ = _tmpl$();
41
+ insert(_el$, () => local.mark);
42
+ return _el$;
43
+ }
44
+ }),
45
+ createComponent(SideRailContent, {
46
+ "data-slot": "shell-rail-content",
47
+ "class": "pt-0.5",
48
+ get children() {
49
+ return [createComponent(Show, {
50
+ get when() {
51
+ return local.onSearch;
52
+ },
53
+ get children() {
54
+ return [(() => {
55
+ var _el$2 = _tmpl$2();
56
+ insert(_el$2, createComponent(SideRailItem, {
57
+ as: "button",
58
+ type: "button",
59
+ get label() {
60
+ return local.searchLabel ?? "Search";
61
+ },
62
+ get ["aria-label"]() {
63
+ return local.searchLabel ?? "Search";
64
+ },
65
+ get keyshortcuts() {
66
+ return local.searchKeyshortcuts;
67
+ },
68
+ get shortcut() {
69
+ return local.searchKeys?.join("");
70
+ },
71
+ onClick: () => local.onSearch?.(),
72
+ get children() {
73
+ return createComponent(Search, { "aria-hidden": "true" });
74
+ }
75
+ }), null);
76
+ insert(_el$2, createComponent(Show, {
77
+ get when() {
78
+ return local.searchKeys?.length;
79
+ },
80
+ get children() {
81
+ return createComponent(KbdGroup, {
82
+ size: "compact",
83
+ "class": "justify-center pb-1",
84
+ "data-slot": "shell-rail-search-keys",
85
+ get children() {
86
+ return createComponent(For, {
87
+ get each() {
88
+ return local.searchKeys;
89
+ },
90
+ children: (key) => createComponent(Kbd, {
91
+ size: "compact",
92
+ children: key
93
+ })
94
+ });
95
+ }
96
+ });
97
+ }
98
+ }), null);
99
+ return _el$2;
100
+ })(), createComponent(Separator, { "class": "my-1" })];
101
+ }
102
+ }), memo(() => content())];
103
+ }
104
+ }),
105
+ createComponent(Show, {
106
+ get when() {
107
+ return footer();
108
+ },
109
+ get children() {
110
+ return createComponent(SideRailFooter, {
111
+ "data-slot": "shell-rail-footer",
112
+ get children() {
113
+ return footer();
114
+ }
115
+ });
116
+ }
117
+ })
118
+ ];
119
+ } }));
120
+ }
121
+ //#endregion
122
+ export { ShellRail };
123
+
124
+ //# sourceMappingURL=shell-rail.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shell-rail.js","names":["Search","ComponentProps","JSX","children","For","Show","splitProps","cn","Kbd","KbdGroup","Separator","SideRail","SideRailContent","SideRailFooter","SideRailHeader","SideRailItem","ShellRailProps","Omit","mark","Element","onSearch","searchLabel","searchKeyshortcuts","searchKeys","footer","ShellRail","props","local","rest","content","_$createComponent","_$mergeProps","collapsed","aria-label","class","_el$","_tmpl$","_$insert","when","_el$2","_tmpl$2","as","type","label","keyshortcuts","shortcut","join","onClick","length","size","each","key","_$memo","_$createComponent","_$mergeProps","_$memo"],"sources":["../../../../src/components/layout/shell-rail/shell-rail.tsx"],"sourcesContent":["import { Search } from 'lucide-solid'\nimport type { ComponentProps, JSX } from 'solid-js'\nimport { children, For, Show, splitProps } from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { Kbd, KbdGroup } from '../../ui/kbd'\nimport { Separator } from '../../ui/separator'\nimport {\n SideRail,\n SideRailContent,\n SideRailFooter,\n SideRailHeader,\n SideRailItem,\n} from '../side-rail'\n\n/**\n * ShellRail.\n *\n * The side rail both applications put at the window's leading edge: always the\n * collapsed icon column, with the app's mark at the top, a search entry point\n * under it, the app's destinations in the middle and a footer for account and\n * settings.\n *\n * The rail is never the thing the sidebar toggle collapses. The toggle belongs\n * to the sidebar beside the rail, which is why this component takes no\n * `collapsed` prop: a rail that could be expanded would be a second sidebar,\n * and the two apps would drift on which of them the toggle meant.\n *\n * Destinations are the caller's: pass `SideRailItem`s (or a `SideRailSection`)\n * as children. The mark, the search row and the footer are slots with the\n * geometry decided here, so the rail's rhythm cannot differ between apps.\n */\nexport type ShellRailProps = Omit<ComponentProps<'nav'>, 'children'> & {\n /** The app's mark. Decorative: the rail names itself through `aria-label`. */\n mark: JSX.Element\n /** Opens search. Omit to leave the search row out. */\n onSearch?: () => void\n /** The search row's accessible name. */\n searchLabel?: string\n /** The chord as it is announced, e.g. `Meta+K Control+K`. */\n searchKeyshortcuts?: string\n /** The cap labels drawn under the icon, in press order, e.g. `['⌘', 'K']`. */\n searchKeys?: readonly string[]\n /** Destinations between the search row and the footer. */\n children?: JSX.Element\n /** Account, plugins, settings. Pinned to the rail's foot. */\n footer?: JSX.Element\n}\n\nexport function ShellRail(props: ShellRailProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'mark',\n 'onSearch',\n 'searchLabel',\n 'searchKeyshortcuts',\n 'searchKeys',\n 'children',\n 'footer',\n 'aria-label',\n ])\n\n // Resolve the footer once: reading a JSX prop twice builds two copies.\n const footer = children(() => local.footer)\n const content = children(() => local.children)\n\n return (\n <SideRail\n collapsed\n data-slot=\"shell-rail\"\n aria-label={local['aria-label'] ?? 'Global navigation'}\n class={cn('relative z-(--z-sticky) min-w-0', local.class)}\n {...rest}\n >\n <SideRailHeader data-slot=\"shell-rail-header\" class=\"h-auto justify-center px-0 pt-1\">\n <span\n data-slot=\"shell-rail-mark\"\n aria-hidden=\"true\"\n class=\"flex h-rail-item items-center justify-center\"\n >\n {local.mark}\n </span>\n </SideRailHeader>\n\n <SideRailContent data-slot=\"shell-rail-content\" class=\"pt-0.5\">\n <Show when={local.onSearch}>\n <div data-slot=\"shell-rail-search\" class=\"flex min-w-0 flex-col gap-0.5\">\n <SideRailItem\n as=\"button\"\n type=\"button\"\n label={local.searchLabel ?? 'Search'}\n aria-label={local.searchLabel ?? 'Search'}\n keyshortcuts={local.searchKeyshortcuts}\n shortcut={local.searchKeys?.join('')}\n onClick={() => local.onSearch?.()}\n >\n <Search aria-hidden=\"true\" />\n </SideRailItem>\n {/* The chord is drawn as key caps under the icon: the one row that\n advertises a shortcut. The accessible chord stays on the row. */}\n <Show when={local.searchKeys?.length}>\n <KbdGroup\n size=\"compact\"\n class=\"justify-center pb-1\"\n data-slot=\"shell-rail-search-keys\"\n >\n <For each={local.searchKeys}>{(key) => <Kbd size=\"compact\">{key}</Kbd>}</For>\n </KbdGroup>\n </Show>\n </div>\n <Separator class=\"my-1\" />\n </Show>\n {content()}\n </SideRailContent>\n\n <Show when={footer()}>\n <SideRailFooter data-slot=\"shell-rail-footer\">{footer()}</SideRailFooter>\n </Show>\n </SideRail>\n )\n}\n"],"mappings":";;;;;;;;;;AAgDA,SAAgByB,UAAUC,OAAuB;CAC/C,MAAM,CAACC,OAAOC,QAAQtB,WAAWoB,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CAAY,CACb;CAGD,MAAMF,SAAS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B,gBACjCrB,UAAQ;WACPwC,MAAI;WAAA,SAAA;WAAA,aAAA;WAAA,IAAA9C,WAAA;YAAA,OAAA2B,gBAIH1B,KAAG;aAAA,IAAC8C,OAAI;cAAA,OAAEvB,MAAMJ;aAAU;aAAApB,WAAIgD,QAAGrB,gBAAMtB,KAAG;cAACyC,MAAI;cAAA9C,UAAYgD;aAAG,CAAA;YAAO,CAAA;WAAA;UAAA,CAAA;SAAA;QAAA,CAAA,GAAA,IAAA;QAAA,OAAAZ;OAAA,EAAA,CAAA,GAAAT,gBAI3EpB,WAAS,EAAA,SAAA,OAAA,CAAA,CAAA;MAAA;KAAA,CAAA,GAAA0C,WAEXvB,QAAQ,CAAC,CAAA;IAAA;GAAA,CAAA;GAAAC,gBAGXzB,MAAI;IAAA,IAACiC,OAAI;KAAA,OAAEd,OAAO;IAAC;IAAA,IAAArB,WAAA;KAAA,OAAA2B,gBACjBjB,gBAAc;MAAA,aAAA;MAAA,IAAAV,WAAA;OAAA,OAAgCqB,OAAO;MAAC;KAAA,CAAA;IAAA;GAAA,CAAA;EAAA;CAAA,EAAA,CAAA,CAAA;AAI/D"}
@@ -0,0 +1,2 @@
1
+ export { ShellTopBar, type ShellTopBarProps } from './shell-top-bar';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/layout/shell-top-bar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,KAAK,gBAAgB,EAAE,MAAM,iBAAiB,CAAA"}