@adea-ai/ui 0.155.1 → 0.157.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 (166) hide show
  1. package/README.md +3 -3
  2. package/dist/NOTICE +27 -0
  3. package/dist/components/composites/model-selector/model-selector.js +45 -53
  4. package/dist/components/composites/model-selector/model-selector.js.map +1 -1
  5. package/dist/components/composites/prompt-input/index.d.ts +2 -0
  6. package/dist/components/composites/prompt-input/index.d.ts.map +1 -0
  7. package/dist/components/composites/prompt-input/index.js +1 -0
  8. package/dist/components/composites/prompt-input/prompt-input.d.ts +71 -0
  9. package/dist/components/composites/prompt-input/prompt-input.d.ts.map +1 -0
  10. package/dist/components/composites/prompt-input/prompt-input.js +247 -0
  11. package/dist/components/composites/prompt-input/prompt-input.js.map +1 -0
  12. package/dist/components/conversation/chat-composer.d.ts.map +1 -1
  13. package/dist/components/conversation/chat-composer.js +43 -29
  14. package/dist/components/conversation/chat-composer.js.map +1 -1
  15. package/dist/components/conversation/internal/chat-composer-shell.d.ts.map +1 -1
  16. package/dist/components/conversation/internal/chat-composer-shell.js +155 -163
  17. package/dist/components/conversation/internal/chat-composer-shell.js.map +1 -1
  18. package/dist/components/conversation/message-composer.d.ts.map +1 -1
  19. package/dist/components/conversation/message-composer.js +186 -192
  20. package/dist/components/conversation/message-composer.js.map +1 -1
  21. package/dist/components/conversation/paste-token-editor.js +2 -2
  22. package/dist/components/conversation/paste-token-editor.js.map +1 -1
  23. package/dist/components/theme/theme-document.d.ts +1 -1
  24. package/dist/components/theme/theme-document.js.map +1 -1
  25. package/dist/components/theme/theme-provider-value.d.ts +1 -1
  26. package/dist/components/theme/theme-provider-value.js.map +1 -1
  27. package/dist/components/ui/badge/badge.js +1 -1
  28. package/dist/components/ui/badge/badge.js.map +1 -1
  29. package/dist/components/ui/button/button.d.ts.map +1 -1
  30. package/dist/components/ui/button/button.js +3 -3
  31. package/dist/components/ui/button/button.js.map +1 -1
  32. package/dist/components/ui/input-group/index.d.ts +1 -1
  33. package/dist/components/ui/input-group/index.d.ts.map +1 -1
  34. package/dist/components/ui/input-group/index.js +2 -2
  35. package/dist/components/ui/input-group/input-group.d.ts +34 -9
  36. package/dist/components/ui/input-group/input-group.d.ts.map +1 -1
  37. package/dist/components/ui/input-group/input-group.js +101 -28
  38. package/dist/components/ui/input-group/input-group.js.map +1 -1
  39. package/dist/components/ui/kbd/kbd.d.ts.map +1 -1
  40. package/dist/components/ui/kbd/kbd.js +6 -1
  41. package/dist/components/ui/kbd/kbd.js.map +1 -1
  42. package/dist/components/ui/message/index.d.ts +1 -1
  43. package/dist/components/ui/message/index.d.ts.map +1 -1
  44. package/dist/components/ui/message/index.js +2 -2
  45. package/dist/components/ui/message/message.d.ts +16 -0
  46. package/dist/components/ui/message/message.d.ts.map +1 -1
  47. package/dist/components/ui/message/message.js +52 -1
  48. package/dist/components/ui/message/message.js.map +1 -1
  49. package/dist/components/ui/tooltip/tooltip.js +1 -1
  50. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  51. package/dist/index.d.ts +1 -0
  52. package/dist/index.d.ts.map +1 -1
  53. package/dist/index.js +4 -3
  54. package/dist/lib/fast-icon.d.ts +2 -1
  55. package/dist/lib/fast-icon.d.ts.map +1 -1
  56. package/dist/lib/fast-icon.js +4 -3
  57. package/dist/lib/fast-icon.js.map +1 -1
  58. package/dist/lib/overlay.d.ts +5 -5
  59. package/dist/lib/overlay.d.ts.map +1 -1
  60. package/dist/lib/overlay.js +5 -5
  61. package/dist/lib/overlay.js.map +1 -1
  62. package/dist/lib/theme-defaults.generated.d.ts.map +1 -1
  63. package/dist/lib/theme-defaults.generated.js +88 -60
  64. package/dist/lib/theme-defaults.generated.js.map +1 -1
  65. package/dist/lib/theme-projection.d.ts +2 -0
  66. package/dist/lib/theme-projection.d.ts.map +1 -1
  67. package/dist/lib/theme-projection.js +2 -2
  68. package/dist/lib/theme-projection.js.map +1 -1
  69. package/dist/lib/theme-types.d.ts +7 -0
  70. package/dist/lib/theme-types.d.ts.map +1 -1
  71. package/dist/lib/theme-types.js +7 -0
  72. package/dist/lib/theme-types.js.map +1 -1
  73. package/dist/r/appearance-editor.json +1 -1
  74. package/dist/r/conversation.json +1 -2
  75. package/dist/r/input-group.json +1 -0
  76. package/dist/r/lib.json +1 -1
  77. package/dist/r/message.json +4 -1
  78. package/dist/r/model-selector.json +1 -1
  79. package/dist/r/prompt-input.json +28 -0
  80. package/dist/r/registry.json +38 -7
  81. package/dist/r/src/components/composites/model-selector/model-selector.tsx +19 -25
  82. package/dist/r/src/components/composites/prompt-input/index.ts +15 -0
  83. package/dist/r/src/components/composites/prompt-input/prompt-input.tsx +267 -0
  84. package/dist/r/src/components/conversation/chat-composer.tsx +4 -2
  85. package/dist/r/src/components/conversation/internal/chat-composer-shell.tsx +27 -38
  86. package/dist/r/src/components/conversation/message-composer.tsx +93 -97
  87. package/dist/r/src/components/conversation/paste-token-editor.tsx +2 -2
  88. package/dist/r/src/components/theme/theme-document.ts +1 -1
  89. package/dist/r/src/components/theme/theme-provider-value.ts +1 -1
  90. package/dist/r/src/components/ui/badge/badge.tsx +1 -1
  91. package/dist/r/src/components/ui/button/button.tsx +12 -3
  92. package/dist/r/src/components/ui/input-group/index.ts +3 -0
  93. package/dist/r/src/components/ui/input-group/input-group.tsx +121 -29
  94. package/dist/r/src/components/ui/kbd/kbd.tsx +3 -0
  95. package/dist/r/src/components/ui/message/index.ts +3 -0
  96. package/dist/r/src/components/ui/message/message.tsx +56 -0
  97. package/dist/r/src/components/ui/tooltip/tooltip.tsx +1 -1
  98. package/dist/r/src/lib/fast-icon.ts +11 -4
  99. package/dist/r/src/lib/overlay.ts +5 -6
  100. package/dist/r/src/lib/theme-defaults.generated.ts +88 -60
  101. package/dist/r/src/lib/theme-projection.ts +2 -0
  102. package/dist/r/src/lib/theme-types.ts +7 -0
  103. package/dist/r/src/styles/theme-variants.css +608 -370
  104. package/dist/r/src/styles/theme.css +4 -4
  105. package/dist/r/theming.json +1 -1
  106. package/package.json +2 -2
  107. package/registry.json +38 -7
  108. package/src/components/composites/model-selector/model-selector.tsx +19 -25
  109. package/src/components/composites/prompt-input/index.ts +15 -0
  110. package/src/components/composites/prompt-input/prompt-input.tsx +267 -0
  111. package/src/components/conversation/chat-composer.tsx +4 -2
  112. package/src/components/conversation/internal/chat-composer-shell.tsx +27 -38
  113. package/src/components/conversation/message-composer.tsx +93 -97
  114. package/src/components/conversation/paste-token-editor.tsx +2 -2
  115. package/src/components/theme/theme-document.ts +1 -1
  116. package/src/components/theme/theme-provider-value.ts +1 -1
  117. package/src/components/ui/badge/badge.tsx +1 -1
  118. package/src/components/ui/button/button.tsx +12 -3
  119. package/src/components/ui/input-group/index.ts +3 -0
  120. package/src/components/ui/input-group/input-group.tsx +121 -29
  121. package/src/components/ui/kbd/kbd.tsx +3 -0
  122. package/src/components/ui/message/index.ts +3 -0
  123. package/src/components/ui/message/message.tsx +56 -0
  124. package/src/components/ui/tooltip/tooltip.tsx +1 -1
  125. package/src/index.ts +1 -0
  126. package/src/lib/fast-icon.ts +11 -4
  127. package/src/lib/overlay.ts +5 -6
  128. package/src/lib/theme-defaults.generated.ts +88 -60
  129. package/src/lib/theme-projection.ts +2 -0
  130. package/src/lib/theme-types.ts +7 -0
  131. package/src/styles/theme-variants.css +608 -370
  132. package/src/styles/theme.css +4 -4
  133. package/src/styles/themes/aardvark-blue.css +7 -0
  134. package/src/styles/themes/aardvark-ink.css +7 -0
  135. package/src/styles/themes/adea-dark-colorblind.css +22 -15
  136. package/src/styles/themes/adea-dark-high-contrast.css +22 -15
  137. package/src/styles/themes/adea-dark.css +22 -15
  138. package/src/styles/themes/adea-light-colorblind.css +21 -14
  139. package/src/styles/themes/adea-light-high-contrast.css +21 -14
  140. package/src/styles/themes/adea-light.css +22 -15
  141. package/src/styles/themes/ayu-light.css +20 -13
  142. package/src/styles/themes/ayu-mirage.css +21 -14
  143. package/src/styles/themes/ayu.css +22 -15
  144. package/src/styles/themes/catppuccin-frappe.css +16 -9
  145. package/src/styles/themes/catppuccin-latte.css +15 -8
  146. package/src/styles/themes/catppuccin-macchiato.css +16 -9
  147. package/src/styles/themes/catppuccin-mocha.css +16 -9
  148. package/src/styles/themes/dracula.css +16 -9
  149. package/src/styles/themes/everforest-dark.css +19 -12
  150. package/src/styles/themes/everforest-light.css +21 -14
  151. package/src/styles/themes/gruvbox-dark.css +21 -14
  152. package/src/styles/themes/gruvbox-light.css +20 -13
  153. package/src/styles/themes/kanagawa.css +18 -11
  154. package/src/styles/themes/monokai.css +19 -12
  155. package/src/styles/themes/nord-light.css +7 -0
  156. package/src/styles/themes/nord.css +19 -12
  157. package/src/styles/themes/one-dark.css +16 -9
  158. package/src/styles/themes/rosepine-dawn.css +19 -12
  159. package/src/styles/themes/rosepine-moon.css +20 -13
  160. package/src/styles/themes/rosepine.css +20 -13
  161. package/src/styles/themes/solarized-dark.css +19 -12
  162. package/src/styles/themes/solarized-light.css +19 -12
  163. package/src/styles/themes/tokyonight-day.css +7 -0
  164. package/src/styles/themes/tokyonight-night.css +18 -11
  165. package/src/styles/themes/tokyonight-storm.css +18 -11
  166. package/src/styles/themes/vesper.css +22 -15
@@ -1 +1 @@
1
- {"version":3,"file":"message.js","names":["createMemo","For","Index","Match","Show","splitProps","Switch","cn","CodeBlock","InlineCode","parseMessageTextIncremental","role","label","streaming","anchorId","Message","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","undefined","class","_$insert","children","MessageHeader","avatar","time","_el$2","_tmpl$2","_el$3","firstChild","_$createComponent","when","avatarSlot","_$memo","timeSlot","_el$4","_tmpl$3","MessageContent","_el$5","_tmpl$4","MessageActions","_el$6","_tmpl$5","MessageFooter","_el$7","_tmpl$6","index","language","code","complete","count","render","numbers","text","codeBlockProps","block","citations","sameBlock","a","b","kind","raw","MessageText","previous","previousCount","parsed","citationCount","blocks","next","merged","map","codeIndexes","lastIsProse","last","at","_el$8","_tmpl$8","each","BlockView","codeProps","codeIndex","_tmpl$7","chosen","choice","heading","_el$0","_tmpl$9","Inline","nodes","inline","_$effect","_$setAttribute","level","list","ordered","fallback","_el$10","_tmpl$1","items","item","_el$11","_tmpl$10","_el$1","_tmpl$0","_el$12","start","quote","_el$13","_tmpl$11","paragraph","_el$14","_tmpl$12","node","strong","_el$15","_tmpl$13","em","_el$16","_tmpl$14","link","_el$17","_tmpl$15","href","cite","marker"],"sources":["../../../../src/components/ui/message/message.tsx"],"sourcesContent":["import {\n createMemo,\n For,\n Index,\n Match,\n Show,\n splitProps,\n Switch,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { cn } from '#lib/utils'\nimport { CodeBlock, InlineCode, type CodeBlockProps } from '../code-block'\nimport {\n parseMessageTextIncremental,\n type MessageBlock,\n type MessageInline,\n type MessageParse,\n} from './parse-message-text'\n\n/**\n * Message.\n *\n * One turn. The two speakers are laid out differently on purpose, and that is\n * the whole design:\n *\n * - **The person's turn is a bubble on the trailing edge** — short, bounded, and\n * easy to find when scrolling back through a long session.\n * - **The assistant's turn is the page.** It has no surface, spans the reading\n * column, and holds everything the agent did *for that request* — activity\n * (a `Trace`), prose, code, a pending decision — in one place, so a turn\n * reads as an answer with its working underneath it rather than as a chain of\n * unrelated cards.\n *\n * `label` is the turn's accessible name (\"You\", \"Assistant\"): the avatar and\n * name are not drawn for every turn, because a transcript that repeats a speaker\n * on every line is one nobody reads, but the name must still be announced.\n * `streaming` sets `aria-busy`, which tells assistive technology to wait for the\n * turn to settle before reading it instead of announcing every token.\n *\n * `anchorId` is the stable identity `MessageScroller` uses to keep the reader's\n * place when older turns are inserted above it.\n */\nexport type MessageRole = 'user' | 'assistant' | 'system'\n\nexport type MessageProps = Omit<ComponentProps<'article'>, 'role'> & {\n role: MessageRole\n label: string\n streaming?: boolean\n anchorId?: string\n}\n\nexport function Message(props: MessageProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'role',\n 'label',\n 'streaming',\n 'anchorId',\n 'children',\n ])\n return (\n <article\n data-slot=\"message\"\n data-role={local.role}\n data-anchor-id={local.anchorId}\n aria-label={local.label}\n aria-busy={local.streaming || undefined}\n class={cn(\n 'group/message mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-2 py-2',\n // The engine may skip layout for turns far off screen; the intrinsic size\n // keeps the scrollbar honest while it does.\n '[content-visibility:auto] [contain-intrinsic-size:auto_6rem]',\n {\n 'items-end ps-[clamp(0rem,12%,4rem)]': local.role === 'user',\n 'items-stretch': local.role !== 'user',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </article>\n )\n}\n\n/** The speaker's mark and name, for the turns that draw one. */\nexport function MessageHeader(\n props: ComponentProps<'header'> & { avatar?: JSX.Element; time?: JSX.Element }\n) {\n const [local, rest] = splitProps(props, ['class', 'avatar', 'time', 'children'])\n return (\n <header\n data-slot=\"message-header\"\n class={cn('flex items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n <Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>\n <span class=\"font-medium text-foreground\">{local.children}</span>\n <Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>\n </header>\n )\n}\n\n/** The turn's parts, stacked. Gap is the rhythm between prose, activity and code. */\nexport function MessageContent(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div\n data-slot=\"message-content\"\n class={cn(\n 'flex w-full max-w-3xl min-w-0 flex-col gap-3 font-content text-content',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\n/**\n * Actions that belong to the turn (copy, retry). Hidden until the turn is hovered\n * or focused so the column is not a wall of buttons, but never `display: none`:\n * a control that only exists under the pointer cannot be reached by keyboard,\n * and on a touch screen there is no hover, so coarse pointers always see them.\n */\nexport function MessageActions(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-focus-within/message:opacity-100 group-hover/message:opacity-100 [@media(hover:none)]:opacity-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\nexport function MessageFooter(props: ComponentProps<'footer'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <footer\n data-slot=\"message-footer\"\n class={cn('flex min-w-0 items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </footer>\n )\n}\n\n/** The props of a fenced block the host may set. */\nexport type MessageCodeBlockProps = Pick<\n CodeBlockProps,\n 'loadHighlight' | 'maxHeight' | 'wrap' | 'showLineNumbers' | 'lineMarks' | 'lineLimit'\n>\n\n/** What the host is told about a fenced block when it chooses that block's props. */\nexport type MessageCodeBlockInfo = Readonly<{\n /** Position among the text's fenced blocks, from 0. */\n index: number\n language: string | undefined\n code: string\n complete: boolean\n}>\n\n/**\n * How `MessageText` draws citation markers. `count` is how many sources the host\n * has; a `[^n]` marker is a citation only when every `n` is within it. `render`\n * receives the 1-based source numbers and draws the marker, so the host decides\n * what a number means (`messageCitations` in the inline-citation composite does\n * this for a `Source` list).\n */\nexport type MessageCitations = Readonly<{\n count: number\n render: (numbers: readonly number[]) => JSX.Element\n}>\n\nexport type MessageTextProps = Omit<ComponentProps<'div'>, 'children'> & {\n text: string\n /** True while text may still arrive: a trailing open fence renders as partial code. */\n streaming?: boolean\n /**\n * Forwarded to each fenced block, e.g. to supply a lazy highlighter. A function\n * chooses per block, which is how line marks reach a block: marks belong to the\n * host's knowledge of the code (a diff, a failing line), never to the text.\n */\n codeBlockProps?: MessageCodeBlockProps | ((block: MessageCodeBlockInfo) => MessageCodeBlockProps)\n /** Without it, `[^1]` stays the literal text it was written as. */\n citations?: MessageCitations\n}\n\nfunction sameBlock(a: MessageBlock | undefined, b: MessageBlock): boolean {\n return (\n a !== undefined &&\n a.kind === b.kind &&\n a.raw === b.raw &&\n (a.kind !== 'code' || (b.kind === 'code' && a.complete === b.complete))\n )\n}\n\n/**\n * Text, read safely.\n *\n * Renders `parseMessageText`'s blocks as elements: nothing is interpreted as\n * HTML and a link only becomes an anchor when its scheme is http, https or\n * mailto. Blocks are kept by *position* and reuse their previous parsed object\n * when unchanged, so a streaming turn updates the block that is growing and\n * leaves every earlier paragraph and code block — and any selection or focus\n * inside them — untouched.\n */\nexport function MessageText(props: MessageTextProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'text',\n 'streaming',\n 'codeBlockProps',\n 'citations',\n ])\n let previous: readonly MessageBlock[] = []\n let previousCount = 0\n let parsed: MessageParse | undefined\n // Only the number of sources reaches the parser, so a new `render` function\n // does not reparse the text, and a changed count does.\n const citationCount = () => local.citations?.count ?? 0\n const blocks = createMemo(() => {\n const count = citationCount()\n if (count !== previousCount) previous = []\n previousCount = count\n // A streamed reply only grows, so each delta parses the tail it touched\n // rather than the whole reply (which made a long reply quadratic).\n parsed = parseMessageTextIncremental(parsed, local.text, {\n streaming: local.streaming,\n citations: count || undefined,\n })\n const next = parsed.blocks\n const merged = next.map((block, index) =>\n sameBlock(previous[index], block) ? previous[index]! : block\n )\n previous = merged\n return merged\n })\n // The nth fenced block, so a host can address it. Blocks keep their positions\n // while text streams in after them, so an index stays attached to its block.\n const codeIndexes = createMemo(() => {\n let next = 0\n return blocks().map((block) => (block.kind === 'code' ? next++ : -1))\n })\n const lastIsProse = () => {\n const last = blocks().at(-1)\n return last !== undefined && last.kind !== 'code'\n }\n return (\n <div data-slot=\"message-text\" class={cn('flex min-w-0 flex-col gap-3', local.class)} {...rest}>\n <Index each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </Index>\n <Show when={local.streaming && lastIsProse()}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\nfunction BlockView(props: {\n block: MessageBlock\n codeProps?: MessageTextProps['codeBlockProps']\n codeIndex: () => number\n citations?: MessageCitations\n}) {\n return (\n <Switch>\n <Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>\n <Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n </Switch>\n )\n}\n\nfunction Inline(props: { nodes: readonly MessageInline[]; citations?: MessageCitations }) {\n // By position, not identity: the parser returns fresh nodes for the growing\n // paragraph on every streamed token, and a keyed list would rebuild each one.\n return (\n <Index each={props.nodes}>\n {(node) => (\n <Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>\n )}\n </Index>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAoD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"file":"message.js","names":["createMemo","For","Index","Match","Show","splitProps","Switch","Check","Copy","createCopyFeedback","cn","ActionButton","CodeBlock","InlineCode","parseMessageTextIncremental","role","label","streaming","anchorId","Message","props","local","rest","_el$","_tmpl$","_$spread","_$mergeProps","undefined","class","_$insert","children","MessageHeader","avatar","time","_el$2","_tmpl$2","_el$3","firstChild","_$createComponent","when","avatarSlot","_$memo","timeSlot","_el$4","_tmpl$3","MessageContent","_el$5","_tmpl$4","MessageActions","_el$6","_tmpl$5","MessageAction","type","variant","size","tooltip","tooltipSide","MessageCopyAction","text","feedback","copied","failed","onClick","copy","fallback","MessageFooter","_el$7","_tmpl$6","index","language","code","complete","count","render","numbers","codeBlockProps","block","citations","sameBlock","a","b","kind","raw","MessageText","previous","previousCount","parsed","citationCount","blocks","next","merged","map","codeIndexes","lastIsProse","last","at","_el$8","_tmpl$8","each","BlockView","codeProps","codeIndex","_tmpl$7","chosen","choice","heading","_el$0","_tmpl$9","Inline","nodes","inline","_$effect","_$setAttribute","level","list","ordered","_el$10","_tmpl$1","items","item","_el$11","_tmpl$10","_el$1","_tmpl$0","_el$12","start","quote","_el$13","_tmpl$11","paragraph","_el$14","_tmpl$12","node","strong","_el$15","_tmpl$13","em","_el$16","_tmpl$14","link","_el$17","_tmpl$15","href","cite","marker"],"sources":["../../../../src/components/ui/message/message.tsx"],"sourcesContent":["import {\n createMemo,\n For,\n Index,\n Match,\n Show,\n splitProps,\n Switch,\n type ComponentProps,\n type JSX,\n} from 'solid-js'\nimport { Check, Copy } from 'lucide-solid'\nimport { createCopyFeedback } from '#lib/clipboard'\nimport { cn } from '#lib/utils'\nimport { ActionButton, type ActionButtonProps } from '../../composites/action-button'\nimport { CodeBlock, InlineCode, type CodeBlockProps } from '../code-block'\nimport {\n parseMessageTextIncremental,\n type MessageBlock,\n type MessageInline,\n type MessageParse,\n} from './parse-message-text'\n\n/**\n * Message.\n *\n * One turn. The two speakers are laid out differently on purpose, and that is\n * the whole design:\n *\n * - **The person's turn is a bubble on the trailing edge** — short, bounded, and\n * easy to find when scrolling back through a long session.\n * - **The assistant's turn is the page.** It has no surface, spans the reading\n * column, and holds everything the agent did *for that request* — activity\n * (a `Trace`), prose, code, a pending decision — in one place, so a turn\n * reads as an answer with its working underneath it rather than as a chain of\n * unrelated cards.\n *\n * `label` is the turn's accessible name (\"You\", \"Assistant\"): the avatar and\n * name are not drawn for every turn, because a transcript that repeats a speaker\n * on every line is one nobody reads, but the name must still be announced.\n * `streaming` sets `aria-busy`, which tells assistive technology to wait for the\n * turn to settle before reading it instead of announcing every token.\n *\n * `anchorId` is the stable identity `MessageScroller` uses to keep the reader's\n * place when older turns are inserted above it.\n */\nexport type MessageRole = 'user' | 'assistant' | 'system'\n\nexport type MessageProps = Omit<ComponentProps<'article'>, 'role'> & {\n role: MessageRole\n label: string\n streaming?: boolean\n anchorId?: string\n}\n\nexport function Message(props: MessageProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'role',\n 'label',\n 'streaming',\n 'anchorId',\n 'children',\n ])\n return (\n <article\n data-slot=\"message\"\n data-role={local.role}\n data-anchor-id={local.anchorId}\n aria-label={local.label}\n aria-busy={local.streaming || undefined}\n class={cn(\n 'group/message mx-auto flex w-full max-w-3xl min-w-0 flex-col gap-2 py-2',\n // The engine may skip layout for turns far off screen; the intrinsic size\n // keeps the scrollbar honest while it does.\n '[content-visibility:auto] [contain-intrinsic-size:auto_6rem]',\n {\n 'items-end ps-[clamp(0rem,12%,4rem)]': local.role === 'user',\n 'items-stretch': local.role !== 'user',\n },\n local.class\n )}\n {...rest}\n >\n {local.children}\n </article>\n )\n}\n\n/** The speaker's mark and name, for the turns that draw one. */\nexport function MessageHeader(\n props: ComponentProps<'header'> & { avatar?: JSX.Element; time?: JSX.Element }\n) {\n const [local, rest] = splitProps(props, ['class', 'avatar', 'time', 'children'])\n return (\n <header\n data-slot=\"message-header\"\n class={cn('flex items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n <Show when={local.avatar}>{(avatarSlot) => <>{avatarSlot()}</>}</Show>\n <span class=\"font-medium text-foreground\">{local.children}</span>\n <Show when={local.time}>{(timeSlot) => <span class=\"tabular-nums\">{timeSlot()}</span>}</Show>\n </header>\n )\n}\n\n/** The turn's parts, stacked. Gap is the rhythm between prose, activity and code. */\nexport function MessageContent(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div\n data-slot=\"message-content\"\n class={cn(\n 'flex w-full max-w-3xl min-w-0 flex-col gap-3 font-content text-content',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\n/**\n * Actions that belong to the turn (copy, retry). Hidden until the turn is hovered\n * or focused so the column is not a wall of buttons, but never `display: none`:\n * a control that only exists under the pointer cannot be reached by keyboard,\n * and on a touch screen there is no hover, so coarse pointers always see them.\n */\nexport function MessageActions(props: ComponentProps<'div'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <div\n data-slot=\"message-actions\"\n class={cn(\n 'flex items-center gap-1 opacity-0 transition-opacity ease-out group-focus-within/message:opacity-100 group-hover/message:opacity-100 [@media(hover:none)]:opacity-100',\n local.class\n )}\n {...rest}\n >\n {local.children}\n </div>\n )\n}\n\nexport type MessageActionProps = Omit<ActionButtonProps, 'tooltip' | 'aria-label'> & {\n /** The action's name: its accessible name and its tooltip. */\n label: string\n}\n\n/**\n * One action on a turn: an icon button whose name is also its tooltip, as in\n * AI Elements' MessageAction. Turn actions are icons, never words, so a row of\n * them stays one line under any message.\n */\nexport function MessageAction(props: MessageActionProps) {\n const [local, rest] = splitProps(props, ['label'])\n return (\n <ActionButton\n type=\"button\"\n variant=\"ghost\"\n size=\"icon-xs\"\n data-slot=\"message-action\"\n aria-label={local.label}\n tooltip={local.label}\n tooltipSide=\"bottom\"\n {...(rest as ActionButtonProps)}\n />\n )\n}\n\n/** Copies the turn's text and shows a check for a moment once the clipboard took it. */\nexport function MessageCopyAction(\n props: Omit<MessageActionProps, 'label' | 'children' | 'onClick'> & {\n text: string | (() => string)\n label?: string\n }\n) {\n const [local, rest] = splitProps(props, ['text', 'label'])\n const feedback = createCopyFeedback()\n const label = () =>\n feedback.copied() ? 'Copied' : feedback.failed() ? 'Copy failed' : (local.label ?? 'Copy')\n return (\n <MessageAction\n label={label()}\n onClick={() => {\n const text = typeof local.text === 'function' ? local.text() : local.text\n void feedback.copy(text)\n }}\n {...rest}\n >\n <Show when={feedback.copied()} fallback={<Copy />}>\n <Check />\n </Show>\n </MessageAction>\n )\n}\n\nexport function MessageFooter(props: ComponentProps<'footer'>) {\n const [local, rest] = splitProps(props, ['class', 'children'])\n return (\n <footer\n data-slot=\"message-footer\"\n class={cn('flex min-w-0 items-center gap-2 text-xs text-muted-foreground', local.class)}\n {...rest}\n >\n {local.children}\n </footer>\n )\n}\n\n/** The props of a fenced block the host may set. */\nexport type MessageCodeBlockProps = Pick<\n CodeBlockProps,\n 'loadHighlight' | 'maxHeight' | 'wrap' | 'showLineNumbers' | 'lineMarks' | 'lineLimit'\n>\n\n/** What the host is told about a fenced block when it chooses that block's props. */\nexport type MessageCodeBlockInfo = Readonly<{\n /** Position among the text's fenced blocks, from 0. */\n index: number\n language: string | undefined\n code: string\n complete: boolean\n}>\n\n/**\n * How `MessageText` draws citation markers. `count` is how many sources the host\n * has; a `[^n]` marker is a citation only when every `n` is within it. `render`\n * receives the 1-based source numbers and draws the marker, so the host decides\n * what a number means (`messageCitations` in the inline-citation composite does\n * this for a `Source` list).\n */\nexport type MessageCitations = Readonly<{\n count: number\n render: (numbers: readonly number[]) => JSX.Element\n}>\n\nexport type MessageTextProps = Omit<ComponentProps<'div'>, 'children'> & {\n text: string\n /** True while text may still arrive: a trailing open fence renders as partial code. */\n streaming?: boolean\n /**\n * Forwarded to each fenced block, e.g. to supply a lazy highlighter. A function\n * chooses per block, which is how line marks reach a block: marks belong to the\n * host's knowledge of the code (a diff, a failing line), never to the text.\n */\n codeBlockProps?: MessageCodeBlockProps | ((block: MessageCodeBlockInfo) => MessageCodeBlockProps)\n /** Without it, `[^1]` stays the literal text it was written as. */\n citations?: MessageCitations\n}\n\nfunction sameBlock(a: MessageBlock | undefined, b: MessageBlock): boolean {\n return (\n a !== undefined &&\n a.kind === b.kind &&\n a.raw === b.raw &&\n (a.kind !== 'code' || (b.kind === 'code' && a.complete === b.complete))\n )\n}\n\n/**\n * Text, read safely.\n *\n * Renders `parseMessageText`'s blocks as elements: nothing is interpreted as\n * HTML and a link only becomes an anchor when its scheme is http, https or\n * mailto. Blocks are kept by *position* and reuse their previous parsed object\n * when unchanged, so a streaming turn updates the block that is growing and\n * leaves every earlier paragraph and code block — and any selection or focus\n * inside them — untouched.\n */\nexport function MessageText(props: MessageTextProps) {\n const [local, rest] = splitProps(props, [\n 'class',\n 'text',\n 'streaming',\n 'codeBlockProps',\n 'citations',\n ])\n let previous: readonly MessageBlock[] = []\n let previousCount = 0\n let parsed: MessageParse | undefined\n // Only the number of sources reaches the parser, so a new `render` function\n // does not reparse the text, and a changed count does.\n const citationCount = () => local.citations?.count ?? 0\n const blocks = createMemo(() => {\n const count = citationCount()\n if (count !== previousCount) previous = []\n previousCount = count\n // A streamed reply only grows, so each delta parses the tail it touched\n // rather than the whole reply (which made a long reply quadratic).\n parsed = parseMessageTextIncremental(parsed, local.text, {\n streaming: local.streaming,\n citations: count || undefined,\n })\n const next = parsed.blocks\n const merged = next.map((block, index) =>\n sameBlock(previous[index], block) ? previous[index]! : block\n )\n previous = merged\n return merged\n })\n // The nth fenced block, so a host can address it. Blocks keep their positions\n // while text streams in after them, so an index stays attached to its block.\n const codeIndexes = createMemo(() => {\n let next = 0\n return blocks().map((block) => (block.kind === 'code' ? next++ : -1))\n })\n const lastIsProse = () => {\n const last = blocks().at(-1)\n return last !== undefined && last.kind !== 'code'\n }\n return (\n <div data-slot=\"message-text\" class={cn('flex min-w-0 flex-col gap-3', local.class)} {...rest}>\n <Index each={blocks()}>\n {(block, index) => (\n <BlockView\n block={block()}\n codeProps={local.codeBlockProps}\n codeIndex={() => codeIndexes()[index] ?? 0}\n citations={local.citations}\n />\n )}\n </Index>\n <Show when={local.streaming && lastIsProse()}>\n <span class=\"streaming-caret\" aria-hidden=\"true\" />\n </Show>\n </div>\n )\n}\n\nfunction BlockView(props: {\n block: MessageBlock\n codeProps?: MessageTextProps['codeBlockProps']\n codeIndex: () => number\n citations?: MessageCitations\n}) {\n return (\n <Switch>\n <Match when={props.block.kind === 'code' && props.block}>\n {(block) => {\n const code = () => block() as Extract<MessageBlock, { kind: 'code' }>\n const chosen = () => {\n const choice = props.codeProps\n return typeof choice === 'function'\n ? choice({\n index: props.codeIndex(),\n language: code().language,\n code: code().code,\n complete: code().complete,\n })\n : choice\n }\n return (\n <CodeBlock\n code={code().code}\n language={code().language}\n complete={code().complete}\n {...chosen()}\n />\n )\n }}\n </Match>\n <Match when={props.block.kind === 'heading' && props.block}>\n {(block) => {\n const heading = () => block() as Extract<MessageBlock, { kind: 'heading' }>\n return (\n <p\n role=\"heading\"\n aria-level={heading().level + 2}\n class=\"font-semibold text-foreground [overflow-wrap:anywhere]\"\n >\n <Inline nodes={heading().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'list' && props.block}>\n {(block) => {\n const list = () => block() as Extract<MessageBlock, { kind: 'list' }>\n return (\n <Show\n when={list().ordered}\n fallback={\n <ul class=\"m-0 ms-5 flex list-disc flex-col gap-1 p-0 marker:text-muted-foreground\">\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ul>\n }\n >\n <ol\n start={list().start}\n class=\"m-0 ms-5 flex list-decimal flex-col gap-1 p-0 marker:text-muted-foreground\"\n >\n <For each={list().items}>\n {(item) => (\n <li class=\"[overflow-wrap:anywhere]\">\n <Inline nodes={item} citations={props.citations} />\n </li>\n )}\n </For>\n </ol>\n </Show>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'quote' && props.block}>\n {(block) => {\n const quote = () => block() as Extract<MessageBlock, { kind: 'quote' }>\n return (\n <blockquote class=\"m-0 border-s-2 border-border ps-3 whitespace-pre-wrap text-muted-foreground [overflow-wrap:anywhere]\">\n <Inline nodes={quote().inline} citations={props.citations} />\n </blockquote>\n )\n }}\n </Match>\n <Match when={props.block.kind === 'paragraph' && props.block}>\n {(block) => {\n const paragraph = () => block() as Extract<MessageBlock, { kind: 'paragraph' }>\n return (\n <p class=\"m-0 whitespace-pre-wrap [overflow-wrap:anywhere]\">\n <Inline nodes={paragraph().inline} citations={props.citations} />\n </p>\n )\n }}\n </Match>\n </Switch>\n )\n}\n\nfunction Inline(props: { nodes: readonly MessageInline[]; citations?: MessageCitations }) {\n // By position, not identity: the parser returns fresh nodes for the growing\n // paragraph on every streamed token, and a keyed list would rebuild each one.\n return (\n <Index each={props.nodes}>\n {(node) => (\n <Switch>\n {/* Fragments keep the reads reactive: Match runs its callback untracked. */}\n <Match when={node().kind === 'text' && node()}>\n {(text) => <>{(text() as { text: string }).text}</>}\n </Match>\n <Match when={node().kind === 'code' && node()}>\n {(code) => <InlineCode>{(code() as { text: string }).text}</InlineCode>}\n </Match>\n <Match when={node().kind === 'strong' && node()}>\n {(strong) => (\n <strong class=\"font-semibold\">\n <Inline\n nodes={(strong() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </strong>\n )}\n </Match>\n <Match when={node().kind === 'em' && node()}>\n {(em) => (\n <em>\n <Inline\n nodes={(em() as { children: readonly MessageInline[] }).children}\n citations={props.citations}\n />\n </em>\n )}\n </Match>\n <Match when={node().kind === 'link' && node()}>\n {(link) => (\n <a\n href={(link() as { href: string }).href}\n target=\"_blank\"\n rel=\"noreferrer noopener\"\n class=\"text-primary underline underline-offset-2 hover:no-underline\"\n >\n <Inline nodes={(link() as { children: readonly MessageInline[] }).children} />\n </a>\n )}\n </Match>\n <Match when={node().kind === 'cite' && node()}>\n {(cite) => {\n const marker = () => cite() as { numbers: readonly number[]; raw: string }\n // The parser read this as a citation only while the host had sources;\n // if they have gone since, the marker is the text it was written as.\n // Match invokes this callback untracked; JSX keeps renderer and\n // same-count source replacements reactive without replacing the block.\n return (\n <>{props.citations ? props.citations.render(marker().numbers) : marker().raw}</>\n )\n }}\n </Match>\n </Switch>\n )}\n </Index>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAuDA,SAAgBmB,QAAQC,OAAqB;CAC3C,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO;EACtC;EACA;EACA;EACA;EACA;EACA;CAAU,CACX;CACD,cAAA;EAAA,IAAAG,OAAAC,OAAA;EAAAC,OAAAF,MAAAG,WAAA;GAAA,KAAA,eAAA;IAAA,OAGeL,MAAMN;GAAI;GAAA,KAAA,oBAAA;IAAA,OACLM,MAAMH;GAAQ;GAAA,KAAA,gBAAA;IAAA,OAClBG,MAAML;GAAK;GAAA,KAAA,eAAA;IAAA,OACZK,MAAMJ,aAAaU,KAAAA;GAAS;GAAA,KAAA,WAAA;IAAA,OAChCjB,GACL,2EAGA,gEACA;KACE,uCAAuCW,MAAMN,SAAS;KACtD,iBAAiBM,MAAMN,SAAS;IAClC,GACAM,MAAMO,KACR;GAAC;EAAA,GACGN,IAAI,GAAA,OAAA,IAAA;EAAAO,OAAAN,YAEPF,MAAMS,QAAQ;EAAA,OAAAP;CAAA,EAAA,CAAA;AAGrB;;AAGA,SAAgBQ,cACdX,OACA;CACA,MAAM,CAACC,OAAOC,QAAQjB,WAAWe,OAAO;EAAC;EAAS;EAAU;EAAQ;CAAU,CAAC;CAC/E,cAAA;EAAA,IAAAc,QAAAC,QAAA,GAAAC,QAAAF,MAAAG;EAAAZ,OAAAS,OAAAR,WAAA,EAAA,KAAA,WAAA;GAAA,OAGWhB,GAAG,yDAAyDW,MAAMO,KAAK;EAAC,EAAA,GAC3EN,IAAI,GAAA,OAAA,IAAA;EAAAO,OAAAK,OAAAI,gBAEPlC,MAAI;GAAA,IAACmC,OAAI;IAAA,OAAElB,MA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EAAA,EAAA,CAAA;CAGN,CAAA;AAGP"}
@@ -291,7 +291,7 @@ function TooltipContent(props) {
291
291
  return createComponent(Tooltip.Content, mergeProps({
292
292
  "data-slot": "tooltip-content",
293
293
  get ["class"]() {
294
- return cn(tooltipTip, "z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1", "origin-(--kb-tooltip-content-transform-origin) text-balance", tooltipMotion, { "flex items-center gap-2 whitespace-nowrap": !!icon() }, local.class);
294
+ return cn(tooltipTip, "z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-3 py-1.5", "origin-(--kb-tooltip-content-transform-origin) text-balance", tooltipMotion, { "flex items-center gap-2 whitespace-nowrap": !!icon() }, local.class);
295
295
  },
296
296
  style: { "pointer-events": "none" },
297
297
  get ["aria-hidden"]() {
@@ -1 +1 @@
1
- {"version":3,"file":"tooltip.js","names":["Tooltip","KobalteTooltip","useTooltipContext","children","resolveChildren","createContext","createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","useContext","isServer","callHandler","tooltipMotion","tooltipTip","topLayerProps","acquireTooltipFocusGate","releaseTooltipFocusGate","cn","openDelay","closeDelay","skipDelayDuration","tooltipDefaults","TooltipTimingContext","POINTER_CLOSE_INTENT_SLACK_MS","TooltipEscapeTargetContext","element","dismiss","event","ESCAPE_LAYER_SELECTOR","id","trigger","setTrigger","isOpen","isDisabled","isTriggerFocused","markOpenIntent","clearOpenIntent","requestCloseFromAnotherTooltip","markPointerCloseIntent","clearPointerCloseIntent","markCloseIntent","TooltipInteractionContext","openTooltipInteractions","Set","pendingTooltipOpenId","tooltipScrollListenerAttached","clearPendingTooltipOpen","undefined","tooltipScrollContainsTrigger","target","window","Node","contains","handleTooltipScroll","interaction","handleTooltipPointerMove","setTooltipInteractionOpen","open","has","add","addEventListener","document","delete","size","removeEventListener","registerTooltipInteraction","TooltipProvider","props","_$createComponent","Provider","value","timing","local","rest","controlled","uncontrolledOpen","setUncontrolledOpen","defaultOpen","closeIntent","ignoreDuplicateClose","onOpenChange","next","source","pointerCloseIntentUntil","pointerCloseIntentTimeout","setTimeout","clearTimeout","intentWindow","Date","now","queueMicrotask","disabled","Boolean","activeElement","openInteraction","focusedTrigger","anotherTooltipOpening","handleKeyDown","key","_$mergeProps","TooltipTrigger","Trigger","ref","onFocus","defaultPrevented","onBlur","onPointerEnter","onPointerLeave","onClick","Content","icon","TooltipContent","context","escapeTarget","Portal","class","style","_$memo","onEscapeKeyDown","layer","closest","onPointerDownOutside","when","iconSlot","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport {\n children as resolveChildren,\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { callHandler } from '#lib/events'\nimport { tooltipMotion, tooltipTip, topLayerProps } from '#lib/overlay'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\nimport { cn } from '#lib/utils'\n\n/**\n * The provider sets the *timing* defaults for every tooltip below it.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * After a tooltip has been seen, the next one opens immediately for this\n * long. This is what makes moving along a row of icons feel like one\n * gesture instead of four separate waits.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\n/**\n * How long after a pointer leaves a keyboard-focused trigger its close request\n * still counts as the pointer's: Kobalte reports that close one `closeDelay`\n * later, plus a frame of slack for the timer to fire.\n */\nconst POINTER_CLOSE_INTENT_SLACK_MS = 50\n\n/**\n * The layer a tooltip sits in, when that layer closes on Escape.\n *\n * Kobalte stacks a tooltip's content as the top-most dismissable layer, and\n * only the top-most layer receives Escape — so a tip shown on a focused\n * control inside a dialog took the key the dialog needed, and stayed the top\n * layer for its exit animation. A tip is never a stop for Escape: when it\n * receives the key it closes and passes it on to this layer, provided focus is\n * still inside that layer and in no menu, listbox or popover stacked between\n * them. The layer's own Escape handler runs first and can still keep it open.\n * Dialog-shaped overlays provide it; nothing else needs to.\n */\nexport const TooltipEscapeTargetContext = createContext<{\n element: Accessor<HTMLElement | undefined>\n dismiss: (event: KeyboardEvent) => void\n}>()\n\n/** The layers that take Escape before the dialog-shaped one around them. */\nconst ESCAPE_LAYER_SELECTOR = '[role$=dialog],[role=menu],[role=listbox]'\n\ntype TooltipInteraction = {\n id: string\n trigger: () => HTMLElement | undefined\n setTrigger: (element: HTMLElement) => void\n isOpen: () => boolean\n isDisabled: () => boolean\n isTriggerFocused: () => boolean\n markOpenIntent: () => void\n clearOpenIntent: () => void\n requestCloseFromAnotherTooltip: () => void\n markPointerCloseIntent: () => void\n clearPointerCloseIntent: () => void\n markCloseIntent: () => void\n}\n\nconst TooltipInteractionContext = createContext<TooltipInteraction>()\nconst openTooltipInteractions = new Set<TooltipInteraction>()\nlet pendingTooltipOpenId: string | undefined\nlet tooltipScrollListenerAttached = false\n\nfunction clearPendingTooltipOpen(id: string) {\n if (pendingTooltipOpenId === id) pendingTooltipOpenId = undefined\n}\n\nfunction tooltipScrollContainsTrigger(event: Event, trigger: HTMLElement) {\n const target = event.target\n return target === window || (target instanceof Node && target.contains(trigger))\n}\n\nfunction handleTooltipScroll(event: Event) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n if (interaction.isOpen() && trigger && tooltipScrollContainsTrigger(event, trigger)) {\n interaction.markCloseIntent()\n }\n }\n}\n\nfunction handleTooltipPointerMove(event: PointerEvent) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n const target = event.target\n if (\n interaction.isOpen() &&\n interaction.isTriggerFocused() &&\n trigger &&\n !(target instanceof Node && trigger.contains(target))\n ) {\n interaction.markPointerCloseIntent()\n }\n }\n}\n\nfunction setTooltipInteractionOpen(interaction: TooltipInteraction, open: boolean) {\n if (isServer) return\n\n if (open) {\n if (openTooltipInteractions.has(interaction)) return\n openTooltipInteractions.add(interaction)\n if (!tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = true\n // Register before Kobalte's global listeners so intentional scroll\n // dismissal can be distinguished from its delayed pointer dismissal.\n window.addEventListener('scroll', handleTooltipScroll, true)\n document.addEventListener('pointermove', handleTooltipPointerMove, true)\n }\n } else {\n openTooltipInteractions.delete(interaction)\n if (openTooltipInteractions.size === 0 && tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = false\n window.removeEventListener('scroll', handleTooltipScroll, true)\n document.removeEventListener('pointermove', handleTooltipPointerMove, true)\n }\n }\n}\n\nfunction registerTooltipInteraction(interaction: TooltipInteraction) {\n onCleanup(() => {\n setTooltipInteractionOpen(interaction, false)\n clearPendingTooltipOpen(interaction.id)\n })\n}\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext.Provider\n value={{\n openDelay: props.openDelay ?? tooltipDefaults.openDelay,\n closeDelay: props.closeDelay ?? tooltipDefaults.closeDelay,\n skipDelayDuration: props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration,\n }}\n >\n {props.children}\n </TooltipTimingContext.Provider>\n )\n}\n\nexport type TooltipRootProps = ComponentProps<typeof KobalteTooltip>\n\nexport function Tooltip(props: TooltipRootProps) {\n // One document-level focus gate for every tooltip in the document: the first\n // tooltip acquires it, the last to unmount releases it. This is what keeps a\n // dialog's autofocus and an overlay's focus restoration from opening a tip —\n // see #lib/tooltip-focus-gate for the contract and the two over-reach traps\n // (pointer gestures and separator resize grips) it must not swallow.\n if (!isServer) {\n acquireTooltipFocusGate()\n onCleanup(releaseTooltipFocusGate)\n }\n const timing = useContext(TooltipTimingContext)\n const [local, rest] = splitProps(props, ['open', 'defaultOpen', 'onOpenChange', 'disabled'])\n const id = createUniqueId()\n const controlled = () => local.open !== undefined\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const isOpen = () => (controlled() ? (local.open ?? false) : uncontrolledOpen())\n const [trigger, setTrigger] = createSignal<HTMLElement>()\n let closeIntent = false\n let ignoreDuplicateClose = false\n let onOpenChange: (next: boolean, source?: 'handoff') => void\n let pointerCloseIntentUntil = 0\n let pointerCloseIntentTimeout: ReturnType<typeof setTimeout> | undefined\n const clearPointerCloseIntent = () => {\n pointerCloseIntentUntil = 0\n if (pointerCloseIntentTimeout) clearTimeout(pointerCloseIntentTimeout)\n pointerCloseIntentTimeout = undefined\n }\n const markPointerCloseIntent = () => {\n if (!isOpen()) return\n clearPointerCloseIntent()\n const intentWindow = (props.closeDelay ?? timing.closeDelay) + POINTER_CLOSE_INTENT_SLACK_MS\n pointerCloseIntentUntil = Date.now() + intentWindow\n pointerCloseIntentTimeout = setTimeout(clearPointerCloseIntent, intentWindow)\n }\n const markCloseIntent = () => {\n closeIntent = true\n clearPointerCloseIntent()\n queueMicrotask(() => {\n closeIntent = false\n })\n }\n const requestCloseFromAnotherTooltip = () => {\n if (!isOpen()) return\n\n // Another trigger is an explicit handoff, even when a focused tooltip has\n // a pending pointer-close intent that would otherwise suppress Kobalte's\n // close callback. Route the request through the same controlled/uncontrolled\n // state contract as Kobalte and ignore its duplicate callback for this turn.\n ignoreDuplicateClose = true\n queueMicrotask(() => {\n ignoreDuplicateClose = false\n })\n onOpenChange(false, 'handoff')\n }\n const interaction: TooltipInteraction = {\n id,\n trigger,\n setTrigger,\n isOpen,\n isDisabled: () => local.disabled ?? false,\n isTriggerFocused: () =>\n Boolean(trigger() && typeof document !== 'undefined' && trigger() === document.activeElement),\n markOpenIntent: () => {\n clearPointerCloseIntent()\n pendingTooltipOpenId = id\n // A focused tooltip ignores ordinary pointer movement, but entering or\n // focusing another tooltip is an explicit transfer.\n for (const openInteraction of openTooltipInteractions) {\n if (openInteraction.id !== id) openInteraction.requestCloseFromAnotherTooltip()\n }\n },\n clearOpenIntent: () => clearPendingTooltipOpen(id),\n requestCloseFromAnotherTooltip,\n markPointerCloseIntent,\n clearPointerCloseIntent,\n markCloseIntent,\n }\n registerTooltipInteraction(interaction)\n onCleanup(() => {\n clearPointerCloseIntent()\n ignoreDuplicateClose = false\n })\n if (isOpen()) setTooltipInteractionOpen(interaction, true)\n createEffect(() => setTooltipInteractionOpen(interaction, isOpen()))\n onOpenChange = (next: boolean, source) => {\n if (!next && source !== 'handoff' && ignoreDuplicateClose) return\n\n if (next) {\n clearPendingTooltipOpen(id)\n clearPointerCloseIntent()\n // Install this capture listener before Kobalte's open-state effect adds\n // its scroll listener later in the same update.\n setTooltipInteractionOpen(interaction, true)\n } else {\n const focusedTrigger = interaction.isTriggerFocused()\n const anotherTooltipOpening =\n pendingTooltipOpenId !== undefined && pendingTooltipOpenId !== id\n const pointerClosePending = Date.now() <= pointerCloseIntentUntil\n if (\n source !== 'handoff' &&\n focusedTrigger &&\n pointerClosePending &&\n !closeIntent &&\n !anotherTooltipOpening\n ) {\n clearPointerCloseIntent()\n return\n }\n closeIntent = false\n clearPointerCloseIntent()\n clearPendingTooltipOpen(id)\n }\n\n if (!controlled()) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n if (next) {\n // A controlled parent can reject the open request without changing its\n // signal, so the effect above would not rerun to release this listener.\n queueMicrotask(() => {\n if (!isOpen()) setTooltipInteractionOpen(interaction, false)\n })\n }\n }\n\n // Kobalte dismisses on Escape only when its content owns the top-most\n // layer, and a handoff keeps the previous tooltip's content mounted while\n // it exits — swallowing the key for the tooltip that just took over.\n // Listening on document (capture) closes this tooltip first; the layer's\n // own handler still runs for anything stacked above it.\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n markCloseIntent()\n onOpenChange(false)\n }\n createEffect(() => {\n if (isServer || !isOpen()) return\n document.addEventListener('keydown', handleKeyDown, true)\n onCleanup(() => document.removeEventListener('keydown', handleKeyDown, true))\n })\n\n return (\n <TooltipInteractionContext.Provider value={interaction}>\n <KobalteTooltip\n open={isOpen()}\n onOpenChange={onOpenChange}\n disabled={local.disabled}\n openDelay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n skipDelayDuration={props.skipDelayDuration ?? timing.skipDelayDuration}\n {...rest}\n />\n </TooltipInteractionContext.Provider>\n )\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'ref',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onClick',\n ])\n\n return (\n <KobalteTooltip.Trigger\n {...rest}\n ref={(element) => {\n interaction?.setTrigger(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onFocus={(event) => {\n callHandler(local.onFocus, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onBlur={(event) => {\n callHandler(local.onBlur, event)\n interaction?.clearOpenIntent()\n interaction?.markCloseIntent()\n }}\n onPointerEnter={(event) => {\n callHandler(local.onPointerEnter, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onPointerLeave={(event) => {\n callHandler(local.onPointerLeave, event)\n interaction?.clearOpenIntent()\n interaction?.markPointerCloseIntent()\n }}\n onClick={(event) => {\n callHandler(local.onClick, event)\n interaction?.markCloseIntent()\n }}\n />\n )\n}\n\nexport type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does not\n * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'icon',\n 'aria-hidden',\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n ])\n const context = useTooltipContext()\n const escapeTarget = useContext(TooltipEscapeTargetContext)\n\n // Kobalte keeps force-mounted and exiting content present after close. Hide\n // that retained tooltip from assistive technology until it opens again.\n const icon = resolveChildren(() => local.icon)\n return (\n <KobalteTooltip.Portal>\n <KobalteTooltip.Content\n /* The slot is what base.css's pointer-transparency rule keys on; every\n tip carries it, so no consumer has to remember to pass it. */\n data-slot=\"tooltip-content\"\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which\n // Kobalte can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-2 py-1',\n 'origin-(--kb-tooltip-content-transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!icon() },\n local.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. Kobalte\n // inlines pointer-events auto, so this is forced after its merge; the\n // pointer belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n aria-hidden={context.isOpen() ? local['aria-hidden'] : true}\n onEscapeKeyDown={(event) => {\n local.onEscapeKeyDown?.(event)\n if (event.defaultPrevented) return\n interaction?.markCloseIntent()\n const layer = escapeTarget?.element()\n if (layer && document.activeElement?.closest(ESCAPE_LAYER_SELECTOR) === layer)\n escapeTarget?.dismiss(event)\n }}\n onPointerDownOutside={(event) => {\n local.onPointerDownOutside?.(event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n // A tooltip opened from inside a modal dialog is part of that dialog's\n // surface, so it carries the same top-layer exemption as a menu or a\n // popover — without it the dialog's hide-outside observer aria-hides\n // the tip while it is on screen.\n {...topLayerProps}\n {...rest}\n >\n <Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>\n {local.children}\n </KobalteTooltip.Content>\n </KobalteTooltip.Portal>\n )\n}\n"],"mappings":";;;;;;;;;AAkCA,IAAMwB,kBAAiC;;CAErCH,WAAW;;CAEXC,YAAY;;;;;;CAMZC,mBAAmB;AACrB;AAEA,IAAME,uBAAuBpB,cAA6BmB,eAAe;;;;;;AAOzE,IAAME,gCAAgC;;;;;;;;;;;;;AActC,IAAaC,6BAA6BtB,cAGvC;;AAGH,IAAM0B,wBAAwB;AAiB9B,IAAMa,4BAA4BvC,cAAkC;AACpE,IAAMwC,0CAA0B,IAAIC,IAAwB;AAC5D,IAAIC;AACJ,IAAIC,gCAAgC;AAEpC,SAASC,wBAAwBjB,IAAY;CAC3C,IAAIe,yBAAyBf,IAAIe,uBAAuBG,KAAAA;AAC1D;AAEA,SAASC,6BAA6BrB,OAAcG,SAAsB;CACxE,MAAMmB,SAAStB,MAAMsB;CACrB,OAAOA,WAAWC,UAAWD,kBAAkBE,QAAQF,OAAOG,SAAStB,OAAO;AAChF;AAEA,SAASuB,oBAAoB1B,OAAc;CACzC,KAAK,MAAM2B,eAAeZ,yBAAyB;EACjD,MAAMZ,UAAUwB,YAAYxB,QAAQ;EACpC,IAAIwB,YAAYtB,OAAO,KAAKF,WAAWk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;IAC5BlD,aAAad,gBAAgB;IAC7B,MAAM+E,QAAQN,cAAcxF,QAAQ;IACpC,IAAI8F,SAAS1D,SAASgC,eAAe2B,QAAQ5F,qBAAqB,MAAM2F,OACtEN,cAAcvF,QAAQC,KAAK;GAC/B;GACA8F,uBAAuB9F,UAAU;IAC/B6C,MAAMiD,uBAAuB9F,KAAK;IAClC,IAAI,CAACA,MAAM6E,kBAAkBlD,aAAad,gBAAgB;GAC5D;EAAC,GAKG1B,eACA2D,MAAI,EAAA,IAAAzE,WAAA;GAAA,OAAA,CAAAoE,gBAEP7D,MAAI;IAAA,IAACmH,OAAI;KAAA,OAAEZ,KAAK;IAAC;IAAA9G,WACd2H,oBAAQ;KAAA,IAAAC,OAAAC,OAAA;KAAAC,OAAAF,MAMLD,QAAQ;KAAA,OAAAC;IAAA,EAAA,CAAA;GAEZ,CAAA,GAAAP,WAEF7C,MAAMxE,QAAQ,CAAA;EAAA,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAIvB"}
1
+ {"version":3,"file":"tooltip.js","names":["Tooltip","KobalteTooltip","useTooltipContext","children","resolveChildren","createContext","createEffect","createSignal","createUniqueId","onCleanup","Show","splitProps","useContext","isServer","callHandler","tooltipMotion","tooltipTip","topLayerProps","acquireTooltipFocusGate","releaseTooltipFocusGate","cn","openDelay","closeDelay","skipDelayDuration","tooltipDefaults","TooltipTimingContext","POINTER_CLOSE_INTENT_SLACK_MS","TooltipEscapeTargetContext","element","dismiss","event","ESCAPE_LAYER_SELECTOR","id","trigger","setTrigger","isOpen","isDisabled","isTriggerFocused","markOpenIntent","clearOpenIntent","requestCloseFromAnotherTooltip","markPointerCloseIntent","clearPointerCloseIntent","markCloseIntent","TooltipInteractionContext","openTooltipInteractions","Set","pendingTooltipOpenId","tooltipScrollListenerAttached","clearPendingTooltipOpen","undefined","tooltipScrollContainsTrigger","target","window","Node","contains","handleTooltipScroll","interaction","handleTooltipPointerMove","setTooltipInteractionOpen","open","has","add","addEventListener","document","delete","size","removeEventListener","registerTooltipInteraction","TooltipProvider","props","_$createComponent","Provider","value","timing","local","rest","controlled","uncontrolledOpen","setUncontrolledOpen","defaultOpen","closeIntent","ignoreDuplicateClose","onOpenChange","next","source","pointerCloseIntentUntil","pointerCloseIntentTimeout","setTimeout","clearTimeout","intentWindow","Date","now","queueMicrotask","disabled","Boolean","activeElement","openInteraction","focusedTrigger","anotherTooltipOpening","handleKeyDown","key","_$mergeProps","TooltipTrigger","Trigger","ref","onFocus","defaultPrevented","onBlur","onPointerEnter","onPointerLeave","onClick","Content","icon","TooltipContent","context","escapeTarget","Portal","class","style","_$memo","onEscapeKeyDown","layer","closest","onPointerDownOutside","when","iconSlot","_el$","_tmpl$","_$insert"],"sources":["../../../../src/components/ui/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as KobalteTooltip, useTooltipContext } from '@kobalte/core/tooltip'\nimport type { Accessor, ComponentProps, JSX } from 'solid-js'\nimport {\n children as resolveChildren,\n createContext,\n createEffect,\n createSignal,\n createUniqueId,\n onCleanup,\n Show,\n splitProps,\n useContext,\n} from 'solid-js'\nimport { isServer } from 'solid-js/web'\nimport { callHandler } from '#lib/events'\nimport { tooltipMotion, tooltipTip, topLayerProps } from '#lib/overlay'\nimport { acquireTooltipFocusGate, releaseTooltipFocusGate } from '#lib/tooltip-focus-gate'\nimport { cn } from '#lib/utils'\n\n/**\n * The provider sets the *timing* defaults for every tooltip below it.\n *\n * Timing is the part of a tooltip that has to agree across an app: one that\n * opens in 200ms in a toolbar and 700ms in a sidebar reads as a bug. The\n * provider is where that agreement lives. It is optional — a tooltip outside a\n * provider falls back to the same defaults — so a consumer can drop it in\n * without restructuring anything.\n */\ntype TooltipTiming = {\n openDelay: number\n closeDelay: number\n skipDelayDuration: number\n}\n\nconst tooltipDefaults: TooltipTiming = {\n /** Long enough that a pointer crossing a toolbar does not strobe tooltips. */\n openDelay: 400,\n /** Short, because the pointer has already left the control. */\n closeDelay: 80,\n /**\n * After a tooltip has been seen, the next one opens immediately for this\n * long. This is what makes moving along a row of icons feel like one\n * gesture instead of four separate waits.\n */\n skipDelayDuration: 500,\n}\n\nconst TooltipTimingContext = createContext<TooltipTiming>(tooltipDefaults)\n\n/**\n * How long after a pointer leaves a keyboard-focused trigger its close request\n * still counts as the pointer's: Kobalte reports that close one `closeDelay`\n * later, plus a frame of slack for the timer to fire.\n */\nconst POINTER_CLOSE_INTENT_SLACK_MS = 50\n\n/**\n * The layer a tooltip sits in, when that layer closes on Escape.\n *\n * Kobalte stacks a tooltip's content as the top-most dismissable layer, and\n * only the top-most layer receives Escape — so a tip shown on a focused\n * control inside a dialog took the key the dialog needed, and stayed the top\n * layer for its exit animation. A tip is never a stop for Escape: when it\n * receives the key it closes and passes it on to this layer, provided focus is\n * still inside that layer and in no menu, listbox or popover stacked between\n * them. The layer's own Escape handler runs first and can still keep it open.\n * Dialog-shaped overlays provide it; nothing else needs to.\n */\nexport const TooltipEscapeTargetContext = createContext<{\n element: Accessor<HTMLElement | undefined>\n dismiss: (event: KeyboardEvent) => void\n}>()\n\n/** The layers that take Escape before the dialog-shaped one around them. */\nconst ESCAPE_LAYER_SELECTOR = '[role$=dialog],[role=menu],[role=listbox]'\n\ntype TooltipInteraction = {\n id: string\n trigger: () => HTMLElement | undefined\n setTrigger: (element: HTMLElement) => void\n isOpen: () => boolean\n isDisabled: () => boolean\n isTriggerFocused: () => boolean\n markOpenIntent: () => void\n clearOpenIntent: () => void\n requestCloseFromAnotherTooltip: () => void\n markPointerCloseIntent: () => void\n clearPointerCloseIntent: () => void\n markCloseIntent: () => void\n}\n\nconst TooltipInteractionContext = createContext<TooltipInteraction>()\nconst openTooltipInteractions = new Set<TooltipInteraction>()\nlet pendingTooltipOpenId: string | undefined\nlet tooltipScrollListenerAttached = false\n\nfunction clearPendingTooltipOpen(id: string) {\n if (pendingTooltipOpenId === id) pendingTooltipOpenId = undefined\n}\n\nfunction tooltipScrollContainsTrigger(event: Event, trigger: HTMLElement) {\n const target = event.target\n return target === window || (target instanceof Node && target.contains(trigger))\n}\n\nfunction handleTooltipScroll(event: Event) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n if (interaction.isOpen() && trigger && tooltipScrollContainsTrigger(event, trigger)) {\n interaction.markCloseIntent()\n }\n }\n}\n\nfunction handleTooltipPointerMove(event: PointerEvent) {\n for (const interaction of openTooltipInteractions) {\n const trigger = interaction.trigger()\n const target = event.target\n if (\n interaction.isOpen() &&\n interaction.isTriggerFocused() &&\n trigger &&\n !(target instanceof Node && trigger.contains(target))\n ) {\n interaction.markPointerCloseIntent()\n }\n }\n}\n\nfunction setTooltipInteractionOpen(interaction: TooltipInteraction, open: boolean) {\n if (isServer) return\n\n if (open) {\n if (openTooltipInteractions.has(interaction)) return\n openTooltipInteractions.add(interaction)\n if (!tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = true\n // Register before Kobalte's global listeners so intentional scroll\n // dismissal can be distinguished from its delayed pointer dismissal.\n window.addEventListener('scroll', handleTooltipScroll, true)\n document.addEventListener('pointermove', handleTooltipPointerMove, true)\n }\n } else {\n openTooltipInteractions.delete(interaction)\n if (openTooltipInteractions.size === 0 && tooltipScrollListenerAttached) {\n tooltipScrollListenerAttached = false\n window.removeEventListener('scroll', handleTooltipScroll, true)\n document.removeEventListener('pointermove', handleTooltipPointerMove, true)\n }\n }\n}\n\nfunction registerTooltipInteraction(interaction: TooltipInteraction) {\n onCleanup(() => {\n setTooltipInteractionOpen(interaction, false)\n clearPendingTooltipOpen(interaction.id)\n })\n}\n\nexport type TooltipProviderProps = {\n children?: ComponentProps<'div'>['children']\n openDelay?: number\n closeDelay?: number\n skipDelayDuration?: number\n}\n\nexport function TooltipProvider(props: TooltipProviderProps) {\n return (\n <TooltipTimingContext.Provider\n value={{\n openDelay: props.openDelay ?? tooltipDefaults.openDelay,\n closeDelay: props.closeDelay ?? tooltipDefaults.closeDelay,\n skipDelayDuration: props.skipDelayDuration ?? tooltipDefaults.skipDelayDuration,\n }}\n >\n {props.children}\n </TooltipTimingContext.Provider>\n )\n}\n\nexport type TooltipRootProps = ComponentProps<typeof KobalteTooltip>\n\nexport function Tooltip(props: TooltipRootProps) {\n // One document-level focus gate for every tooltip in the document: the first\n // tooltip acquires it, the last to unmount releases it. This is what keeps a\n // dialog's autofocus and an overlay's focus restoration from opening a tip —\n // see #lib/tooltip-focus-gate for the contract and the two over-reach traps\n // (pointer gestures and separator resize grips) it must not swallow.\n if (!isServer) {\n acquireTooltipFocusGate()\n onCleanup(releaseTooltipFocusGate)\n }\n const timing = useContext(TooltipTimingContext)\n const [local, rest] = splitProps(props, ['open', 'defaultOpen', 'onOpenChange', 'disabled'])\n const id = createUniqueId()\n const controlled = () => local.open !== undefined\n const [uncontrolledOpen, setUncontrolledOpen] = createSignal(local.defaultOpen ?? false)\n const isOpen = () => (controlled() ? (local.open ?? false) : uncontrolledOpen())\n const [trigger, setTrigger] = createSignal<HTMLElement>()\n let closeIntent = false\n let ignoreDuplicateClose = false\n let onOpenChange: (next: boolean, source?: 'handoff') => void\n let pointerCloseIntentUntil = 0\n let pointerCloseIntentTimeout: ReturnType<typeof setTimeout> | undefined\n const clearPointerCloseIntent = () => {\n pointerCloseIntentUntil = 0\n if (pointerCloseIntentTimeout) clearTimeout(pointerCloseIntentTimeout)\n pointerCloseIntentTimeout = undefined\n }\n const markPointerCloseIntent = () => {\n if (!isOpen()) return\n clearPointerCloseIntent()\n const intentWindow = (props.closeDelay ?? timing.closeDelay) + POINTER_CLOSE_INTENT_SLACK_MS\n pointerCloseIntentUntil = Date.now() + intentWindow\n pointerCloseIntentTimeout = setTimeout(clearPointerCloseIntent, intentWindow)\n }\n const markCloseIntent = () => {\n closeIntent = true\n clearPointerCloseIntent()\n queueMicrotask(() => {\n closeIntent = false\n })\n }\n const requestCloseFromAnotherTooltip = () => {\n if (!isOpen()) return\n\n // Another trigger is an explicit handoff, even when a focused tooltip has\n // a pending pointer-close intent that would otherwise suppress Kobalte's\n // close callback. Route the request through the same controlled/uncontrolled\n // state contract as Kobalte and ignore its duplicate callback for this turn.\n ignoreDuplicateClose = true\n queueMicrotask(() => {\n ignoreDuplicateClose = false\n })\n onOpenChange(false, 'handoff')\n }\n const interaction: TooltipInteraction = {\n id,\n trigger,\n setTrigger,\n isOpen,\n isDisabled: () => local.disabled ?? false,\n isTriggerFocused: () =>\n Boolean(trigger() && typeof document !== 'undefined' && trigger() === document.activeElement),\n markOpenIntent: () => {\n clearPointerCloseIntent()\n pendingTooltipOpenId = id\n // A focused tooltip ignores ordinary pointer movement, but entering or\n // focusing another tooltip is an explicit transfer.\n for (const openInteraction of openTooltipInteractions) {\n if (openInteraction.id !== id) openInteraction.requestCloseFromAnotherTooltip()\n }\n },\n clearOpenIntent: () => clearPendingTooltipOpen(id),\n requestCloseFromAnotherTooltip,\n markPointerCloseIntent,\n clearPointerCloseIntent,\n markCloseIntent,\n }\n registerTooltipInteraction(interaction)\n onCleanup(() => {\n clearPointerCloseIntent()\n ignoreDuplicateClose = false\n })\n if (isOpen()) setTooltipInteractionOpen(interaction, true)\n createEffect(() => setTooltipInteractionOpen(interaction, isOpen()))\n onOpenChange = (next: boolean, source) => {\n if (!next && source !== 'handoff' && ignoreDuplicateClose) return\n\n if (next) {\n clearPendingTooltipOpen(id)\n clearPointerCloseIntent()\n // Install this capture listener before Kobalte's open-state effect adds\n // its scroll listener later in the same update.\n setTooltipInteractionOpen(interaction, true)\n } else {\n const focusedTrigger = interaction.isTriggerFocused()\n const anotherTooltipOpening =\n pendingTooltipOpenId !== undefined && pendingTooltipOpenId !== id\n const pointerClosePending = Date.now() <= pointerCloseIntentUntil\n if (\n source !== 'handoff' &&\n focusedTrigger &&\n pointerClosePending &&\n !closeIntent &&\n !anotherTooltipOpening\n ) {\n clearPointerCloseIntent()\n return\n }\n closeIntent = false\n clearPointerCloseIntent()\n clearPendingTooltipOpen(id)\n }\n\n if (!controlled()) setUncontrolledOpen(next)\n local.onOpenChange?.(next)\n if (next) {\n // A controlled parent can reject the open request without changing its\n // signal, so the effect above would not rerun to release this listener.\n queueMicrotask(() => {\n if (!isOpen()) setTooltipInteractionOpen(interaction, false)\n })\n }\n }\n\n // Kobalte dismisses on Escape only when its content owns the top-most\n // layer, and a handoff keeps the previous tooltip's content mounted while\n // it exits — swallowing the key for the tooltip that just took over.\n // Listening on document (capture) closes this tooltip first; the layer's\n // own handler still runs for anything stacked above it.\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.key !== 'Escape') return\n markCloseIntent()\n onOpenChange(false)\n }\n createEffect(() => {\n if (isServer || !isOpen()) return\n document.addEventListener('keydown', handleKeyDown, true)\n onCleanup(() => document.removeEventListener('keydown', handleKeyDown, true))\n })\n\n return (\n <TooltipInteractionContext.Provider value={interaction}>\n <KobalteTooltip\n open={isOpen()}\n onOpenChange={onOpenChange}\n disabled={local.disabled}\n openDelay={props.openDelay ?? timing.openDelay}\n closeDelay={props.closeDelay ?? timing.closeDelay}\n skipDelayDuration={props.skipDelayDuration ?? timing.skipDelayDuration}\n {...rest}\n />\n </TooltipInteractionContext.Provider>\n )\n}\n\nexport function TooltipTrigger(props: ComponentProps<typeof KobalteTooltip.Trigger>) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'ref',\n 'onFocus',\n 'onBlur',\n 'onPointerEnter',\n 'onPointerLeave',\n 'onClick',\n ])\n\n return (\n <KobalteTooltip.Trigger\n {...rest}\n ref={(element) => {\n interaction?.setTrigger(element)\n if (typeof local.ref === 'function') local.ref(element)\n }}\n onFocus={(event) => {\n callHandler(local.onFocus, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onBlur={(event) => {\n callHandler(local.onBlur, event)\n interaction?.clearOpenIntent()\n interaction?.markCloseIntent()\n }}\n onPointerEnter={(event) => {\n callHandler(local.onPointerEnter, event)\n if (!event.defaultPrevented && !interaction?.isDisabled()) interaction?.markOpenIntent()\n }}\n onPointerLeave={(event) => {\n callHandler(local.onPointerLeave, event)\n interaction?.clearOpenIntent()\n interaction?.markPointerCloseIntent()\n }}\n onClick={(event) => {\n callHandler(local.onClick, event)\n interaction?.markCloseIntent()\n }}\n />\n )\n}\n\nexport type TooltipContentProps = ComponentProps<typeof KobalteTooltip.Content> & {\n /**\n * A leading icon, repeating the trigger's glyph inside the tip — the side\n * rail's icon+label treatment, offered so a toolbar or rail tooltip does not\n * have to hand-roll it. Decorative by contract: the tip is `aria-hidden`\n * while closed and never the accessible name, so the icon must not be the\n * only carrier of meaning. Size it by leaving the svg bare; the slot fixes\n * it to the system's control size.\n */\n icon?: JSX.Element\n}\n\nexport function TooltipContent(props: TooltipContentProps) {\n const interaction = useContext(TooltipInteractionContext)\n const [local, rest] = splitProps(props, [\n 'class',\n 'children',\n 'icon',\n 'aria-hidden',\n 'onEscapeKeyDown',\n 'onPointerDownOutside',\n ])\n const context = useTooltipContext()\n const escapeTarget = useContext(TooltipEscapeTargetContext)\n\n // Kobalte keeps force-mounted and exiting content present after close. Hide\n // that retained tooltip from assistive technology until it opens again.\n const icon = resolveChildren(() => local.icon)\n return (\n <KobalteTooltip.Portal>\n <KobalteTooltip.Content\n /* The slot is what base.css's pointer-transparency rule keys on; every\n tip carries it, so no consumer has to remember to pass it. */\n data-slot=\"tooltip-content\"\n class={cn(\n tooltipTip,\n // The max width is a token, not a fixed measure: it has to fall\n // behind the viewport at large root font sizes or the tip — which\n // Kobalte can shift but never shrink — forces a horizontal scroll.\n 'z-(--z-tooltip) w-fit max-w-(--tooltip-max-width) px-3 py-1.5',\n 'origin-(--kb-tooltip-content-transform-origin) text-balance',\n tooltipMotion,\n // An icon+label tip is one row that reads as a unit, so the label\n // never wraps under the glyph.\n { 'flex items-center gap-2 whitespace-nowrap': !!icon() },\n local.class\n )}\n // A tooltip is never interactive: the content is plain text, and the\n // placement draws the tip below its action — where a hit-testing tip\n // would hold the next control hostage, open or departing. Kobalte\n // inlines pointer-events auto, so this is forced after its merge; the\n // pointer belongs to the control underneath.\n style={{ 'pointer-events': 'none' }}\n aria-hidden={context.isOpen() ? local['aria-hidden'] : true}\n onEscapeKeyDown={(event) => {\n local.onEscapeKeyDown?.(event)\n if (event.defaultPrevented) return\n interaction?.markCloseIntent()\n const layer = escapeTarget?.element()\n if (layer && document.activeElement?.closest(ESCAPE_LAYER_SELECTOR) === layer)\n escapeTarget?.dismiss(event)\n }}\n onPointerDownOutside={(event) => {\n local.onPointerDownOutside?.(event)\n if (!event.defaultPrevented) interaction?.markCloseIntent()\n }}\n // A tooltip opened from inside a modal dialog is part of that dialog's\n // surface, so it carries the same top-layer exemption as a menu or a\n // popover — without it the dialog's hide-outside observer aria-hides\n // the tip while it is on screen.\n {...topLayerProps}\n {...rest}\n >\n <Show when={icon()}>\n {(iconSlot) => (\n <span\n data-slot=\"tooltip-icon\"\n aria-hidden=\"true\"\n class=\"flex size-4 shrink-0 items-center justify-center [&_svg]:size-4\"\n >\n {iconSlot()}\n </span>\n )}\n </Show>\n {local.children}\n </KobalteTooltip.Content>\n </KobalteTooltip.Portal>\n )\n}\n"],"mappings":";;;;;;;;;AAkCA,IAAMwB,kBAAiC;;CAErCH,WAAW;;CAEXC,YAAY;;;;;;CAMZC,mBAAmB;AACrB;AAEA,IAAME,uBAAuBpB,cAA6BmB,eAAe;;;;;;AAOzE,IAAME,gCAAgC;;;;;;;;;;;;;AActC,IAAaC,6BAA6BtB,cAGvC;;AAGH,IAAM0B,wBAAwB;AAiB9B,IAAMa,4BAA4BvC,cAAkC;AACpE,IAAMwC,0CAA0B,IAAIC,IAAwB;AAC5D,IAAIC;AACJ,IAAIC,gCAAgC;AAEpC,SAASC,wBAAwBjB,IAAY;CAC3C,IAAIe,yBAAyBf,IAAIe,uBAAuBG,KAAAA;AAC1D;AAEA,SAASC,6BAA6BrB,OAAcG,SAAsB;CACxE,MAAMmB,SAAStB,MAAMsB;CACrB,OAAOA,WAAWC,UAAWD,kBAAkBE,QAAQF,OAAOG,SAAStB,OAAO;AAChF;AAEA,SAASuB,oBAAoB1B,OAAc;C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GwC,MAAM,iBAAiB;GAAI;GAC3D8C,kBAAkB3F,UAAU;IAC1B6C,MAAM8C,kBAAkB3F,KAAK;IAC7B,IAAIA,MAAM6E,kBAAkB;IAC5BlD,aAAad,gBAAgB;IAC7B,MAAM+E,QAAQN,cAAcxF,QAAQ;IACpC,IAAI8F,SAAS1D,SAASgC,eAAe2B,QAAQ5F,qBAAqB,MAAM2F,OACtEN,cAAcvF,QAAQC,KAAK;GAC/B;GACA8F,uBAAuB9F,UAAU;IAC/B6C,MAAMiD,uBAAuB9F,KAAK;IAClC,IAAI,CAACA,MAAM6E,kBAAkBlD,aAAad,gBAAgB;GAC5D;EAAC,GAKG1B,eACA2D,MAAI,EAAA,IAAAzE,WAAA;GAAA,OAAA,CAAAoE,gBAEP7D,MAAI;IAAA,IAACmH,OAAI;KAAA,OAAEZ,KAAK;IAAC;IAAA9G,WACd2H,oBAAQ;KAAA,IAAAC,OAAAC,OAAA;KAAAC,OAAAF,MAMLD,QAAQ;KAAA,OAAAC;IAAA,EAAA,CAAA;GAEZ,CAAA,GAAAP,WAEF7C,MAAMxE,QAAQ,CAAA;EAAA,EAAA,CAAA,CAAA;CAAA,EAAA,CAAA;AAIvB"}
package/dist/index.d.ts CHANGED
@@ -113,6 +113,7 @@ export * from './components/composites/file-tree';
113
113
  export * from './components/composites/inline-citation';
114
114
  export * from './components/composites/model-selector';
115
115
  export * from './components/composites/plan';
116
+ export * from './components/composites/prompt-input';
116
117
  export * from './components/composites/queue';
117
118
  export * from './components/composites/reasoning';
118
119
  export * from './components/composites/sources';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,cAAc,2BAA2B,CAAA;AACzC,cAAc,uBAAuB,CAAA;AACrC,cAAc,8BAA8B,CAAA;AAC5C,cAAc,4BAA4B,CAAA;AAC1C,cAAc,oCAAoC,CAAA;AAClD,cAAc,8BAA8B,CAAA;AA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E,iBAAiB,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAC3F,OAAO,EACL,aAAa,EACb,SAAS,EACT,WAAW,EACX,aAAa,EACb,YAAY,EACZ,eAAe,EACf,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,gBAAgB,EAChB,wBAAwB,EACxB,YAAY,EACZ,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,eAAe,EACpB,KAAK,SAAS,GACf,MAAM,cAAc,CAAA"}
package/dist/index.js CHANGED
@@ -47,7 +47,7 @@ import { Input } from "./components/ui/input/input.js";
47
47
  import { NumberField } from "./components/ui/field/number-field.js";
48
48
  import { HoverCard, HoverCardContent, HoverCardTrigger } from "./components/ui/hover-card/hover-card.js";
49
49
  import { Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, itemVariants } from "./components/ui/item/item.js";
50
- import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText } from "./components/ui/input-group/input-group.js";
50
+ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea } from "./components/ui/input-group/input-group.js";
51
51
  import { SecretInputGroup } from "./components/ui/input-group/secret-input-group.js";
52
52
  import { InputOtp, InputOtpCaret } from "./components/ui/input-otp/input-otp.js";
53
53
  import { Kbd, KbdChord, KbdGroup, kbdChordKeys, kbdGroupVariants, kbdVariants } from "./components/ui/kbd/kbd.js";
@@ -55,7 +55,7 @@ import { platformModifierKey, searchShortcutKeyshortcuts, searchShortcutLabel }
55
55
  import { Marker, markerVariants } from "./components/ui/marker/marker.js";
56
56
  import { Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger } from "./components/ui/menubar/menubar.js";
57
57
  import { parseInline, parseMessageText, parseMessageTextIncremental } from "./components/ui/message/parse-message-text.js";
58
- import { Message, MessageActions, MessageContent, MessageFooter, MessageHeader, MessageText } from "./components/ui/message/message.js";
58
+ import { Message, MessageAction, MessageActions, MessageContent, MessageCopyAction, MessageFooter, MessageHeader, MessageText } from "./components/ui/message/message.js";
59
59
  import { placeCitationMarkers } from "./components/ui/message/cite-ranges.js";
60
60
  import { ModalDialog } from "./components/ui/modal-dialog/modal-dialog.js";
61
61
  import { NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport } from "./components/ui/navigation-menu/navigation-menu.js";
@@ -107,6 +107,7 @@ import { StatusBar, StatusBarItem, StatusBarSpacer } from "./components/layout/s
107
107
  import { TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle } from "./components/layout/top-bar/top-bar.js";
108
108
  import { ShellTopBar } from "./components/layout/shell-top-bar/shell-top-bar.js";
109
109
  import { ShellRail } from "./components/layout/shell-rail/shell-rail.js";
110
+ import { PromptInput, PromptInputBody, PromptInputButton, PromptInputControl, PromptInputFooter, PromptInputHeader, PromptInputSubmit, PromptInputTextarea, PromptInputTools } from "./components/composites/prompt-input/prompt-input.js";
110
111
  import { BusySendButton } from "./components/conversation/busy-send-button.js";
111
112
  import { ChatComposer } from "./components/conversation/chat-composer.js";
112
113
  import { ConversationAvatar } from "./components/conversation/conversation-avatar.js";
@@ -207,4 +208,4 @@ import { isShellIconKey, resolveShellIcon, shellIconEntries, shellIconLabel } fr
207
208
  import { IconPicker, IconPickerDropdown } from "./components/composites/icon-picker/icon-picker.js";
208
209
  import { formatBytes, formatReleaseDate, plainTextFromMarkdown } from "./lib/version-notes.js";
209
210
  import { allTokens, colorTokens, densityTokens, designTokens, elevationTokens, motionTokens, radiusTokens, typographyTokens, undocumentedTokenAliases, zIndexTokens } from "./lib/tokens.js";
210
- export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, AccentPicker, AccentSwatchGroups, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, SettingsRow as AppearanceSettingsRow, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, LazyTooltip, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageActions, MessageBody, MessageComposer, MessageContent, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelPane, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow$1 as SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceError, TraceLine, TraceMark, TranscriptComposition, Tree, TreeRow, TreeRowActions, TreeStickyHeader, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WORK_STATUS_LABELS, WORK_TRACE_STATUS, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampSplitRatio, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createDeferredTooltip, createLayoutState, createPoll, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, safeScriptStringLiteral as inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isCustomAccentValue, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseMessageTextIncremental, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, treeStickyAncestors, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
211
+ export { ANSI_MAX_LINE_LENGTH, ANSI_RETAIN_LINES, APPEARANCE_EDITOR_FONT_AXES, APPEARANCE_EDITOR_FONT_SIZE_MAX, APPEARANCE_EDITOR_FONT_SIZE_MIN, AboutDialog, AccentPicker, AccentSwatchGroups, Accordion, AccordionContent, AccordionItem, AccordionTrigger, AccountMenu, ActionButton, Alert, AlertAction, AlertDescription, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, AlertTitle, AnnotationSurface, AppShell, AppShellBody, AppShellContent, AppShellMain, AppearanceEditor, AppearanceEditorActions, AppearanceFontSettingsGroup, AppearancePanel, AppearancePopover, SettingsRow as AppearanceSettingsRow, AspectRatio, Attachment, AttachmentCard, AttachmentList, Avatar, AvatarFallback, AvatarImage, Badge, Board, BoardCardBody, BoardCardTitle, BoardCardTrigger, Breadcrumb, BreadcrumbEllipsis, BreadcrumbItem, BreadcrumbLink, BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, Bubble, BusySendButton, Button, ButtonGroup, ButtonGroupSeparator, ButtonGroupText, CHAIN_OF_THOUGHT_STATUS_LABELS, CODE_BLOCK_LINE_LIMIT, CalendarSurface, Callout, CalloutTitle, Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, CatalogBrowser, CatalogDetail, CatalogDetailSection, ChainOfThought, ChainOfThoughtResult, ChainOfThoughtResults, ChainOfThoughtStep, Chat, ChatComposer, ChatEmpty, ChatHeader, ChatNotice, Checkbox, CheckboxDescription, CheckboxLabel, Checkpoint, CodeBlock, Collapsible, CollapsibleContent, CollapsibleTrigger, Combobox, ComboboxClear, ComboboxContent, ComboboxControl, ComboboxInput, ComboboxItem, ComboboxSection, ComboboxTrigger, Command, CommandDialog, CommandEmpty, CommandGroup, CommandHint, CommandInput, CommandItem, CommandList, CommandLoading, CommandSeparator, CommandShortcut, CommandStatus, ComposerAttachmentButton, ComposerHint, ComposerMenu, ComposerMenuItem, Confirmation, Context, ContextMenu, ContextMenuCheckboxItem, ContextMenuContent, ContextMenuGroup, ContextMenuItem, ContextMenuLabel, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuSeparator, ContextMenuSub, ContextMenuSubContent, ContextMenuSubTrigger, ContextMenuTrigger, ContextualSidebar, ConversationAvatar, ConversationPane, ConversationSurface, DEFAULT_APPEARANCE_EDITOR_FONT_SETTINGS, DatePicker, DetailPanel, DetailPanelBody, DetailPanelField, DetailPanelHeader, DetailPanelSection, Dialog, DialogClose, DialogCloseButton, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger, DiffBlock, DiffSummary, Drawer, DrawerBody, DrawerCloseButton, DrawerContent, DrawerDescription, DrawerFooter, DrawerHeader, DrawerOverlay, DrawerTitle, DrawerTrigger, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuGroup, DropdownMenuItem, DropdownMenuLabel, DropdownMenuPortal, DropdownMenuRadioGroup, DropdownMenuRadioItem, DropdownMenuSeparator, DropdownMenuShortcut, DropdownMenuSub, DropdownMenuSubContent, DropdownMenuSubTrigger, DropdownMenuTrigger, Empty, EmptyContent, EmptyDescription, EmptyHeader, EmptyMedia, EmptyState, EmptyTitle, EntityIcon, FILE_CHANGE_LABELS, FILE_TREE_AUTO_EXPAND_LIMIT, FILE_TREE_MAX_DEPTH, FILE_TREE_MAX_ROWS, FLOATING_PREVIEW_CORNER_RADIUS, FLOATING_PREVIEW_EDGE_GAP, Field, FieldDescription, FieldError, FieldGroup, FieldInput, FieldLabel, FieldLegend, FieldSeparator, FieldSet, FieldTextArea, FileTree, FloatingPreview, FormField, Heading, HelpCenter, HoverCard, HoverCardContent, HoverCardTrigger, IconPicker, IconPickerDropdown, InlineCitation, InlineCode, Input, InputControl, InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput, InputGroupText, InputGroupTextarea, InputOtp, InputOtpCaret, Item, ItemDescription, ItemEmpty, ItemGroup, ItemGroupEntry, ItemTitle, Kbd, KbdChord, KbdGroup, Label, LazyTooltip, ListGroup, ListRow, ListRowControl, MARK_IMAGE_MAX_DATA_URL_LENGTH, MARK_IMAGE_MAX_SOURCE_BYTES, MARK_IMAGE_SIZE, MAX_LAYOUT_DEPTH, MAX_LAYOUT_LEAVES, MAX_SPLIT_RATIO, MIN_SPLIT_RATIO, MODEL_SEARCH_THRESHOLD, MarkImageError, Marker, Menubar, MenubarCheckboxItem, MenubarContent, MenubarGroup, MenubarItem, MenubarLabel, MenubarMenu, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator, MenubarSub, MenubarSubContent, MenubarSubTrigger, MenubarTrigger, Message, MessageAction, MessageActions, MessageBody, MessageComposer, MessageContent, MessageCopyAction, MessageDayDivider, MessageFooter, MessageGroup, MessageHeader, MessageRow, MessageScroller, MessageText, ModalDialog, ModelSelector, Motion, NativeSelect, NavigationMenu, NavigationMenuContent, NavigationMenuGroup, NavigationMenuGroupLabel, NavigationMenuItem, NavigationMenuMenu, NavigationMenuSeparator, NavigationMenuTrigger, NavigationMenuViewport, NumberField, OrbitItem, OrbitLayout, PASTE_THRESHOLD_CHARS, PASTE_THRESHOLD_LINES, PASTE_TOKEN_REGEX, Page, PageHeader, PageHeaderActions, PageHeaderContent, PageHeaderDescription, PageHeaderTitle, PageSection, Pagination, PaginationEllipsis, PaginationItem, PaginationNext, PaginationPrevious, PalettePreview, Panel, PanelActions, PanelBody, PanelCard, PanelDescription, PanelFooter, PanelHeader, PanelPlaceholder, PanelTitle, PanelToolbar, PixelPane, PixelResizeHandle, Plan, Popover, PopoverAnchor, PopoverCloseButton, PopoverContent, PopoverDescription, PopoverTitle, PopoverTrigger, Presence, Progress, PromptInput, PromptInputBody, PromptInputButton, PromptInputControl, PromptInputFooter, PromptInputHeader, PromptInputSubmit, PromptInputTextarea, PromptInputTools, PropertyList, PropertyRow, PropertyTerm, PropertyValue, Questionnaire, Queue, QueueFollowUps, REDUCED_TRANSPARENCY_QUERY, RadioGroup, RadioGroupItem, Reasoning, ResizableHandle, ResizablePanel, ResizablePanelGroup, SOURCE_SNIPPET_LIMIT, SOURCE_TITLE_LIMIT, STACK_MAX_LINES, STACK_TRACE_MAX_BLOCKS, SceneControls, ScrollArea, SecretInputGroup, Select, SelectChevronsUpDown, SelectContent, SelectItem, SelectLabel, SelectSection, SelectTrigger, SelectValue, Separator, SettingsField, SettingsLayout, SettingsNavigation, SettingsPage, SettingsRow$1 as SettingsRow, SettingsSection, Sheet, SheetBody, SheetCloseButton, SheetContent, SheetDescription, SheetFooter, SheetHeader, SheetTitle, SheetTrigger, ShellRail, ShellTopBar, SideRail, SideRailButton, SideRailContent, SideRailFooter, SideRailHeader, SideRailItem, SideRailSection, SidebarNav, SidebarNavButton, SidebarNavContent, SidebarNavFooter, SidebarNavHeader, SidebarNavItem, SidebarNavLabel, SidebarNavResizeHandle, SidebarNavRow, SidebarNavSection, SidebarNavTitle, Skeleton, SkipLink, Slider, Sources, Spinner, SplitLayout, StackTrace, Stat, StatGroup, StatusBar, StatusBarItem, StatusBarSpacer, StatusChip, StatusList, Subagent, Suggestion, Suggestions, Switch, SwitchDescription, SwitchLabel, TALL_CODE_BLOCK_PX, TASK_ITEM_STATUS_LABELS, TERMINAL_MAX_LINES, TEST_RESULTS_LIST_LIMIT, TOOL_STATUS_LABELS, TOOL_VALUE_MAX_CHARS, TRACE_STATUS_LABELS, Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableNumericCell, TableRow, Tabs, TabsContent, TabsList, TabsTrigger, Task, TaskItemList, TaskItemRow, Terminal, TestResults, Text, TextLink, Textarea, ThemeMiniature, ThemeMiniatureSplit, ThemeModeToggle, ThemePicker, ThemePreview, ThemeProvider, ThemeSwatch, ThemeToggle, ThreadPanel, Toaster, Toggle, ToggleGroup, ToggleGroupItem, Tool, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger, TopBar, TopBarBreadcrumb, TopBarPill, TopBarSearch, TopBarSection, TopBarTitle, Trace, TraceDetail, TraceError, TraceLine, TraceMark, TranscriptComposition, Tree, TreeRow, TreeRowActions, TreeStickyHeader, UpdateChannelControl, UpdateDialog, ValueCombobox, VirtualWindow, WORK_STATUS_LABELS, WORK_TRACE_STATUS, WorkspaceMark, WorkspaceReorderDialog, WorkspaceSwitcher, accentPresets, alertVariants, allTokens, ansi256ToColor, ansiLineText, appearancePreviewThemes, applyAppearanceFontSettings, badgeVariants, boardCardTitleVariants, boundText, breakdownRows, bubbleVariants, buildFileTree, builtinThemes, buttonVariants, calloutVariants, captureAnchor, cardVariants, centredSquare, chatNoticeVariants, checkMarkImageFile, checkpointLabel, checkpointStatus, citationLabel, citationName, clampFloatingPreviewPosition, clampSplitRatio, clampWindow, classifyFrame, closePane, cn, colorTokens, computeLayoutFrames, confirmationOutcome, contextLabel, contextLevel, contextLevelWord, contextPercent, contextShort, contrastRatio, controlInteractive, controlSize, controlSizeIcon, controlSizes, countChanges, countLeaves, countLines, createAnsiParser, createAppMenuItems, createDeferredTooltip, createLayoutState, createPoll, createVersionedPersistence, cva, decisionReason, dedentLines, defaultDarkThemeId, defaultLightThemeId, defaultPreferenceStorage, defaultThemeSelection, densityTokens, describeChanges, describeCount, describeFrameGroup, designTokens, diffLineVariants, diffStats, diffTargetPath, editorPaletteFor, elevationTokens, entityIconVariants, expandAll, findModel, findTokenRanges, firstFailureKey, flattenFileTree, focusPane, fontOptions, fontSettingsBootstrapScript, fontZoomShortcut, formatAttachmentSize, formatBytes, formatCost, formatDuration, formatExact, formatReleaseDate, formatDuration$1 as formatTestDuration, formatToken, formatTokens, formatToolValue, frameLocation, groupModels, groupStackEntries, hasContextFigures, headingElement, headingVariants, indexFileTree, initialExpanded, initialsFrom, safeScriptStringLiteral as inlineScriptLiteral, isAwaitingAnswer, isCustomAccent, isCustomAccentValue, isFailedExit, isFigure, isMarkImageDataUrl, isPasteBlock, isPlainStyle, isQuestionAnswered, isShellIconKey, isThemeAccentId, itemVariants, kbdChordKeys, kbdGroupVariants, kbdVariants, keyedRows, layoutDepth, listLeaves, listedCounts, localStoragePersistence, markImageFromFile, markImageProblemCopy, markerVariants, messageCitations, modelSearchValue, monogram, motionTokens, movePane, moveTarget, moveWorkspace, nearestAnsiColor, needsSearch, neighborLeaf, nextCitationMode, nextSeq, normalizeAppearanceEditorFontSettings, normalizeAppearanceEditorFontSize, normalizeCustomAccent, normalizeEfforts, normalizeLayout, normalizePath, normalizeSurface, paintAccentRoles, parseAnsi, parseDiff, parseInline, parseMessageText, parseMessageTextIncremental, parseStackTrace, partitionQueue, placeCitationMarkers, plainTextFromMarkdown, platformModifierKey, pruneBlocks, quarantineRecord, radiusTokens, readLegacyValue, readVersionedRecord, reasoningTitle, recollapsePastes, reconcileCounts, recoveryEnvelope, recoveryKeyFor, remapCarriedBlocks, resizeFloatingPreview, resizeSplit, resolveAccentPreset, resolveAccentRoles, resolveColors, resolveEffort, resolveFloatingPreviewFrame, resolveShellIcon, resolveSurface, resolveSurfaceState, resolveVariant, resolvedDensity, restoreAnchor, restoreControl, restoreDialogCopy, revealInWindow, safeHref, safePreviewSrc, safeSourceUrl, searchShortcutKeyshortcuts, searchShortcutLabel, settleDecision, sheetVariants, shellIconEntries, shellIconLabel, shouldCollapse, sidebarNavItemClass, sidebarNavItemStateClass, sourceHost, sourceTitle, sourcesLabel, splitLocation, splitPane, splitPaneBalanced, statusDotVariants, stepAppearanceFontSizes, stepCountLabel, stripTrailingBlankLines, suiteKey, suiteState, surfaceAlpha, surfaceInteractive, swapPanes, taskProgress, taskProgressLabel, terminalCssVariables, terminalStatusLabel, testKey, textElement, textVariants, textareaVariants, themeAccentsFor, themeById, themeCssVariables, themeFamilies, themeRecordById, themeRecords, themeScript, themeSurfaces, themesForAppearance, toast, toaster, toggleVariants, tokenRangeAt, tokensAsHex, transcriptDisclosureKey, treeStickyAncestors, typeaheadIndex, typographyTokens, undoClosePane, undocumentedTokenAliases, useOptionalTheme, useSideRail, useTheme, validateTheme, validateThemeRegistry, variantFromRecord, withAccent, wrapIndex, writeClipboardText, writeVersionedRecord, zIndexTokens };
@@ -12,7 +12,8 @@ import type { JSX } from 'solid-js';
12
12
  * drew, so the markup (attributes, class names, path keys) stays exactly
13
13
  * lucide's. Props that change the drawing (`size`, `color`, `strokeWidth`,
14
14
  * `absoluteStrokeWidth`) or a `LucideProvider` are not supported: those callers
15
- * keep the lucide component. On the server the lucide component renders as is.
15
+ * keep the lucide component. On the server, and while the client hydrates, the
16
+ * lucide component renders as is.
16
17
  */
17
18
  export declare function fastIcon<T extends (props: never) => JSX.Element>(LucideIcon: T): T;
18
19
  //# sourceMappingURL=fast-icon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"fast-icon.d.ts","sourceRoot":"","sources":["../../src/lib/fast-icon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAoBnC;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CA+BlF"}
1
+ {"version":3,"file":"fast-icon.d.ts","sourceRoot":"","sources":["../../src/lib/fast-icon.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAoBnC;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,QAAQ,CAAC,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,KAAK,GAAG,CAAC,OAAO,EAAE,UAAU,EAAE,CAAC,GAAG,CAAC,CAqClF"}
@@ -1,5 +1,5 @@
1
1
  import { isServer, spread } from "solid-js/web";
2
- import { createRoot, mergeProps as mergeProps$1, splitProps } from "solid-js";
2
+ import { createRoot, mergeProps as mergeProps$1, sharedConfig, splitProps } from "solid-js";
3
3
  // src/lib/fast-icon.ts
4
4
  var DRAWING = [
5
5
  "size",
@@ -25,12 +25,13 @@ var A11Y = /^(aria-|role$|title$)/;
25
25
  * drew, so the markup (attributes, class names, path keys) stays exactly
26
26
  * lucide's. Props that change the drawing (`size`, `color`, `strokeWidth`,
27
27
  * `absoluteStrokeWidth`) or a `LucideProvider` are not supported: those callers
28
- * keep the lucide component. On the server the lucide component renders as is.
28
+ * keep the lucide component. On the server, and while the client hydrates, the
29
+ * lucide component renders as is.
29
30
  */
30
31
  function fastIcon(LucideIcon) {
31
32
  const Icon = LucideIcon;
32
33
  const Fast = (props) => {
33
- if (isServer || props.children !== void 0 || DRAWING.some((key) => key in props)) return Icon(props);
34
+ if (isServer || sharedConfig.context || props.children !== void 0 || DRAWING.some((key) => key in props)) return Icon(props);
34
35
  const template = capture(Icon);
35
36
  const [local, rest] = splitProps(props, ["class"]);
36
37
  const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
@@ -1 +1 @@
1
- {"version":3,"file":"fast-icon.js","names":["mergeProps"],"sources":["../../src/lib/fast-icon.ts"],"sourcesContent":["import type { JSX } from 'solid-js'\nimport { createRoot, mergeProps, splitProps } from 'solid-js'\nimport { isServer, spread } from 'solid-js/web'\n\ntype IconComponent = (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element\n// lucide's own drawing props: an icon given one keeps lucide's component.\nconst DRAWING = [\n 'size',\n 'color',\n 'strokeWidth',\n 'absoluteStrokeWidth',\n 'nonScalingStroke',\n 'width',\n 'height',\n]\ntype Captured = { attributes: [string, string][]; className: string; body: DocumentFragment }\n\nconst captured = new WeakMap<IconComponent, Captured>()\nconst A11Y = /^(aria-|role$|title$)/\n\n/**\n * The same lucide icon, built by cloning a template instead of by components.\n *\n * lucide-solid builds every icon as a `<For>` of `<Dynamic>` children, one\n * component and one spread effect per path. A plain six-path icon cost as much\n * to mount as a Button, and a transcript row spent a quarter of its mount time\n * in its avatar's icon. The paths never change, so they are drawn once per icon\n * and cloned after that; only the outer `<svg>` takes props.\n *\n * The first instance renders the lucide component itself and records what it\n * drew, so the markup (attributes, class names, path keys) stays exactly\n * lucide's. Props that change the drawing (`size`, `color`, `strokeWidth`,\n * `absoluteStrokeWidth`) or a `LucideProvider` are not supported: those callers\n * keep the lucide component. On the server the lucide component renders as is.\n */\nexport function fastIcon<T extends (props: never) => JSX.Element>(LucideIcon: T): T {\n const Icon = LucideIcon as unknown as IconComponent\n const Fast = (props: JSX.SvgSVGAttributes<SVGSVGElement>) => {\n // Children (a <title>), drawing props and the server keep lucide's component.\n if (isServer || props.children !== undefined || DRAWING.some((key) => key in props))\n return Icon(props)\n const template = capture(Icon)\n const [local, rest] = splitProps(props, ['class'])\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')\n let labelled = false\n for (const key in rest) if (A11Y.test(key)) labelled = true\n for (const [name, value] of template.attributes) svg.setAttribute(name, value)\n svg.append(template.body.cloneNode(true))\n // In lucide's order: its attributes, the class, aria-hidden, then the caller's.\n spread(\n svg,\n mergeProps(\n {\n get class() {\n return local.class ? `${template.className} ${local.class}` : template.className\n },\n ...(labelled ? {} : { 'aria-hidden': 'true' }),\n },\n rest\n ) as never,\n true,\n true\n )\n return svg as unknown as JSX.Element\n }\n return Fast as unknown as T\n}\n\nfunction capture(Icon: IconComponent): Captured {\n const known = captured.get(Icon)\n if (known) return known\n const svg = createRoot((dispose) => {\n const element = Icon({}) as unknown as SVGSVGElement\n dispose()\n return element\n })\n const attributes: [string, string][] = []\n let className = ''\n for (const attribute of Array.from(svg.attributes)) {\n if (attribute.name === 'class') className = attribute.value\n else if (attribute.name !== 'aria-hidden') attributes.push([attribute.name, attribute.value])\n }\n const body = document.createDocumentFragment()\n for (const child of Array.from(svg.childNodes)) body.append(child.cloneNode(true))\n const result = { attributes, className, body }\n captured.set(Icon, result)\n return result\n}\n"],"mappings":";;;AAMA,IAAM,UAAU;CACd;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,IAAM,2BAAW,IAAI,QAAiC;AACtD,IAAM,OAAO;;;;;;;;;;;;;;;;AAiBb,SAAgB,SAAkD,YAAkB;CAClF,MAAM,OAAO;CACb,MAAM,QAAQ,UAA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W;CAAK;CAC7C,SAAS,IAAI,MAAM,MAAM;CACzB,OAAO;AACT"}
1
+ {"version":3,"file":"fast-icon.js","names":["mergeProps"],"sources":["../../src/lib/fast-icon.ts"],"sourcesContent":["import type { JSX } from 'solid-js'\nimport { createRoot, mergeProps, sharedConfig, splitProps } from 'solid-js'\nimport { isServer, spread } from 'solid-js/web'\n\ntype IconComponent = (props: JSX.SvgSVGAttributes<SVGSVGElement>) => JSX.Element\n// lucide's own drawing props: an icon given one keeps lucide's component.\nconst DRAWING = [\n 'size',\n 'color',\n 'strokeWidth',\n 'absoluteStrokeWidth',\n 'nonScalingStroke',\n 'width',\n 'height',\n]\ntype Captured = { attributes: [string, string][]; className: string; body: DocumentFragment }\n\nconst captured = new WeakMap<IconComponent, Captured>()\nconst A11Y = /^(aria-|role$|title$)/\n\n/**\n * The same lucide icon, built by cloning a template instead of by components.\n *\n * lucide-solid builds every icon as a `<For>` of `<Dynamic>` children, one\n * component and one spread effect per path. A plain six-path icon cost as much\n * to mount as a Button, and a transcript row spent a quarter of its mount time\n * in its avatar's icon. The paths never change, so they are drawn once per icon\n * and cloned after that; only the outer `<svg>` takes props.\n *\n * The first instance renders the lucide component itself and records what it\n * drew, so the markup (attributes, class names, path keys) stays exactly\n * lucide's. Props that change the drawing (`size`, `color`, `strokeWidth`,\n * `absoluteStrokeWidth`) or a `LucideProvider` are not supported: those callers\n * keep the lucide component. On the server, and while the client hydrates, the\n * lucide component renders as is.\n */\nexport function fastIcon<T extends (props: never) => JSX.Element>(LucideIcon: T): T {\n const Icon = LucideIcon as unknown as IconComponent\n const Fast = (props: JSX.SvgSVGAttributes<SVGSVGElement>) => {\n // Children (a <title>), drawing props, the server and hydration keep lucide's\n // component: a hydrating icon must claim the server's nodes, not build its own.\n if (\n isServer ||\n sharedConfig.context ||\n props.children !== undefined ||\n DRAWING.some((key) => key in props)\n )\n return Icon(props)\n const template = capture(Icon)\n const [local, rest] = splitProps(props, ['class'])\n const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg')\n let labelled = false\n for (const key in rest) if (A11Y.test(key)) labelled = true\n for (const [name, value] of template.attributes) svg.setAttribute(name, value)\n svg.append(template.body.cloneNode(true))\n // In lucide's order: its attributes, the class, aria-hidden, then the caller's.\n spread(\n svg,\n mergeProps(\n {\n get class() {\n return local.class ? `${template.className} ${local.class}` : template.className\n },\n ...(labelled ? {} : { 'aria-hidden': 'true' }),\n },\n rest\n ) as never,\n true,\n true\n )\n return svg as unknown as JSX.Element\n }\n return Fast as unknown as T\n}\n\nfunction capture(Icon: IconComponent): Captured {\n const known = captured.get(Icon)\n if (known) return known\n const svg = createRoot((dispose) => {\n const element = Icon({}) as unknown as SVGSVGElement\n dispose()\n return element\n })\n const attributes: [string, string][] = []\n let className = ''\n for (const attribute of Array.from(svg.attributes)) {\n if (attribute.name === 'class') className = attribute.value\n else if (attribute.name !== 'aria-hidden') attributes.push([attribute.name, attribute.value])\n }\n const body = document.createDocumentFragment()\n for (const child of Array.from(svg.childNodes)) body.append(child.cloneNode(true))\n const result = { attributes, className, body }\n captured.set(Icon, result)\n return result\n}\n"],"mappings":";;;AAMA,IAAM,UAAU;CACd;CACA;CACA;CACA;CACA;CACA;CACA;AACF;AAGA,IAAM,2BAAW,IAAI,QAAiC;AACtD,IAAM,OAAO;;;;;;;;;;;;;;;;;AAkBb,SAAgB,SAAkD,YAAkB;CAClF,MAAM,OAAO;CACb,MAAM,QAAQ,UAA+C;EAG3D,IACE,YACA,aAAa,WACb,MAAM,aAAa,KAAA,KACnB,QAAQ,MAAM,QAAQ,OAAO,KAAK,GAElC,OAAO,KAAK,KAAK;EACnB,MAAM,WAAW,QAAQ,IAAI;EAC7B,MAAM,CAAC,OAAO,QAAQ,WAAW,OAAO,CAAC,OAAO,CAAC;EACjD,MAAM,MAAM,SAAS,gBAAgB,8BAA8B,KAAK;EACxE,IAAI,WAAW;EACf,KAAK,MAAM,OAAO,MAAM,IAAI,KAAK,KAAK,GAAG,GAAG,WAAW;EACvD,KAAK,MAAM,CAAC,MAAM,UAAU,SAAS,YAAY,IAAI,aAAa,MAAM,KAAK;EAC7E,IAAI,OAAO,SAAS,KAAK,UAAU,IAAI,CAAC;EAExC,OACE,KACAA,aACE;GACE,IAAI,QAAQ;IACV,OAAO,MAAM,QAAQ,GAAG,SAAS,UAAU,GAAG,MAAM,UAAU,SAAS;GACzE;GACA,GAAI,WAAW,CAAC,IAAI,EAAE,eAAe,OAAO;EAC9C,GACA,IACF,GACA,MACA,IACF;EACA,OAAO;CACT;CACA,OAAO;AACT;AAEA,SAAS,QAAQ,MAA+B;CAC9C,MAAM,QAAQ,SAAS,IAAI,IAAI;CAC/B,IAAI,OAAO,OAAO;CAClB,MAAM,MAAM,YAAY,YAAY;EAClC,MAAM,UAAU,KAAK,CAAC,CAAC;EACvB,QAAQ;EACR,OAAO;CACT,CAAC;CACD,MAAM,aAAiC,CAAC;CACxC,IAAI,YAAY;CAChB,KAAK,MAAM,aAAa,MAAM,KAAK,IAAI,UAAU,GAC/C,IAAI,UAAU,SAAS,SAAS,YAAY,UAAU;MACjD,IAAI,UAAU,SAAS,eAAe,WAAW,KAAK,CAAC,UAAU,MAAM,UAAU,KAAK,CAAC;CAE9F,MAAM,OAAO,SAAS,uBAAuB;CAC7C,KAAK,MAAM,SAAS,MAAM,KAAK,IAAI,UAAU,GAAG,KAAK,OAAO,MAAM,UAAU,IAAI,CAAC;CACjF,MAAM,SAAS;EAAE;EAAY;EAAW;CAAK;CAC7C,SAAS,IAAI,MAAM,MAAM;CACzB,OAAO;AACT"}
@@ -47,12 +47,12 @@ export declare const overlayDescription = "text-muted-foreground text-sm";
47
47
  /** The icon-only close in a dialog or sheet's top-end corner. */
48
48
  export declare const overlayCornerClose: string;
49
49
  /**
50
- * The tip: the card-toned bubble an explanation shows in. The side rail draws
51
- * it flush to a collapsed row and every floating tooltip composes the same
52
- * fill, edge, and type, so a control never explains itself in two visual
53
- * languages.
50
+ * The tip: shadcn's inverted chip, foreground on background, so an explanation
51
+ * never reads as a popover that could hold controls. The side rail draws it
52
+ * flush to a collapsed row and every floating tooltip composes the same fill
53
+ * and type, so a control never explains itself in two visual languages.
54
54
  */
55
- export declare const tooltipTip = "bg-card text-card-foreground rounded-md border border-border text-sm font-medium shadow-lg";
55
+ export declare const tooltipTip = "bg-foreground text-background rounded-md text-xs font-medium";
56
56
  /**
57
57
  * Entrance and exit motion, expressed as data-state classes.
58
58
  *
@@ -1 +1 @@
1
- {"version":3,"file":"overlay.d.ts","sourceRoot":"","sources":["../../src/lib/overlay.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,eAAe,CAAA;AAEtD;+EAC+E;AAC/E,eAAO,MAAM,cAAc,iFACqD,CAAA;AAEhF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa,4EACiD,CAAA;AAE3E;;;GAGG;AACH,eAAO,MAAM,YAAY,wDAAwD,CAAA;AAEjF,yEAAyE;AACzE,eAAO,MAAM,iBAAiB,6DAA6D,CAAA;AAE3F,gDAAgD;AAChD,eAAO,MAAM,YAAY,yFAC+D,CAAA;AAExF,+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,oGACoE,CAAA;AAEnG,gDAAgD;AAChD,eAAO,MAAM,aAAa,qCAAqC,CAAA;AAE/D,+FAA+F;AAC/F,eAAO,MAAM,aAAa,2DAA2D,CAAA;AAErF,2CAA2C;AAC3C,eAAO,MAAM,kBAAkB,kCAAkC,CAAA;AAEjE,iEAAiE;AACjE,eAAO,MAAM,kBAAkB,QAGkE,CAAA;AAEjG;;;;;GAKG;AACH,eAAO,MAAM,UAAU,+FACuE,CAAA;AAE9F;;;;;;;;GAQG;AACH,eAAO,MAAM,WAAW,QAEkD,CAAA;AAE1E,yDAAyD;AACzD,eAAO,MAAM,aAAa,yMAAuE,CAAA;AAEjG,sEAAsE;AACtE,eAAO,MAAM,aAAa,yMAAuE,CAAA;AAEjG;qCACqC;AACrC,eAAO,MAA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muted-foreground text-sm";
48
48
  /** The icon-only close in a dialog or sheet's top-end corner. */
49
49
  var overlayCornerClose = "absolute top-3.5 end-3.5 rounded-md p-1 text-muted-foreground transition-colors ease-out hover:bg-surface-hover hover:text-foreground focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-primary-subtle outline-none";
50
50
  /**
51
- * The tip: the card-toned bubble an explanation shows in. The side rail draws
52
- * it flush to a collapsed row and every floating tooltip composes the same
53
- * fill, edge, and type, so a control never explains itself in two visual
54
- * languages.
51
+ * The tip: shadcn's inverted chip, foreground on background, so an explanation
52
+ * never reads as a popover that could hold controls. The side rail draws it
53
+ * flush to a collapsed row and every floating tooltip composes the same fill
54
+ * and type, so a control never explains itself in two visual languages.
55
55
  */
56
- var tooltipTip = "bg-card text-card-foreground rounded-md border border-border text-sm font-medium shadow-lg";
56
+ var tooltipTip = "bg-foreground text-background rounded-md text-xs font-medium";
57
57
  /**
58
58
  * Entrance and exit motion, expressed as data-state classes.
59
59
  *