@qilin-agent/client-ui-primitives 0.0.0-stage → 3.1.3

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 (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +61 -0
  3. package/README.md +181 -2
  4. package/README.zh.md +182 -0
  5. package/lib/Button.module.css +79 -0
  6. package/lib/Checkbox.module.css +28 -0
  7. package/lib/ConnectionIndicator.module.css +123 -0
  8. package/lib/DiffBlock.module.css +109 -0
  9. package/lib/DisclosureRow.module.css +84 -0
  10. package/lib/FileTypeIcon.module.css +50 -0
  11. package/lib/HoverCard.module.css +70 -0
  12. package/lib/ImageLightbox.module.css +48 -0
  13. package/lib/ImagePreview.module.css +24 -0
  14. package/lib/Input.module.css +38 -0
  15. package/lib/JsonTree.module.css +345 -0
  16. package/lib/Menu.module.css +274 -0
  17. package/lib/MenuGroup.module.css +37 -0
  18. package/lib/MenuSurface.module.css +49 -0
  19. package/lib/Modal.module.css +103 -0
  20. package/lib/OnboardingSurface.module.css +29 -0
  21. package/lib/PathLabel.module.css +28 -0
  22. package/lib/Pill.module.css +27 -0
  23. package/lib/ReadBlock.module.css +111 -0
  24. package/lib/RiskConfirmation.module.css +73 -0
  25. package/lib/SearchBlock.module.css +112 -0
  26. package/lib/SegmentedControl.module.css +76 -0
  27. package/lib/ShortcutKeys.module.css +33 -0
  28. package/lib/StateDot.module.css +73 -0
  29. package/lib/Switch.module.css +50 -0
  30. package/lib/Tag.module.css +57 -0
  31. package/lib/TerminalBlock.module.css +205 -0
  32. package/lib/TextShimmer.module.css +88 -0
  33. package/lib/Toast.module.css +76 -0
  34. package/lib/Tooltip.module.css +52 -0
  35. package/lib/WebBlock.module.css +141 -0
  36. package/lib/index.js +10096 -0
  37. package/lib/markdown/CodeBlock.module.css +130 -0
  38. package/lib/markdown/JsonBlock.module.css +32 -0
  39. package/lib/markdown/MarkdownText.module.css +485 -0
  40. package/lib/markdown/mermaid.module.css +49 -0
  41. package/lib/types/Button.d.ts +18 -0
  42. package/lib/types/Checkbox.d.ts +20 -0
  43. package/lib/types/CodeFileIcon.d.ts +12 -0
  44. package/lib/types/ConnectionIndicator.d.ts +26 -0
  45. package/lib/types/DiffBlock.d.ts +52 -0
  46. package/lib/types/DisclosureRow.d.ts +36 -0
  47. package/lib/types/FileTypeIcon.d.ts +43 -0
  48. package/lib/types/FoldToggle.d.ts +20 -0
  49. package/lib/types/HoverCard.d.ts +32 -0
  50. package/lib/types/ImageLightbox.d.ts +27 -0
  51. package/lib/types/ImagePreview.d.ts +12 -0
  52. package/lib/types/Input.d.ts +12 -0
  53. package/lib/types/JsonTree.d.ts +59 -0
  54. package/lib/types/LinkIcon.d.ts +49 -0
  55. package/lib/types/Menu.d.ts +133 -0
  56. package/lib/types/MenuGroup.d.ts +22 -0
  57. package/lib/types/MenuSurface.d.ts +16 -0
  58. package/lib/types/Modal.d.ts +44 -0
  59. package/lib/types/OnboardingSurface.d.ts +11 -0
  60. package/lib/types/PathLabel.d.ts +13 -0
  61. package/lib/types/Pill.d.ts +13 -0
  62. package/lib/types/QilinSeal.d.ts +18 -0
  63. package/lib/types/ReadBlock.d.ts +47 -0
  64. package/lib/types/ReferenceIcon.d.ts +16 -0
  65. package/lib/types/RiskConfirmation.d.ts +20 -0
  66. package/lib/types/SearchBlock.d.ts +72 -0
  67. package/lib/types/SegmentedControl.d.ts +35 -0
  68. package/lib/types/ShortcutKeys.d.ts +11 -0
  69. package/lib/types/SiteGlyph.d.ts +25 -0
  70. package/lib/types/StateDot.d.ts +18 -0
  71. package/lib/types/Switch.d.ts +20 -0
  72. package/lib/types/Tag.d.ts +32 -0
  73. package/lib/types/TerminalBlock.d.ts +66 -0
  74. package/lib/types/TextShimmer.d.ts +22 -0
  75. package/lib/types/Toast.d.ts +36 -0
  76. package/lib/types/Tooltip.d.ts +45 -0
  77. package/lib/types/WebBlock.d.ts +61 -0
  78. package/lib/types/ansi.d.ts +17 -0
  79. package/lib/types/clipboard.d.ts +9 -0
  80. package/lib/types/code-file-icon-artwork.d.ts +54 -0
  81. package/lib/types/code-file-types.d.ts +30 -0
  82. package/lib/types/darwin-desktop.d.ts +9 -0
  83. package/lib/types/file-size.d.ts +17 -0
  84. package/lib/types/focus.d.ts +9 -0
  85. package/lib/types/head-tail-cap.d.ts +23 -0
  86. package/lib/types/icons/index.d.ts +211 -0
  87. package/lib/types/icons/props.d.ts +9 -0
  88. package/lib/types/index.d.ts +84 -0
  89. package/lib/types/input-modality.d.ts +19 -0
  90. package/lib/types/keyboard-composition.d.ts +11 -0
  91. package/lib/types/markdown/CodeBlock.d.ts +30 -0
  92. package/lib/types/markdown/JsonBlock.d.ts +8 -0
  93. package/lib/types/markdown/MarkdownDelegate.d.ts +46 -0
  94. package/lib/types/markdown/MarkdownText.d.ts +54 -0
  95. package/lib/types/markdown/cjkFriendlyStrong.d.ts +9 -0
  96. package/lib/types/markdown/file-link.d.ts +13 -0
  97. package/lib/types/markdown/highlight.d.ts +142 -0
  98. package/lib/types/markdown/incremental.d.ts +80 -0
  99. package/lib/types/markdown/katex.d.ts +27 -0
  100. package/lib/types/markdown/local-image-syntax.d.ts +10 -0
  101. package/lib/types/markdown/mathCompatibility.d.ts +11 -0
  102. package/lib/types/markdown/mermaid.d.ts +39 -0
  103. package/lib/types/markdown/parse.d.ts +25 -0
  104. package/lib/types/markdown/plain-text.d.ts +22 -0
  105. package/lib/types/markdown/render.d.ts +158 -0
  106. package/lib/types/markdown/useViewportHighlighting.d.ts +11 -0
  107. package/lib/types/overlay-top-margin.d.ts +8 -0
  108. package/lib/types/pointer-grace.d.ts +22 -0
  109. package/lib/types/rank-by-name.d.ts +22 -0
  110. package/lib/types/relative-time.d.ts +23 -0
  111. package/lib/types/seal-geometry.d.ts +27 -0
  112. package/lib/types/seal-glyphs.d.ts +9 -0
  113. package/lib/types/use-copy-feedback.d.ts +14 -0
  114. package/lib/types/useAnchoredMaxHeight.d.ts +11 -0
  115. package/lib/types/useAnchoredPosition.d.ts +34 -0
  116. package/lib/types/useDismissOnOutsidePointer.d.ts +11 -0
  117. package/lib/types/useModalLayer.d.ts +27 -0
  118. package/lib/types/user-text.d.ts +37 -0
  119. package/lib/user-text.module.css +43 -0
  120. package/package.json +62 -3
@@ -0,0 +1,13 @@
1
+ /** A single-line file path whose trailing characters remain visible in narrow toolbars. */
2
+ import { type HTMLAttributes } from 'react';
3
+ /**
4
+ * Render subdued directories and a primary filename, with the complete path on hover.
5
+ * Fitting text is left-aligned; overflow clips and fades at the left edge.
6
+ * The fade updates on path changes and, when ResizeObserver is available, size changes.
7
+ * @param props - File path and attributes for its outer span; callers own toolbar spacing.
8
+ * @returns the path label.
9
+ */
10
+ export declare function PathLabel({ path, className, ...attributes }: {
11
+ path: string;
12
+ } & Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'title'>): import("react").JSX.Element;
13
+ //# sourceMappingURL=PathLabel.d.ts.map
@@ -0,0 +1,13 @@
1
+ import type { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ /**
3
+ * Render a pill chip. Interactive when onClick is supplied (renders a button);
4
+ * otherwise a static span.
5
+ * @param props.active - selected/active visual state.
6
+ * @returns pill element.
7
+ */
8
+ export declare function Pill({ active, className, children, onClick, ...rest }: {
9
+ active?: boolean;
10
+ className?: string | undefined;
11
+ children?: ReactNode;
12
+ } & ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
13
+ //# sourceMappingURL=Pill.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * The QiLin seal: a cinnabar rounded square with a gold hairline ring and the
3
+ * 麒 and 麟 glyph outlines side by side in warm white. The mark carries its own
4
+ * colours because it is the product's brand stamp rather than a themed icon —
5
+ * a cinnabar seal reads the same on a light and a dark surface. The glyphs are
6
+ * embedded outlines, so the mark needs no font on the rendering machine.
7
+ */
8
+ /**
9
+ * Render the QiLin seal at the requested edge length.
10
+ * @param props.size - rendered edge length in px.
11
+ * @param props.className - extra class from the occupying surface.
12
+ * @returns the seal svg (aria-hidden decorative brand art).
13
+ */
14
+ export declare function QilinSeal({ size, className }: {
15
+ size?: number;
16
+ className?: string | undefined;
17
+ }): import("react").JSX.Element;
18
+ //# sourceMappingURL=QilinSeal.d.ts.map
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Content lines shown before the height cap collapses the middle. Matches
3
+ * TerminalBlock's default so a long read and a long command output cut at the
4
+ * same place in the same flow.
5
+ */
6
+ export declare const DEFAULT_READ_MAX_LINES = 16;
7
+ /** One line of the read window: its file line number and its text (no trailing newline). */
8
+ export interface ReadBlockLine {
9
+ /** 1-based line number in the file (a window past an offset keeps the file's own numbering). */
10
+ number: number;
11
+ /** The line's text, already truncated to the read tool's per-line cap. */
12
+ text: string;
13
+ }
14
+ export interface ReadBlockProps {
15
+ /** Banner label (the file path, or a tool-supplied replacement title); omitted draws no label. */
16
+ label?: string | undefined;
17
+ /** The returned window's lines, in file order, each keeping its file line number. */
18
+ lines: readonly ReadBlockLine[];
19
+ /** Localized chrome supplied by the owning render site. */
20
+ labels: ReadBlockLabels;
21
+ /** Exact total line count in the file, for the "showing N of M" note when the read is a window. */
22
+ totalLines: number;
23
+ /** Grammar hint (a file-extension-derived language id); unknown or absent = plain monospace. */
24
+ lang?: string | undefined;
25
+ /** Height cap in content lines before the middle collapses (default {@link DEFAULT_READ_MAX_LINES}). */
26
+ maxLines?: number | undefined;
27
+ /** Extra class merged onto the wrapper (callers position; this component draws). */
28
+ className?: string | undefined;
29
+ }
30
+ /** Localized chrome for {@link ReadBlock}. */
31
+ export interface ReadBlockLabels {
32
+ window: (shown: number, total: number) => string;
33
+ copy: string;
34
+ copied: string;
35
+ collapseAria: string;
36
+ expandAria: (hidden: number) => string;
37
+ collapse: string;
38
+ expand: (hidden: number) => string;
39
+ }
40
+ /**
41
+ * Render a read tool result as a line-numbered, optionally syntax-highlighted
42
+ * file view.
43
+ * @param props - see {@link ReadBlockProps}.
44
+ * @returns the read block element.
45
+ */
46
+ export declare function ReadBlock({ label, labels, lines, totalLines, lang, maxLines, className, }: ReadBlockProps): import("react").JSX.Element;
47
+ //# sourceMappingURL=ReadBlock.d.ts.map
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Reference domains with distinct composer and transcript glyphs. */
3
+ export type ReferenceIconKind = 'session' | 'file' | 'folder';
4
+ /** Props shared by inline reference glyphs. */
5
+ export interface ReferenceIconProps {
6
+ kind: ReferenceIconKind;
7
+ size?: number;
8
+ className?: string | undefined;
9
+ }
10
+ /**
11
+ * Render the icon that identifies one inline reference domain.
12
+ * @param props - Reference kind, optional size, and optional CSS class.
13
+ * @returns The corresponding current-color SVG glyph.
14
+ */
15
+ export declare function ReferenceIcon({ kind, size, className }: ReferenceIconProps): ReactNode;
16
+ //# sourceMappingURL=ReferenceIcon.d.ts.map
@@ -0,0 +1,20 @@
1
+ export interface RiskConfirmationProps {
2
+ open: boolean;
3
+ title: string;
4
+ description: string;
5
+ acknowledgeLabel: string;
6
+ cancelLabel: string;
7
+ closeLabel: string;
8
+ confirmLabel: string;
9
+ acknowledged: boolean;
10
+ disabled?: boolean;
11
+ onAcknowledgedChange: (acknowledged: boolean) => void;
12
+ onCancel: () => void;
13
+ onConfirm: () => void;
14
+ }
15
+ /**
16
+ * Render one in-page confirmation whose primary action is unavailable until
17
+ * the caller-controlled acknowledgement is checked.
18
+ */
19
+ export declare function RiskConfirmation({ open, title, description, acknowledgeLabel, cancelLabel, closeLabel, confirmLabel, acknowledged, disabled, onAcknowledgedChange, onCancel, onConfirm, }: RiskConfirmationProps): import("react").JSX.Element;
20
+ //# sourceMappingURL=RiskConfirmation.d.ts.map
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Result rows shown before the height cap collapses the middle. Matches
3
+ * {@link DEFAULT_TERMINAL_MAX_LINES} so a search card and a terminal card cut a
4
+ * long result at the same place.
5
+ */
6
+ export declare const DEFAULT_SEARCH_MAX_LINES = 16;
7
+ /** One matched line inside a {@link SearchFileGroup}: its 1-based line number and text. */
8
+ export interface SearchBlockLineMatch {
9
+ /** 1-based line number of the match within its file. */
10
+ lineNumber: number;
11
+ /** The matched line text, as the tool surfaced it. */
12
+ line: string;
13
+ }
14
+ /** One file's grouped matches, in first-seen file order. */
15
+ export interface SearchFileGroup {
16
+ /** The file the matches belong to (the display path). */
17
+ path: string;
18
+ /** The file's matched lines, in output order. */
19
+ matches: SearchBlockLineMatch[];
20
+ }
21
+ /** Fields both search shapes carry (the render site positions; this component draws). */
22
+ interface SearchBlockCommon {
23
+ /** Localized chrome supplied by the owning render site. */
24
+ labels: SearchBlockLabels;
25
+ /**
26
+ * Whether the tool capped the inline result: the shape carries only the
27
+ * retained results, not every result the search found. The banner summary
28
+ * folds the pre-cap `total` in (`显示 X / 共 N …`) so the card never presents a
29
+ * capped result as complete.
30
+ */
31
+ truncated: boolean;
32
+ /** Total results the search found before capping (equals the retained count when not `truncated`). */
33
+ total: number;
34
+ /** Height cap in rows before the middle collapses (default {@link DEFAULT_SEARCH_MAX_LINES}). */
35
+ maxLines?: number | undefined;
36
+ /** Extra class merged onto the wrapper. */
37
+ className?: string | undefined;
38
+ }
39
+ /** Localized chrome for {@link SearchBlock}. */
40
+ export interface SearchBlockLabels {
41
+ pathsSummary: (shown: number, total: number, truncated: boolean) => string;
42
+ matchesSummary: (shown: number, total: number, files: number, truncated: boolean) => string;
43
+ copy: string;
44
+ copied: string;
45
+ noResults: string;
46
+ collapseAria: string;
47
+ expandAria: (hidden: number) => string;
48
+ collapse: string;
49
+ expand: (hidden: number) => string;
50
+ }
51
+ /** Props for the grouped-matches (`grep`) shape. */
52
+ export interface SearchMatchesBlockProps extends SearchBlockCommon {
53
+ kind: 'matches';
54
+ /** Matched lines grouped by file, in first-seen file order. */
55
+ files: SearchFileGroup[];
56
+ }
57
+ /** Props for the flat-path (`glob`) shape. */
58
+ export interface SearchPathsBlockProps extends SearchBlockCommon {
59
+ kind: 'paths';
60
+ /** The discovered paths, in the tool's result order (the retained page when `truncated`). */
61
+ paths: string[];
62
+ }
63
+ /** {@link SearchBlock} props: one card, two `kind`-discriminated shapes. */
64
+ export type SearchBlockProps = SearchMatchesBlockProps | SearchPathsBlockProps;
65
+ /**
66
+ * Render a completed search as a grouped-matches or flat-path card.
67
+ * @param props - see {@link SearchBlockProps}.
68
+ * @returns the search block element.
69
+ */
70
+ export declare function SearchBlock(props: SearchBlockProps): import("react").JSX.Element;
71
+ export {};
72
+ //# sourceMappingURL=SearchBlock.d.ts.map
@@ -0,0 +1,35 @@
1
+ /** One segment of a {@link SegmentedControl}. */
2
+ export interface SegmentedControlOption<Value extends string> {
3
+ /** The value the owner receives when this segment is chosen. */
4
+ value: Value;
5
+ /** Localized segment text. */
6
+ label: string;
7
+ /** Whether the segment refuses selection. */
8
+ disabled?: boolean;
9
+ /** Localized hover text, typically why the segment is locked. */
10
+ title?: string;
11
+ }
12
+ /**
13
+ * Render a segmented control.
14
+ * @param props.id - the owner's base id: each tab is `<id>-<value>` and names
15
+ * `<id>-<value>-panel` as the panel it controls.
16
+ * @param props.value - the selected option's value; the control is fully controlled.
17
+ * @param props.options - the segments in display order; at least two.
18
+ * @param props.onChange - called with the value a click or a walk key asks for,
19
+ * never with the value already selected.
20
+ * @param props.label - localized accessible name of the tablist.
21
+ * @param props.disabled - lock every segment, typically while the shown panel
22
+ * has a write or a fetch in flight that switching would orphan.
23
+ * @param props.className - extra class for layout placement.
24
+ * @returns the tablist element.
25
+ */
26
+ export declare function SegmentedControl<Value extends string>({ id, value, options, onChange, label, disabled, className, }: {
27
+ id: string;
28
+ value: Value;
29
+ options: readonly SegmentedControlOption<Value>[];
30
+ onChange: (next: Value) => void;
31
+ label: string;
32
+ disabled?: boolean;
33
+ className?: string | undefined;
34
+ }): import("react").JSX.Element;
35
+ //# sourceMappingURL=SegmentedControl.d.ts.map
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Render one command's keycaps without owning binding defaults or localized copy.
3
+ * @param props - effective key labels, presentation variant and optional interaction styling.
4
+ * @returns unboxed keys by default, or tooltip keycaps with plus-separated combinations grouped together.
5
+ */
6
+ export declare function ShortcutKeys({ keys, variant, className }: {
7
+ keys: readonly string[];
8
+ variant?: 'plain' | 'tooltip';
9
+ className?: string | undefined;
10
+ }): import("react").JSX.Element;
11
+ //# sourceMappingURL=ShortcutKeys.d.ts.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Site marks for well-known external link hosts. {@link LinkIcon} renders one in
3
+ * the leading glyph seat, so a familiar destination leads with its own mark
4
+ * instead of the generic globe. The marks are the `simple-icons` artwork set
5
+ * (CC0-1.0), pinned by this package's dependency on it; each mark takes the
6
+ * link's `currentColor` rather than the brand fill that set records.
7
+ */
8
+ import type { ReactElement } from 'react';
9
+ /** Props for {@link siteGlyph}: the destination plus the shared icon sizing seat. */
10
+ interface SiteGlyphProps {
11
+ /** The link destination; only an absolute http(s) URL can name a host. */
12
+ href: string | undefined;
13
+ /** Square edge in px. */
14
+ size: number;
15
+ /** Extra class for layout placement. */
16
+ className?: string | undefined;
17
+ }
18
+ /**
19
+ * Render the site mark for a known external destination.
20
+ * @param props - The destination and the icon sizing seat.
21
+ * @returns The site's mark riding currentColor, or undefined for an unknown site.
22
+ */
23
+ export declare function siteGlyph({ href, size, className }: SiteGlyphProps): ReactElement | undefined;
24
+ export {};
25
+ //# sourceMappingURL=SiteGlyph.d.ts.map
@@ -0,0 +1,18 @@
1
+ /**
2
+ * State semantic: green done / amber user-attention / blue running ring /
3
+ * red error / grey idle for a tracked subject with nothing in progress.
4
+ */
5
+ export type StateDotState = 'done' | 'warning' | 'ongoing' | 'error' | 'idle';
6
+ /**
7
+ * Render a state dot.
8
+ * @param props.state - which of `done`, `warning`, `ongoing`, `error`, or `idle` to show.
9
+ * @param props.size - outer diameter in px (default 10, the figma size).
10
+ * @param props.className - extra class for layout placement.
11
+ * @returns the dot element (aria-hidden; pair with text for accessibility).
12
+ */
13
+ export declare function StateDot({ state, size, className }: {
14
+ state: StateDotState;
15
+ size?: number | undefined;
16
+ className?: string | undefined;
17
+ }): import("react").JSX.Element;
18
+ //# sourceMappingURL=StateDot.d.ts.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Render a toggle switch.
3
+ * @param props.checked - the current state; the control is fully controlled.
4
+ * @param props.onChange - called with the state the click asks for.
5
+ * @param props.label - localized accessible name, owned by the render site.
6
+ * @param props.disabled - whether the control refuses input; owners also set it
7
+ * while a write is in flight, not only when a deployment locks the toggle.
8
+ * @param props.title - localized hover text, typically why the toggle is locked.
9
+ * @param props.className - extra class for layout placement.
10
+ * @returns the switch element.
11
+ */
12
+ export declare function Switch({ checked, onChange, label, disabled, title, className }: {
13
+ checked: boolean;
14
+ onChange: (next: boolean) => void;
15
+ label: string;
16
+ disabled?: boolean;
17
+ title?: string | undefined;
18
+ className?: string | undefined;
19
+ }): import("react").JSX.Element;
20
+ //# sourceMappingURL=Switch.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ /** Palette selector; each tone names one shipped appearance. */
3
+ export type TagTone =
4
+ /** Hairline outline on tertiary text: the read-only default. */
5
+ 'outline'
6
+ /** Inverted fill: one tag per group that names the current selection. */
7
+ | 'solid'
8
+ /** Platform-gray fill: a neutral fact with no status meaning. */
9
+ | 'neutral'
10
+ /** Text only, no fill: a fact stated more quietly than `neutral`. */
11
+ | 'quiet'
12
+ /** Tinted green: a healthy or enabled state. */
13
+ | 'success'
14
+ /** Tinted blue: informational classification, not health. */
15
+ | 'info'
16
+ /** Tinted amber: attention needed, not yet a failure. */
17
+ | 'warning'
18
+ /** Tinted red: a failure. */
19
+ | 'danger';
20
+ /**
21
+ * Render a read-only tag.
22
+ * @param props.tone - which palette to use (default `outline`).
23
+ * @param props.className - extra class for layout placement.
24
+ * @param props.children - the localized label, owned by the render site.
25
+ * @returns the tag element.
26
+ */
27
+ export declare function Tag({ tone, className, children }: {
28
+ tone?: TagTone;
29
+ className?: string | undefined;
30
+ children?: ReactNode;
31
+ }): import("react").JSX.Element;
32
+ //# sourceMappingURL=Tag.d.ts.map
@@ -0,0 +1,66 @@
1
+ /** Output lines shown before the height cap collapses the middle. */
2
+ export declare const DEFAULT_TERMINAL_MAX_LINES = 16;
3
+ /**
4
+ * Display copy for the terminal surface; the owner passes localized labels
5
+ * (this package is cordis-free, so copy arrives via props).
6
+ */
7
+ export interface TerminalBlockLabels {
8
+ /** Status pill text for a signal-terminated command. */
9
+ signal: (signal: string) => string;
10
+ /** Status pill text for a non-zero exit code. */
11
+ exitCode: (exitCode: number) => string;
12
+ /** Status pill text for a command that ended without an exit code: killed by a signal the view does not know, or never started. */
13
+ noExitCode: string;
14
+ /** Run-state text while the command is still running. */
15
+ running: string;
16
+ /** Run-state text for a signal or non-zero-exit settle. */
17
+ failed: string;
18
+ /** Run-state text for a clean settle. */
19
+ done: string;
20
+ /** Copy-button idle label. */
21
+ copy: string;
22
+ /** Copy-button label during the post-copy confirmation window. */
23
+ copied: string;
24
+ /** Placeholder when a settled command produced no visible output. */
25
+ noOutput: string;
26
+ /** Collapse-toggle aria label while expanded. */
27
+ collapseAria: string;
28
+ /** Collapse-toggle text while expanded. */
29
+ collapse: string;
30
+ /** Expand-toggle aria label while capped, given the hidden line count. */
31
+ expandAria: (hidden: number) => string;
32
+ /** Expand-toggle text while capped, given the hidden line count. */
33
+ expand: (hidden: number) => string;
34
+ }
35
+ export interface TerminalBlockProps {
36
+ /** The command line, rendered verbatim after the prompt label. */
37
+ command: string;
38
+ /** Working directory for the prompt label; absent renders a plain `$`. */
39
+ cwd?: string | undefined;
40
+ /** Absolute home directory, so a cwd equal to it collapses to `~`; absent disables that collapse. */
41
+ home?: string | undefined;
42
+ /** The command's output text; may contain ANSI escape sequences. */
43
+ output?: string | undefined;
44
+ /** Settled exit code; a non-zero value renders the status pill, and null (settled without one) the no-exit-code pill. */
45
+ exitCode?: number | null | undefined;
46
+ /** Settled terminating signal name; any value renders the status pill, taking precedence over the exit code. */
47
+ signal?: string | undefined;
48
+ /**
49
+ * The command is still running: the block shows the prompt line, and the
50
+ * output printed so far when there is any, with no copy control until it settles.
51
+ */
52
+ running?: boolean | undefined;
53
+ /** Height cap in output lines before the middle collapses (default {@link DEFAULT_TERMINAL_MAX_LINES}); Infinity disables the cap. */
54
+ maxLines?: number | undefined;
55
+ /** Extra class merged onto the wrapper (callers position; this component draws). */
56
+ className?: string | undefined;
57
+ /** Localized display copy supplied by the owning render site. */
58
+ labels: TerminalBlockLabels;
59
+ }
60
+ /**
61
+ * Render a shell command as a terminal surface.
62
+ * @param props - see {@link TerminalBlockProps}.
63
+ * @returns the terminal block element.
64
+ */
65
+ export declare function TerminalBlock({ command, cwd, home, output, exitCode, signal, running, maxLines, className, labels, }: TerminalBlockProps): import("react").JSX.Element;
66
+ //# sourceMappingURL=TerminalBlock.d.ts.map
@@ -0,0 +1,22 @@
1
+ /** Text activity animation shared by a row and its nested text fragments. */
2
+ import { type ReactNode } from 'react';
3
+ /** Text and activity supplied by the owning row. */
4
+ export interface TextShimmerProps {
5
+ /** Text or presentational children with text in nested TextShimmer instances. No effects or element ids. */
6
+ children: ReactNode;
7
+ /** Whether to animate; nested instances share the containing row's activity. */
8
+ active?: boolean | undefined;
9
+ className?: string | undefined;
10
+ /** Layout class applied equally to the base and decorative content. */
11
+ contentClassName?: string | undefined;
12
+ }
13
+ /**
14
+ * Render text with one shared highlight while retaining selectable, accessible content.
15
+ * Nested instances inherit the outer animation. Keep icons outside; mark decorative
16
+ * separators with data-shimmer-decoration so their background follows the highlight.
17
+ * Active children also render in an inert, clipped decoration; supply only presentation.
18
+ * @param props - localized text, running state, and owner styling.
19
+ * @returns retained text and its optional decorative highlight.
20
+ */
21
+ export declare const TextShimmer: import("react").MemoExoticComponent<({ children, active, className, contentClassName }: TextShimmerProps) => import("react").JSX.Element>;
22
+ //# sourceMappingURL=TextShimmer.d.ts.map
@@ -0,0 +1,36 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * Transient top-center banner: slides in, holds at full opacity, fades out,
4
+ * then reports done so the owner can unmount it. Re-showing the same text
5
+ * restarts the cycle when the owner remounts the component (key it by a
6
+ * per-show sequence). Rendered through a body portal so an owner inside a
7
+ * transformed or filtered ancestor cannot trap the fixed banner in that
8
+ * ancestor's box.
9
+ *
10
+ * The hold is the owner's to set, because how long a banner has to stay
11
+ * depends on how much there is to read: a one-line limit lands in the default
12
+ * window, while a failure that names what broke does not. One value drives
13
+ * both the unmount timer and the stylesheet's fade delay — the stylesheet
14
+ * reads it as a custom property — so the two can no longer disagree and leave
15
+ * the banner unmounting mid-fade.
16
+ * @param props.text - resolved banner copy; the owner passes localized text.
17
+ * @param props.icon - optional leading glyph (e.g. a warning icon); ignored
18
+ * under `tone="success"`, which brings its own glyph.
19
+ * @param props.tone - 'success' renders the success check as the leading
20
+ * glyph; omitted, the icon seat keeps its warning tint.
21
+ * @param props.holdMs - full-opacity hold before the fade; defaults to 3000.
22
+ * @param props.anchor - optional element whose horizontal center the banner
23
+ * follows (e.g. the composer card, so the banner centers over the chat column
24
+ * rather than the whole window); omitted, it centers on the viewport.
25
+ * @param props.onDone - called once the fade completes; unmount the toast here.
26
+ * @returns the floating banner.
27
+ */
28
+ export declare function Toast({ text, icon, tone, anchor, holdMs, onDone }: {
29
+ text: string;
30
+ icon?: ReactNode;
31
+ tone?: 'success';
32
+ anchor?: HTMLElement | null;
33
+ holdMs?: number;
34
+ onDone: () => void;
35
+ }): import("react").ReactPortal;
36
+ //# sourceMappingURL=Toast.d.ts.map
@@ -0,0 +1,45 @@
1
+ import type { FocusEventHandler, MouseEventHandler, ReactElement, Ref } from 'react';
2
+ /** Bubble placement relative to the anchor. */
3
+ export type TooltipSide = 'right' | 'bottom' | 'top';
4
+ /**
5
+ * Suppression channel for enclosing tooltip and hover-card anchors: a visible
6
+ * tooltip within an anchor withdraws the enclosing preview while its bubble is shown.
7
+ */
8
+ export declare const TooltipSuppression: import("react").Context<((suppressed: boolean) => void) | null>;
9
+ /** Props Tooltip injects into its anchor child; the child's own handlers are chained ahead of the tooltip's. */
10
+ interface AnchorProps {
11
+ ref?: Ref<HTMLElement> | undefined;
12
+ onMouseEnter?: MouseEventHandler | undefined;
13
+ onMouseLeave?: MouseEventHandler | undefined;
14
+ onFocus?: FocusEventHandler | undefined;
15
+ onBlur?: FocusEventHandler | undefined;
16
+ }
17
+ type TooltipLabel = string | (() => string);
18
+ /**
19
+ * Attach a hover/focus tooltip to an anchor element.
20
+ * @param props.label - bubble text, or a resolver evaluated only while the bubble is visible.
21
+ * @param props.shortcutKeys - effective key labels rendered as platform-formatted keycaps after optional text.
22
+ * @param props.side - placement relative to the anchor (default 'right').
23
+ * @param props.delayMs - hover delay in milliseconds; keyboard focus remains immediate.
24
+ * @param props.disabled - suppress the bubble while true; the anchor renders identically so
25
+ * toggling never remounts it (which would cut its CSS transitions).
26
+ * @param props.portal - render the bubble under document.body, so an ancestor's clipping or its
27
+ * stacking context can neither clip the bubble nor paint over it.
28
+ * @param props.maxWidth - bubble width cap in pixels, for labels long enough that the default
29
+ * half-viewport cap would render a slab wider than the surface the anchor sits on.
30
+ * @param props.children - a single anchor element; its own ref (callback or object) is forwarded alongside the tooltip's.
31
+ * An anchor that accepts no ref still positions the bubble: a raise records the element the event ran on.
32
+ * @returns the cloned anchor plus a fixed-position bubble while hovered/focused.
33
+ */
34
+ export declare function Tooltip({ label, shortcutKeys, side, delayMs, disabled, portal, maxWidth, children }: {
35
+ label: TooltipLabel;
36
+ shortcutKeys?: readonly string[] | undefined;
37
+ side?: TooltipSide;
38
+ delayMs?: number;
39
+ disabled?: boolean;
40
+ portal?: boolean;
41
+ maxWidth?: number;
42
+ children: ReactElement<AnchorProps>;
43
+ }): import("react").JSX.Element;
44
+ export {};
45
+ //# sourceMappingURL=Tooltip.d.ts.map
@@ -0,0 +1,61 @@
1
+ import { type MarkdownLabels } from './markdown/MarkdownText.tsx';
2
+ /**
3
+ * One citeable source drawn in a search card: the projection of the contract's
4
+ * `WebSource`, with the optional fields kept optional so a provider that
5
+ * returned only a URL still renders (its hostname becomes the label).
6
+ */
7
+ export interface WebSourceView {
8
+ /** The source URL; becomes a safe external link when it is http(s). */
9
+ url: string;
10
+ /** The source title; when absent the URL's hostname labels the link. */
11
+ title?: string | undefined;
12
+ /** A short excerpt or summary shown under the link. */
13
+ snippet?: string | undefined;
14
+ /** Publication/crawl timestamp, a provider-supplied string shown under the link. */
15
+ publishedAt?: string | undefined;
16
+ }
17
+ /** A `web_search` card: an optional answer over a capped citation list. */
18
+ export interface WebSearchBlockProps {
19
+ kind: 'search';
20
+ /** Localized chrome supplied by the owning render site. */
21
+ labels: WebBlockLabels;
22
+ /** The provider-generated answer, rendered as markdown above the sources. */
23
+ answer?: string | undefined;
24
+ /** The cited sources, in provider order. */
25
+ sources: WebSourceView[];
26
+ /** True when the tool cut the source list to its result cap. */
27
+ truncated: boolean;
28
+ /** Extra class merged onto the wrapper (callers position; this component draws). */
29
+ className?: string | undefined;
30
+ }
31
+ /** A `web_fetch` card: the retrieval summary for one fetched URL. */
32
+ export interface WebFetchBlockProps {
33
+ kind: 'fetch';
34
+ /** Localized chrome supplied by the owning render site. */
35
+ labels: WebBlockLabels;
36
+ /** The final URL after allowed redirects; becomes a safe external link when http(s). */
37
+ url: string;
38
+ /** HTTP status code of the fetched response. */
39
+ statusCode: number;
40
+ /** True when the provider or the output cap cut the fetched content. */
41
+ truncated: boolean;
42
+ /** Extra class merged onto the wrapper (callers position; this component draws). */
43
+ className?: string | undefined;
44
+ }
45
+ /** A completed web retrieval card, discriminated by `kind`. */
46
+ export type WebBlockProps = WebSearchBlockProps | WebFetchBlockProps;
47
+ /** Localized chrome for {@link WebBlock}. */
48
+ export interface WebBlockLabels {
49
+ noResults: string;
50
+ sourcesTruncated: string;
51
+ http: string;
52
+ contentTruncated: string;
53
+ markdown: MarkdownLabels;
54
+ }
55
+ /**
56
+ * Render a completed web retrieval as a structured card.
57
+ * @param props - see {@link WebBlockProps}; `kind` selects the search or fetch body.
58
+ * @returns the web card element.
59
+ */
60
+ export declare function WebBlock(props: WebBlockProps): import("react").JSX.Element;
61
+ //# sourceMappingURL=WebBlock.d.ts.map
@@ -0,0 +1,17 @@
1
+ import type { CSSProperties } from 'react';
2
+ /** One run of terminal text; `style` is undefined for text that carries no SGR state. */
3
+ export interface AnsiSpan {
4
+ /** The run's plain text, free of escape sequences and newlines. */
5
+ text: string;
6
+ /** Resolved inline style, or undefined when the run needs no wrapper. */
7
+ style: CSSProperties | undefined;
8
+ }
9
+ /** The spans of one output line, in order. */
10
+ export type AnsiLine = readonly AnsiSpan[];
11
+ /**
12
+ * Parse command output into styled spans grouped by line.
13
+ * @param text - raw output text, which may contain ANSI escape sequences.
14
+ * @returns one entry per output line (always at least one, possibly empty).
15
+ */
16
+ export declare function parseAnsiLines(text: string): AnsiLine[];
17
+ //# sourceMappingURL=ansi.d.ts.map
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Write text to the host clipboard, preferring the async Clipboard API and
3
+ * falling back to `execCommand('copy')` on hosts (jsdom, insecure contexts)
4
+ * that omit it.
5
+ * @param text - the exact text to place on the clipboard.
6
+ * @returns true only when the host accepted the write.
7
+ */
8
+ export declare function writeClipboard(text: string): Promise<boolean>;
9
+ //# sourceMappingURL=clipboard.d.ts.map