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

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 (127) hide show
  1. package/LICENSE +21 -0
  2. package/README.i18n.yaml +61 -0
  3. package/README.md +187 -2
  4. package/README.zh.md +188 -0
  5. package/lib/Button.module.css +79 -0
  6. package/lib/Checkbox.module.css +28 -0
  7. package/lib/CommandText.module.css +12 -0
  8. package/lib/ConnectionIndicator.module.css +123 -0
  9. package/lib/DiffBlock.module.css +109 -0
  10. package/lib/DisclosureRow.module.css +84 -0
  11. package/lib/FileTypeIcon.module.css +50 -0
  12. package/lib/HoverCard.module.css +70 -0
  13. package/lib/ImageLightbox.module.css +48 -0
  14. package/lib/ImagePreview.module.css +24 -0
  15. package/lib/Input.module.css +38 -0
  16. package/lib/JsonTree.module.css +345 -0
  17. package/lib/Menu.module.css +274 -0
  18. package/lib/MenuGroup.module.css +37 -0
  19. package/lib/MenuSurface.module.css +49 -0
  20. package/lib/Modal.module.css +103 -0
  21. package/lib/OnboardingSurface.module.css +29 -0
  22. package/lib/PathLabel.module.css +28 -0
  23. package/lib/Pill.module.css +27 -0
  24. package/lib/ReadBlock.module.css +111 -0
  25. package/lib/RiskConfirmation.module.css +73 -0
  26. package/lib/SearchBlock.module.css +112 -0
  27. package/lib/SegmentedControl.module.css +76 -0
  28. package/lib/ShortcutKeys.module.css +33 -0
  29. package/lib/StateDot.module.css +73 -0
  30. package/lib/Switch.module.css +50 -0
  31. package/lib/Tag.module.css +57 -0
  32. package/lib/TerminalBlock.module.css +205 -0
  33. package/lib/TextShimmer.module.css +88 -0
  34. package/lib/Toast.module.css +76 -0
  35. package/lib/Tooltip.module.css +52 -0
  36. package/lib/WebBlock.module.css +141 -0
  37. package/lib/index.js +10647 -0
  38. package/lib/markdown/CodeBlock.module.css +130 -0
  39. package/lib/markdown/JsonBlock.module.css +32 -0
  40. package/lib/markdown/MarkdownText.module.css +485 -0
  41. package/lib/markdown/mermaid.module.css +49 -0
  42. package/lib/settings-form/SettingsForm.module.css +53 -0
  43. package/lib/settings-form/fields.module.css +145 -0
  44. package/lib/types/Button.d.ts +18 -0
  45. package/lib/types/Checkbox.d.ts +20 -0
  46. package/lib/types/CodeFileIcon.d.ts +12 -0
  47. package/lib/types/CommandText.d.ts +16 -0
  48. package/lib/types/ConnectionIndicator.d.ts +26 -0
  49. package/lib/types/DiffBlock.d.ts +52 -0
  50. package/lib/types/DisclosureRow.d.ts +36 -0
  51. package/lib/types/FileTypeIcon.d.ts +43 -0
  52. package/lib/types/FoldToggle.d.ts +20 -0
  53. package/lib/types/HoverCard.d.ts +32 -0
  54. package/lib/types/ImageLightbox.d.ts +27 -0
  55. package/lib/types/ImagePreview.d.ts +12 -0
  56. package/lib/types/Input.d.ts +12 -0
  57. package/lib/types/JsonTree.d.ts +59 -0
  58. package/lib/types/LinkIcon.d.ts +49 -0
  59. package/lib/types/Menu.d.ts +133 -0
  60. package/lib/types/MenuGroup.d.ts +22 -0
  61. package/lib/types/MenuSurface.d.ts +16 -0
  62. package/lib/types/Modal.d.ts +44 -0
  63. package/lib/types/OnboardingSurface.d.ts +11 -0
  64. package/lib/types/PathLabel.d.ts +13 -0
  65. package/lib/types/Pill.d.ts +13 -0
  66. package/lib/types/QilinSeal.d.ts +18 -0
  67. package/lib/types/ReadBlock.d.ts +47 -0
  68. package/lib/types/ReferenceIcon.d.ts +16 -0
  69. package/lib/types/RiskConfirmation.d.ts +20 -0
  70. package/lib/types/SearchBlock.d.ts +72 -0
  71. package/lib/types/SegmentedControl.d.ts +35 -0
  72. package/lib/types/ShortcutKeys.d.ts +11 -0
  73. package/lib/types/SiteGlyph.d.ts +25 -0
  74. package/lib/types/StateDot.d.ts +18 -0
  75. package/lib/types/Switch.d.ts +20 -0
  76. package/lib/types/Tag.d.ts +32 -0
  77. package/lib/types/TerminalBlock.d.ts +68 -0
  78. package/lib/types/TextShimmer.d.ts +22 -0
  79. package/lib/types/Toast.d.ts +36 -0
  80. package/lib/types/Tooltip.d.ts +45 -0
  81. package/lib/types/WebBlock.d.ts +61 -0
  82. package/lib/types/ansi.d.ts +17 -0
  83. package/lib/types/clipboard.d.ts +9 -0
  84. package/lib/types/code-file-icon-artwork.d.ts +54 -0
  85. package/lib/types/code-file-types.d.ts +30 -0
  86. package/lib/types/darwin-desktop.d.ts +18 -0
  87. package/lib/types/file-size.d.ts +17 -0
  88. package/lib/types/focus.d.ts +9 -0
  89. package/lib/types/head-tail-cap.d.ts +23 -0
  90. package/lib/types/icons/index.d.ts +211 -0
  91. package/lib/types/icons/props.d.ts +9 -0
  92. package/lib/types/index.d.ts +92 -0
  93. package/lib/types/input-modality.d.ts +19 -0
  94. package/lib/types/keyboard-composition.d.ts +11 -0
  95. package/lib/types/markdown/CodeBlock.d.ts +30 -0
  96. package/lib/types/markdown/JsonBlock.d.ts +8 -0
  97. package/lib/types/markdown/MarkdownDelegate.d.ts +46 -0
  98. package/lib/types/markdown/MarkdownText.d.ts +54 -0
  99. package/lib/types/markdown/cjkFriendlyStrong.d.ts +9 -0
  100. package/lib/types/markdown/file-link.d.ts +13 -0
  101. package/lib/types/markdown/highlight.d.ts +142 -0
  102. package/lib/types/markdown/incremental.d.ts +80 -0
  103. package/lib/types/markdown/katex.d.ts +27 -0
  104. package/lib/types/markdown/local-image-syntax.d.ts +10 -0
  105. package/lib/types/markdown/mathCompatibility.d.ts +11 -0
  106. package/lib/types/markdown/mermaid.d.ts +39 -0
  107. package/lib/types/markdown/parse.d.ts +25 -0
  108. package/lib/types/markdown/plain-text.d.ts +22 -0
  109. package/lib/types/markdown/render.d.ts +158 -0
  110. package/lib/types/markdown/useViewportHighlighting.d.ts +11 -0
  111. package/lib/types/overlay-top-margin.d.ts +8 -0
  112. package/lib/types/pointer-grace.d.ts +22 -0
  113. package/lib/types/rank-by-name.d.ts +22 -0
  114. package/lib/types/relative-time.d.ts +23 -0
  115. package/lib/types/seal-geometry.d.ts +27 -0
  116. package/lib/types/seal-glyphs.d.ts +9 -0
  117. package/lib/types/settings-form/SettingsForm.d.ts +46 -0
  118. package/lib/types/settings-form/fields.d.ts +70 -0
  119. package/lib/types/settings-form/form-model.d.ts +214 -0
  120. package/lib/types/use-copy-feedback.d.ts +14 -0
  121. package/lib/types/useAnchoredMaxHeight.d.ts +11 -0
  122. package/lib/types/useAnchoredPosition.d.ts +34 -0
  123. package/lib/types/useDismissOnOutsidePointer.d.ts +11 -0
  124. package/lib/types/useModalLayer.d.ts +27 -0
  125. package/lib/types/user-text.d.ts +37 -0
  126. package/lib/user-text.module.css +43 -0
  127. package/package.json +63 -3
@@ -0,0 +1,53 @@
1
+ /* Settings form: the controls a page shows under a plugin's title, and the save that writes them. */
2
+
3
+ .form {
4
+ display: flex;
5
+ flex-direction: column;
6
+ }
7
+
8
+ .readOnly,
9
+ .unavailable {
10
+ margin: 0 0 12px;
11
+ font-size: 12px;
12
+ line-height: 1.5;
13
+ color: var(--qilin-alias-label-tertiary);
14
+ }
15
+
16
+ .footer {
17
+ display: flex;
18
+ align-items: center;
19
+ gap: 8px;
20
+ padding-top: 16px;
21
+ }
22
+
23
+ .failed {
24
+ flex: 1;
25
+ min-width: 0;
26
+ margin: 0;
27
+ font-size: 12px;
28
+ line-height: 1.5;
29
+ color: var(--qilin-alias-label-error);
30
+ }
31
+
32
+ .save {
33
+ appearance: none;
34
+ border: 1px solid transparent;
35
+ border-radius: var(--qilin-radius-md);
36
+ padding: 5px 14px;
37
+ font: inherit;
38
+ font-size: 13px;
39
+ line-height: 1.5;
40
+ cursor: pointer;
41
+ background: var(--qilin-alias-label-primary);
42
+ color: var(--qilin-alias-bg-layer-3);
43
+ }
44
+
45
+ .save:disabled {
46
+ opacity: 0.4;
47
+ cursor: default;
48
+ }
49
+
50
+ .save:focus-visible {
51
+ outline: var(--qilin-focus-ring-width) solid var(--qilin-focus-ring-color, var(--qilin-alias-state-business-primary));
52
+ outline-offset: 1px;
53
+ }
@@ -0,0 +1,145 @@
1
+ /* Settings form fields: label, control, override badge, and hint. */
2
+
3
+ .field {
4
+ display: flex;
5
+ flex-direction: column;
6
+ gap: 6px;
7
+ padding: 12px 0;
8
+ }
9
+
10
+ .field + .field {
11
+ border-top: 0.5px solid var(--qilin-alias-border-l2);
12
+ }
13
+
14
+ .head {
15
+ display: flex;
16
+ align-items: center;
17
+ gap: 8px;
18
+ }
19
+
20
+ .label {
21
+ flex: 1;
22
+ min-width: 0;
23
+ font-size: 13px;
24
+ font-weight: 500;
25
+ line-height: 1.5;
26
+ color: var(--qilin-alias-label-primary);
27
+ }
28
+
29
+ .labelGroup {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 4px;
33
+ flex: 1;
34
+ min-width: 0;
35
+ }
36
+
37
+ .labelGroup > .label {
38
+ flex: 0 1 auto;
39
+ }
40
+
41
+ .helpButton {
42
+ display: inline-flex;
43
+ align-items: center;
44
+ justify-content: center;
45
+ flex: none;
46
+ width: 24px;
47
+ height: 24px;
48
+ padding: 0;
49
+ border: 0;
50
+ border-radius: var(--qilin-radius-sm);
51
+ background: none;
52
+ color: var(--qilin-alias-label-tertiary);
53
+ cursor: pointer;
54
+ }
55
+
56
+ .helpButton:hover,
57
+ .helpButton[aria-expanded='true'] {
58
+ background: var(--qilin-alias-bg-layer-4);
59
+ color: var(--qilin-alias-label-secondary);
60
+ }
61
+
62
+ .helpButton:focus-visible {
63
+ outline: var(--qilin-focus-ring-width) solid var(--qilin-focus-ring-color, var(--qilin-alias-state-business-primary));
64
+ outline-offset: 1px;
65
+ }
66
+
67
+ .help {
68
+ padding: 10px 0 0;
69
+ font-size: 12px;
70
+ line-height: 1.6;
71
+ color: var(--qilin-alias-label-secondary);
72
+ }
73
+
74
+ .help > p {
75
+ margin: 0;
76
+ }
77
+
78
+ .help > p + p {
79
+ margin-top: 8px;
80
+ }
81
+
82
+ .badges {
83
+ display: inline-flex;
84
+ align-items: center;
85
+ gap: 8px;
86
+ }
87
+
88
+ .reset {
89
+ border: none;
90
+ background: none;
91
+ padding: 0;
92
+ font: inherit;
93
+ font-size: 12px;
94
+ line-height: 1.5;
95
+ color: var(--qilin-alias-label-secondary);
96
+ cursor: pointer;
97
+ }
98
+
99
+ .reset:hover:not(:disabled) {
100
+ color: var(--qilin-alias-label-primary);
101
+ }
102
+
103
+ .reset:disabled {
104
+ cursor: default;
105
+ }
106
+
107
+ .input {
108
+ height: 34px;
109
+ padding: 0 12px;
110
+ border: 0.5px solid var(--qilin-alias-border-l4);
111
+ border-radius: var(--qilin-radius-md);
112
+ background: var(--qilin-alias-bg-layer-3);
113
+ font: inherit;
114
+ font-size: 13px;
115
+ line-height: 1.5;
116
+ color: var(--qilin-alias-label-primary);
117
+ }
118
+
119
+ .input:focus-visible {
120
+ outline: none;
121
+ border-color: var(--qilin-alias-state-business-primary);
122
+ }
123
+
124
+ .input:disabled {
125
+ color: var(--qilin-alias-label-tertiary);
126
+ cursor: default;
127
+ }
128
+
129
+ .input[aria-invalid='true'] {
130
+ border-color: var(--qilin-alias-state-error-primary);
131
+ }
132
+
133
+ .invalid {
134
+ margin: 0;
135
+ font-size: 12px;
136
+ line-height: 1.5;
137
+ color: var(--qilin-alias-state-error-primary);
138
+ }
139
+
140
+ .hint {
141
+ margin: 0;
142
+ font-size: 12px;
143
+ line-height: 1.5;
144
+ color: var(--qilin-alias-label-tertiary);
145
+ }
@@ -0,0 +1,18 @@
1
+ import type { ButtonHTMLAttributes, ReactNode } from 'react';
2
+ /** Visual variant, each backed by its --qilin-alias-button-* token family. */
3
+ export type ButtonVariant = 'primary' | 'ghost' | 'outline' | 'toolbar';
4
+ /**
5
+ * Render a button.
6
+ * @param props.variant - visual family (default 'ghost').
7
+ * @param props.size - 'md' 36px capsule (figma Button) or 'sm' 28px compact.
8
+ * @param props.icon - optional leading 16px icon node.
9
+ * @returns the button element; native button attributes pass through.
10
+ */
11
+ export declare function Button({ variant, size, icon, className, children, ...rest }: {
12
+ variant?: ButtonVariant;
13
+ size?: 'md' | 'sm';
14
+ icon?: ReactNode;
15
+ className?: string | undefined;
16
+ children?: ReactNode;
17
+ } & ButtonHTMLAttributes<HTMLButtonElement>): import("react").JSX.Element;
18
+ //# sourceMappingURL=Button.d.ts.map
@@ -0,0 +1,20 @@
1
+ /** Controlled native checkbox with a caller-owned visible and accessible label. */
2
+ /**
3
+ * Render a labeled checkbox with native keyboard and form semantics.
4
+ * @param props.checked - current checked state.
5
+ * @param props.onChange - receives the requested checked state.
6
+ * @param props.label - localized visible and accessible label.
7
+ * @param props.disabled - whether the control refuses changes.
8
+ * @param props.title - optional localized hover text.
9
+ * @param props.className - extra class for the label's placement.
10
+ * @returns the label containing its checkbox.
11
+ */
12
+ export declare function Checkbox({ 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=Checkbox.d.ts.map
@@ -0,0 +1,12 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { IconProps } from './icons/props.ts';
3
+ import type { CodeFileType } from './code-file-types.ts';
4
+ /**
5
+ * Render one full-color square code-file glyph from the embedded icon set.
6
+ * @param props - Detailed code type, optional size, and optional CSS class.
7
+ * @returns The selected decorative SVG with its identifying palette intact.
8
+ */
9
+ export declare function CodeFileIcon({ type, size, className }: IconProps & {
10
+ readonly type: CodeFileType;
11
+ }): ReactNode;
12
+ //# sourceMappingURL=CodeFileIcon.d.ts.map
@@ -0,0 +1,16 @@
1
+ /** Display text and owner-localized identification for a command scrollport. */
2
+ export interface CommandTextProps {
3
+ /** Original command or formatted command arguments, without truncation. */
4
+ text: string;
5
+ /** Accessible name while the text can scroll horizontally. */
6
+ label: string;
7
+ /** Owner typography and positioning. */
8
+ className?: string | undefined;
9
+ }
10
+ /**
11
+ * Render command text without adding Tab stops for content that fits.
12
+ * @param props - Text, localized scrollport name, and owner styling.
13
+ * @returns A horizontal text scrollport, named and keyboard-focusable only when overflowing.
14
+ */
15
+ export declare function CommandText({ text, label, className }: CommandTextProps): import("react").JSX.Element;
16
+ //# sourceMappingURL=CommandText.d.ts.map
@@ -0,0 +1,26 @@
1
+ /** Visual state rendered by {@link ConnectionIndicator}. */
2
+ export type ConnectionIndicatorState = 'disconnected' | 'connecting' | 'recovered';
3
+ /**
4
+ * Render an inline connection-recovery control. The outage and retry-attempt
5
+ * states are one button whose static label already names the retry action;
6
+ * clicking it requests an immediate reconnect. The indicator animates in on
7
+ * appearance and fades out for {@link EXIT_MS} before unmounting.
8
+ * @param props.state - visible outage, retry-attempt, or recovered state.
9
+ * @param props.disconnectedLabel - localized outage text naming the retry action.
10
+ * @param props.connectingLabel - localized retry text followed by the attempt dots.
11
+ * @param props.recoveredLabel - localized recovery confirmation.
12
+ * @param props.reconnectActionLabel - accessible label for the outage action.
13
+ * @param props.restartActionLabel - accessible label for replacing an active attempt.
14
+ * @param props.onReconnect - request an immediate reconnect attempt.
15
+ * @returns the indicator, or null when no connection feedback is active.
16
+ */
17
+ export declare function ConnectionIndicator({ state, disconnectedLabel, connectingLabel, recoveredLabel, reconnectActionLabel, restartActionLabel, onReconnect, }: {
18
+ state: ConnectionIndicatorState | undefined;
19
+ disconnectedLabel: string;
20
+ connectingLabel: string;
21
+ recoveredLabel: string;
22
+ reconnectActionLabel: string;
23
+ restartActionLabel: string;
24
+ onReconnect: () => void;
25
+ }): import("react").JSX.Element | null;
26
+ //# sourceMappingURL=ConnectionIndicator.d.ts.map
@@ -0,0 +1,52 @@
1
+ /** Output lines shown before the height cap collapses the middle. */
2
+ export declare const DEFAULT_DIFF_MAX_LINES = 16;
3
+ /**
4
+ * One file change in the form {@link DiffBlock} renders. It is declared here
5
+ * so this primitive stays independent of the tool contract.
6
+ */
7
+ export interface DiffHunk {
8
+ /** The changed file's path, drawn verbatim as the hunk's header (the tool's model-facing path). */
9
+ path: string;
10
+ /** Prior content including context, or `null` when no prior content is available. */
11
+ oldText: string | null;
12
+ /** Content after the change, including any shared context. */
13
+ newText: string;
14
+ }
15
+ export interface DiffBlockProps {
16
+ /** One entry per applied hunk, in file order; empty renders nothing. */
17
+ diffs: DiffHunk[];
18
+ /** Localized chrome supplied by the owning render site. */
19
+ labels: DiffBlockLabels;
20
+ /** Height cap in body lines before the middle collapses (default {@link DEFAULT_DIFF_MAX_LINES}). */
21
+ maxLines?: number | undefined;
22
+ /** Extra class merged onto the wrapper (callers position; this component draws). */
23
+ className?: string | undefined;
24
+ }
25
+ /** Localized chrome for {@link DiffBlock}. */
26
+ export interface DiffBlockLabels {
27
+ copy: string;
28
+ copied: string;
29
+ collapseAria: string;
30
+ expandAria: (hidden: number) => string;
31
+ collapse: string;
32
+ expand: (hidden: number) => string;
33
+ files: (count: number) => string;
34
+ }
35
+ /**
36
+ * Count displayed additions and deletions. Exact patches exclude shared context;
37
+ * comparisons exceeding the edit limit count both complete fragments as replaced.
38
+ * Text follows {@link contentLines}'s terminator rule.
39
+ * @param diffs - the hunks to count.
40
+ * @returns the +/- totals for summaries and the card footer.
41
+ */
42
+ export declare function diffTotals(diffs: DiffHunk[]): {
43
+ added: number;
44
+ removed: number;
45
+ };
46
+ /**
47
+ * Render a file mutation as an inline diff surface.
48
+ * @param props - see {@link DiffBlockProps}.
49
+ * @returns the diff block element.
50
+ */
51
+ export declare function DiffBlock({ diffs, labels, maxLines, className }: DiffBlockProps): import("react").JSX.Element | null;
52
+ //# sourceMappingURL=DiffBlock.d.ts.map
@@ -0,0 +1,36 @@
1
+ import { type ReactNode } from 'react';
2
+ /** Shared 24px disclosure chrome for compact flow rows. */
3
+ export interface DisclosureRowProps {
4
+ icon: ReactNode;
5
+ title: string;
6
+ open: boolean;
7
+ expandable: boolean;
8
+ onToggle: () => void;
9
+ /** Animate the complete header while its owning operation is running. */
10
+ running?: boolean | undefined;
11
+ /** Makes the complete title row the disclosure target. */
12
+ expandOnRowClick?: boolean | undefined;
13
+ /** Replaces the collapsed icon with a chevron while the row is hovered. */
14
+ previewChevron?: boolean | undefined;
15
+ /** Keeps `collapsedContent` inline while open. */
16
+ keepContentWhenOpen?: boolean | undefined;
17
+ collapsedContent?: ReactNode;
18
+ children?: ReactNode;
19
+ className?: string | undefined;
20
+ rowClassName?: string | undefined;
21
+ /** Sizing class for the header text area, beside the leading icon. */
22
+ contentClassName?: string | undefined;
23
+ /** Layout class shared by the header text and its decorative copy. */
24
+ contentLayoutClassName?: string | undefined;
25
+ leadingClassName?: string | undefined;
26
+ chevronClassName?: string | undefined;
27
+ titleClassName?: string | undefined;
28
+ }
29
+ /**
30
+ * Render one disclosure header and its controlled expanded content.
31
+ * Shallow prop comparison requires stable callbacks and React nodes to skip unchanged renders.
32
+ * @param props - Visual content, controlled state, and interaction policy.
33
+ * @returns the disclosure row.
34
+ */
35
+ export declare const DisclosureRow: import("react").MemoExoticComponent<({ icon, title, open, expandable, onToggle, running, expandOnRowClick, previewChevron, keepContentWhenOpen, collapsedContent, children, className, rowClassName, contentClassName, contentLayoutClassName, leadingClassName, chevronClassName, titleClassName, }: DisclosureRowProps) => import("react").JSX.Element>;
36
+ //# sourceMappingURL=DisclosureRow.d.ts.map
@@ -0,0 +1,43 @@
1
+ import type { ReactNode } from 'react';
2
+ import { type CodeFileType, type FileTypeProjectContext } from './code-file-types.ts';
3
+ import type { IconProps } from './icons/props.ts';
4
+ /** File categories with distinct 28px glyphs. */
5
+ export type FileType = CodeFileType | 'code' | 'excel' | 'folder' | 'html' | 'image' | 'markdown' | 'other' | 'pdf' | 'ppt' | 'video' | 'word';
6
+ /** Compatibility name for consumers that pass an already resolved category. */
7
+ export type FileTypeKind = FileType;
8
+ type ClassifiedFileType = Exclude<FileType, 'folder'>;
9
+ export type { CodeFileType, FileTypeProjectContext } from './code-file-types.ts';
10
+ /** Props for {@link FileTypeIcon}: either a path to classify or an already resolved kind. */
11
+ export type FileTypeIconProps = IconProps & ({
12
+ /** File path or name to classify. */
13
+ readonly path: string;
14
+ /** Optional project-file snapshot for context-sensitive code icons such as Flutter. */
15
+ readonly context?: FileTypeProjectContext | undefined;
16
+ } | {
17
+ /** Explicit category for callers that already resolved the file type. */
18
+ readonly kind: FileTypeKind;
19
+ });
20
+ /**
21
+ * Extract the final suffix from a file path without changing its case.
22
+ * A leading dot starts a suffix, while a missing or trailing dot returns an empty string.
23
+ * @param path - File path or basename using either path separator.
24
+ * @returns The characters after the basename's final dot.
25
+ */
26
+ export declare function fileExtension(path: string): string;
27
+ /**
28
+ * Classify a file path or name for file-card presentation.
29
+ * Matching is case-insensitive and applies code filename rules before extension rules;
30
+ * unknown names fall back to `other`.
31
+ * @param path - File path or basename using either path separator.
32
+ * @param context - Optional project files used by context-sensitive code mappings.
33
+ * @returns The file's closed presentation category.
34
+ */
35
+ export declare function classifyFileType(path: string, context?: FileTypeProjectContext): ClassifiedFileType;
36
+ /**
37
+ * Render a decorative file-type glyph for a path or an explicitly resolved kind.
38
+ * @param props - Path or kind selection, optional project context, size, and CSS class.
39
+ * @returns The category-colored SVG; the caller owns the accessible name and may override
40
+ * the color through `--qilin-file-type-icon-color`.
41
+ */
42
+ export declare function FileTypeIcon(props: FileTypeIconProps): ReactNode;
43
+ //# sourceMappingURL=FileTypeIcon.d.ts.map
@@ -0,0 +1,20 @@
1
+ interface FoldToggleProps {
2
+ className: string | undefined;
3
+ expanded: boolean;
4
+ hidden: number;
5
+ labels: {
6
+ collapseAria: string;
7
+ expandAria: (hidden: number) => string;
8
+ collapse: string;
9
+ expand: (hidden: number) => string;
10
+ };
11
+ onToggle: () => void;
12
+ }
13
+ /**
14
+ * Render the shared head-tail fold control with caller-owned localized copy.
15
+ * @param props - Fold state, localized labels, and toggle callback.
16
+ * @returns The accessible expand or collapse button.
17
+ */
18
+ export declare function FoldToggle({ className, expanded, hidden, labels, onToggle, }: FoldToggleProps): import("react").JSX.Element;
19
+ export {};
20
+ //# sourceMappingURL=FoldToggle.d.ts.map
@@ -0,0 +1,32 @@
1
+ import type { ReactNode } from 'react';
2
+ /**
3
+ * Render an anchor with a hover-triggered preview card, hidden while a tooltip within the anchor is visible.
4
+ * @param props.anchor - the hover target (rendered in place inside a wrapper span).
5
+ * @param props.content - card content; the pointer may rest on it, so it is
6
+ * readable and selectable, but it carries no dismissal affordance of its own.
7
+ * @param props.openDelayMs - hover dwell before the card shows (default 500).
8
+ * @param props.inline - keep the anchor in prose; show a contained preview on hover or keyboard focus.
9
+ * @param props.disabled - suppress opening; turning true closes an open card.
10
+ * @param props.copyText - optional primary value copied by activation and
11
+ * included in the card's accessible name.
12
+ * @param props.copyLabel - localized accessible activation-label prefix.
13
+ * @param props.copiedLabel - localized visible success label.
14
+ * @returns anchor wrapper with the conditional portaled card.
15
+ */
16
+ export declare function HoverCard({ anchor, content, openDelayMs, disabled, copyText, copyLabel, copiedLabel, inline, }: {
17
+ anchor: ReactNode;
18
+ /** Inline media preview using the shared menu material and keyboard focus. */
19
+ inline?: boolean;
20
+ content: ReactNode;
21
+ openDelayMs?: number;
22
+ disabled?: boolean;
23
+ } & ({
24
+ copyText?: string | undefined;
25
+ copyLabel: string;
26
+ copiedLabel: string;
27
+ } | {
28
+ copyText?: undefined;
29
+ copyLabel?: string;
30
+ copiedLabel?: string;
31
+ })): import("react").JSX.Element;
32
+ //# sourceMappingURL=HoverCard.d.ts.map
@@ -0,0 +1,27 @@
1
+ /** Lightbox strings the owner resolves from its own locale namespace. */
2
+ export interface ImageLightboxLabels {
3
+ /** Accessible name of the preview dialog. */
4
+ dialog: string;
5
+ /** Accessible label of the close control. */
6
+ close: string;
7
+ }
8
+ /**
9
+ * Document-level original-image preview opened by clicking a thumbnail.
10
+ * Closes on Escape, backdrop press, or the close control, and restores focus
11
+ * to the opener on unmount. Rendered through a body portal: an opener inside
12
+ * a transformed or filtered ancestor would otherwise trap the fixed backdrop
13
+ * in that ancestor's box instead of covering the viewport.
14
+ *
15
+ * @param props.src - the original image URL.
16
+ * @param props.alt - the image's alt text.
17
+ * @param props.labels - dialog and close-control strings.
18
+ * @param props.onClose - dismiss callback owned by the opener.
19
+ * @returns the modal preview dialog.
20
+ */
21
+ export declare function ImageLightbox({ src, alt, labels, onClose }: {
22
+ src: string;
23
+ alt: string;
24
+ labels: ImageLightboxLabels;
25
+ onClose: () => void;
26
+ }): import("react").ReactPortal;
27
+ //# sourceMappingURL=ImageLightbox.d.ts.map
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Render an image without introducing a second activation target.
3
+ * @param props - Source, accessible description, localized status.
4
+ * @returns A contained preview with loading or failure status.
5
+ */
6
+ export declare function ImagePreview({ src, alt, loadingLabel, failedLabel }: {
7
+ src: string;
8
+ alt: string;
9
+ loadingLabel: string;
10
+ failedLabel: string;
11
+ }): import("react").JSX.Element;
12
+ //# sourceMappingURL=ImagePreview.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { type InputHTMLAttributes, type ReactNode } from 'react';
2
+ /**
3
+ * Render a text input with an optional leading icon.
4
+ * @param props.icon - optional 16px leading icon node.
5
+ * @param ref - the native input, cleared when it unmounts.
6
+ * @returns wrapper span containing the native input; input attributes pass through.
7
+ */
8
+ export declare const Input: import("react").ForwardRefExoticComponent<{
9
+ icon?: ReactNode;
10
+ className?: string | undefined;
11
+ } & InputHTMLAttributes<HTMLInputElement> & import("react").RefAttributes<HTMLInputElement>>;
12
+ //# sourceMappingURL=Input.d.ts.map
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Display copy for the tree's copy affordance; the owner passes localized
3
+ * labels (this package is cordis-free, so copy arrives via props).
4
+ */
5
+ export interface JsonTreeLabels {
6
+ /** Menu item: copy the raw primitive value. */
7
+ copyValue: string;
8
+ /** Menu item: copy the value as compact JSON (primitive rows). */
9
+ copyJson: string;
10
+ /** Menu item: copy the property path. */
11
+ copyPath: string;
12
+ /** Menu item: copy the value as pretty-printed JSON. */
13
+ copyPrettyJson: string;
14
+ /** Menu item: copy the value as compact JSON (object rows). */
15
+ copyCompactJson: string;
16
+ /** Copy-button state label after a successful copy. */
17
+ copied: string;
18
+ /** Copy-button state label after a failed copy. */
19
+ copyFailed: string;
20
+ /** Expander aria label while expanded. */
21
+ collapseNode: string;
22
+ /** Expander aria label while collapsed. */
23
+ expandNode: string;
24
+ /** Copy-button tooltip, given the current action label. */
25
+ copyButtonTitle: (action: string) => string;
26
+ }
27
+ /** Props for the read-only, token-themed JSON tree. */
28
+ export interface JsonTreeProps {
29
+ /** Parsed JSON object or array. */
30
+ data: object | unknown[];
31
+ /** Accessible label for the tree. */
32
+ label: string;
33
+ /** Optional positioning class owned by the caller. */
34
+ className?: string | undefined;
35
+ /** Maximum visible lines per collapsed string; defaults to 3. */
36
+ collapsedStringLines?: number;
37
+ /** Optional wrap toggle; each expansion reads the shared default without changing other open strings. */
38
+ stringWrapping?: {
39
+ /** Localized label for the wrapping toggle. */
40
+ label: string;
41
+ /** Read the wrapping preference when a string is expanded. @returns Whether to wrap long lines. */
42
+ getDefault: () => boolean;
43
+ /** Remember a user toggle for future expansions. @param wrapped - Whether to wrap long lines. */
44
+ setDefault: (wrapped: boolean) => void;
45
+ } | undefined;
46
+ /** Whether JSON rows expose copy actions. */
47
+ copyable?: boolean;
48
+ /** Whether the top-level object or array is always expanded. */
49
+ expandTopLevel?: boolean;
50
+ /** Localized display copy supplied by the owning render site. */
51
+ labels: JsonTreeLabels;
52
+ }
53
+ /**
54
+ * Render parsed JSON as a compact, keyboard-accessible inspector tree.
55
+ * @param props - Parsed data, accessible label, and display options.
56
+ * @returns A read-only JSON tree with an optionally fixed-open top level.
57
+ */
58
+ export declare function JsonTree({ data, label, className, collapsedStringLines, stringWrapping, copyable, expandTopLevel, labels, }: JsonTreeProps): import("react").JSX.Element;
59
+ //# sourceMappingURL=JsonTree.d.ts.map
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Leading category glyph for clickable artifact links (anchors, file
3
+ * mentions, produced-file chips). One component keyed by link category;
4
+ * every glyph renders fill="currentColor" and so rides the link's own
5
+ * color. Glyphs stay private to this module: the public surface is the
6
+ * category vocabulary, not the individual glyph components, so consumers
7
+ * cannot compose a glyph outside a link. Design sources:
8
+ * ic_globe_language_outline_20, ic_code_outline_20, ic_folder_outline_20,
9
+ * ic_photo_outline_20, ic_paper_doc_outline_20, ic_paper_outline_20.
10
+ *
11
+ * A `url` glyph whose destination names a well-known site is that site's own
12
+ * mark instead of the globe (`SiteGlyph.tsx`); every mark keeps the same
13
+ * currentColor-only rule.
14
+ */
15
+ import type { ReactNode } from 'react';
16
+ import type { IconProps } from './icons/props.ts';
17
+ /**
18
+ * Link categories with distinct leading glyphs. `url` and `folder` are
19
+ * destination categories the consumer states directly; the rest are file
20
+ * categories `classifyLinkPath` derives from a path. Code, web, and data
21
+ * files share the `code` glyph by design.
22
+ */
23
+ export type LinkIconKind = 'url' | 'folder' | 'code' | 'image' | 'document' | 'other';
24
+ /** Props for {@link LinkIcon}: the category plus the shared icon sizing seat. */
25
+ export interface LinkIconProps extends IconProps {
26
+ kind: LinkIconKind;
27
+ /**
28
+ * Destination of a `url` link. A well-known site draws its own mark, so
29
+ * callers that know the destination should pass it; anything else keeps the
30
+ * globe. Other kinds ignore it — their destination is a path, not a site.
31
+ */
32
+ href?: string | undefined;
33
+ }
34
+ /**
35
+ * Derive a file path's link-icon category from its extension. Unknown and
36
+ * missing extensions fall to `other` (the plain-paper glyph).
37
+ * @param path - File path as the producing tool spelled it (either separator).
38
+ * @returns The file's glyph category; never `url` or `folder`.
39
+ */
40
+ export declare function classifyLinkPath(path: string): LinkIconKind;
41
+ /**
42
+ * Render the leading glyph for one clickable artifact link.
43
+ * @param props - The link category, the optional destination that can select a
44
+ * site mark, optional size (default 14px — the inline link text size these
45
+ * glyphs sit beside), and optional CSS class.
46
+ * @returns The category's SVG glyph, riding currentColor.
47
+ */
48
+ export declare function LinkIcon({ kind, href, size, className }: LinkIconProps): ReactNode;
49
+ //# sourceMappingURL=LinkIcon.d.ts.map