@chai-ui/react 0.1.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.
- package/DESIGN.md +207 -0
- package/LICENSE +21 -0
- package/README.md +265 -0
- package/dist/ChaiProvider.d.ts +49 -0
- package/dist/ChaiProvider.d.ts.map +1 -0
- package/dist/ChaiProvider.js +54 -0
- package/dist/ChaiProvider.js.map +1 -0
- package/dist/Composer.d.ts +169 -0
- package/dist/Composer.d.ts.map +1 -0
- package/dist/Composer.js +389 -0
- package/dist/Composer.js.map +1 -0
- package/dist/MediaAnalyzer.d.ts +102 -0
- package/dist/MediaAnalyzer.d.ts.map +1 -0
- package/dist/MediaAnalyzer.js +250 -0
- package/dist/MediaAnalyzer.js.map +1 -0
- package/dist/ResultCard.d.ts +55 -0
- package/dist/ResultCard.d.ts.map +1 -0
- package/dist/ResultCard.js +409 -0
- package/dist/ResultCard.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +11 -0
- package/dist/index.js.map +1 -0
- package/dist/primitives/Pagination.d.ts +19 -0
- package/dist/primitives/Pagination.d.ts.map +1 -0
- package/dist/primitives/Pagination.js +13 -0
- package/dist/primitives/Pagination.js.map +1 -0
- package/dist/primitives/SearchMenu.d.ts +69 -0
- package/dist/primitives/SearchMenu.d.ts.map +1 -0
- package/dist/primitives/SearchMenu.js +88 -0
- package/dist/primitives/SearchMenu.js.map +1 -0
- package/dist/primitives/Toggle.d.ts +9 -0
- package/dist/primitives/Toggle.d.ts.map +1 -0
- package/dist/primitives/Toggle.js +28 -0
- package/dist/primitives/Toggle.js.map +1 -0
- package/dist/primitives/index.d.ts +4 -0
- package/dist/primitives/index.d.ts.map +1 -0
- package/dist/primitives/index.js +4 -0
- package/dist/primitives/index.js.map +1 -0
- package/dist/style.css +1860 -0
- package/dist/use-latest.d.ts +7 -0
- package/dist/use-latest.d.ts.map +1 -0
- package/dist/use-latest.js +17 -0
- package/dist/use-latest.js.map +1 -0
- package/dist/useComposer.d.ts +75 -0
- package/dist/useComposer.d.ts.map +1 -0
- package/dist/useComposer.js +191 -0
- package/dist/useComposer.js.map +1 -0
- package/dist/useMediaAnalyzer.d.ts +37 -0
- package/dist/useMediaAnalyzer.d.ts.map +1 -0
- package/dist/useMediaAnalyzer.js +114 -0
- package/dist/useMediaAnalyzer.js.map +1 -0
- package/package.json +88 -0
- package/src/ChaiProvider.tsx +88 -0
- package/src/Composer.tsx +961 -0
- package/src/MediaAnalyzer.tsx +527 -0
- package/src/ResultCard.tsx +980 -0
- package/src/index.ts +36 -0
- package/src/primitives/Pagination.tsx +41 -0
- package/src/primitives/SearchMenu.tsx +284 -0
- package/src/primitives/Toggle.tsx +43 -0
- package/src/primitives/index.ts +3 -0
- package/src/style.css +1860 -0
- package/src/use-latest.ts +18 -0
- package/src/useComposer.ts +289 -0
- package/src/useMediaAnalyzer.ts +157 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { Pagination } from "./primitives/Pagination.js";
|
|
4
|
+
/**
|
|
5
|
+
* ResultCard's complement to Composer bar, and the last stop in the
|
|
6
|
+
* pipeline: by design there's no "use as input" action feeding a result
|
|
7
|
+
* back into a Composer.
|
|
8
|
+
*
|
|
9
|
+
* Renders the results from one prompt (reference: Figma "08 Result from
|
|
10
|
+
* Composer Bar") — a single result, or paginated through several (the
|
|
11
|
+
* "Image - Paginated" state) when more than one is handed in. That's a
|
|
12
|
+
* different thing from the still-unscoped plural `Results` grid/stack/
|
|
13
|
+
* carousel container — this card
|
|
14
|
+
* only ever shows what came back from one prompt, one candidate at a time,
|
|
15
|
+
* never a grid of separate prompts/history.
|
|
16
|
+
*/
|
|
17
|
+
// --- Formatting ------------------------------------------------------------
|
|
18
|
+
function formatDuration(ms) {
|
|
19
|
+
if (ms == null)
|
|
20
|
+
return undefined;
|
|
21
|
+
return `${(ms / 1000).toFixed(2)}s`;
|
|
22
|
+
}
|
|
23
|
+
function formatCost(usd) {
|
|
24
|
+
if (usd == null)
|
|
25
|
+
return undefined;
|
|
26
|
+
return `$${usd.toFixed(2)}`;
|
|
27
|
+
}
|
|
28
|
+
function formatTokens(total) {
|
|
29
|
+
if (total == null)
|
|
30
|
+
return undefined;
|
|
31
|
+
return `${total.toLocaleString()} tokens`;
|
|
32
|
+
}
|
|
33
|
+
function gcd(a, b) {
|
|
34
|
+
return b === 0 ? a : gcd(b, a % b);
|
|
35
|
+
}
|
|
36
|
+
/** A real, exactly-reduced ratio (e.g. 1024×768 → "4:3", 1920×1080 → "16:9") from the media's own measured dimensions — not a guess at the nearest "named" ratio, so an unusual crop just shows its own honest (if less familiar) reduced fraction instead of a misleading rounded one. */
|
|
37
|
+
function formatAspectRatio(width, height) {
|
|
38
|
+
if (!width || !height)
|
|
39
|
+
return undefined;
|
|
40
|
+
const w = Math.round(width);
|
|
41
|
+
const h = Math.round(height);
|
|
42
|
+
const divisor = gcd(w, h);
|
|
43
|
+
if (!divisor)
|
|
44
|
+
return undefined;
|
|
45
|
+
return `${w / divisor}:${h / divisor}`;
|
|
46
|
+
}
|
|
47
|
+
/** A real extension from the URL itself when there is one, otherwise a sensible guess by kind — used only for the downloaded file's suggested name, not anything that affects the actual bytes. */
|
|
48
|
+
function guessDownloadFilename(result) {
|
|
49
|
+
const kind = result.output?.kind ?? "file";
|
|
50
|
+
const src = result.output?.src ?? "";
|
|
51
|
+
const match = /\.([a-zA-Z0-9]{2,5})(?:[?#]|$)/.exec(src);
|
|
52
|
+
const ext = match?.[1] ?? (kind === "video" ? "mp4" : kind === "audio" ? "mp3" : kind === "text" ? "txt" : "png");
|
|
53
|
+
return `${kind}-${result.id}.${ext}`;
|
|
54
|
+
}
|
|
55
|
+
// --- Component ------------------------------------------------------------
|
|
56
|
+
export function ResultCard({ results, width, textMaxHeight, prompt, altText, models, getVote, onAction, moreActions, disabled, }) {
|
|
57
|
+
const [activeIndex, setActiveIndex] = useState(0);
|
|
58
|
+
const [flipped, setFlipped] = useState(false);
|
|
59
|
+
const [moreOpen, setMoreOpen] = useState(false);
|
|
60
|
+
const [copied, setCopied] = useState(false);
|
|
61
|
+
const [mediaExpanded, setMediaExpanded] = useState(false);
|
|
62
|
+
// Not part of `Result` (no engine reports generated-media dimensions
|
|
63
|
+
// today) — measured client-side off the loaded `<img>`/`<video>` itself
|
|
64
|
+
// (`naturalWidth`/`naturalHeight`, `videoWidth`/`videoHeight`) purely to
|
|
65
|
+
// back the info side's aspect-ratio chip. Kept with the id of the result
|
|
66
|
+
// it was measured from, so after pagination a stale ratio from the
|
|
67
|
+
// *previous* result can't flash before the new media finishes loading.
|
|
68
|
+
const [measured, setMeasured] = useState(null);
|
|
69
|
+
const videoTimeRef = useRef(0);
|
|
70
|
+
// The face that's turned away is `inert`, so its buttons can't be tabbed
|
|
71
|
+
// to. Set as a DOM property: React 18 and 19 treat the `inert` attribute
|
|
72
|
+
// differently.
|
|
73
|
+
const frontRef = useRef(null);
|
|
74
|
+
const backRef = useRef(null);
|
|
75
|
+
useEffect(() => {
|
|
76
|
+
if (frontRef.current)
|
|
77
|
+
frontRef.current.inert = flipped;
|
|
78
|
+
if (backRef.current)
|
|
79
|
+
backRef.current.inert = !flipped;
|
|
80
|
+
});
|
|
81
|
+
// Flipping moves focus to the side now showing, so a keyboard user isn't
|
|
82
|
+
// left on a button that just turned away. Skipped on first render.
|
|
83
|
+
const wasFlipped = useRef(flipped);
|
|
84
|
+
useEffect(() => {
|
|
85
|
+
if (wasFlipped.current === flipped)
|
|
86
|
+
return;
|
|
87
|
+
wasFlipped.current = flipped;
|
|
88
|
+
const target = flipped
|
|
89
|
+
? backRef.current?.querySelector('[aria-label="Close details"]')
|
|
90
|
+
: frontRef.current?.querySelector('[aria-label="Show details"]');
|
|
91
|
+
target?.focus();
|
|
92
|
+
}, [flipped]);
|
|
93
|
+
// The expanded view is a modal dialog: focus moves in, Tab stays inside,
|
|
94
|
+
// Escape closes, and focus returns to what opened it.
|
|
95
|
+
const overlayRef = useRef(null);
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (!mediaExpanded)
|
|
98
|
+
return;
|
|
99
|
+
overlayRef.current?.querySelector(".chai-result-card__collapse")?.focus();
|
|
100
|
+
// On close, back to Expand, the only way in. Looked up at close time:
|
|
101
|
+
// the card re-renders its media buttons while expanded.
|
|
102
|
+
const front = frontRef.current;
|
|
103
|
+
return () => front?.querySelector('[aria-label="Expand"]')?.focus();
|
|
104
|
+
}, [mediaExpanded]);
|
|
105
|
+
function handleOverlayKeyDown(e) {
|
|
106
|
+
if (e.key === "Escape") {
|
|
107
|
+
e.stopPropagation();
|
|
108
|
+
setMediaExpanded(false);
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (e.key !== "Tab")
|
|
112
|
+
return;
|
|
113
|
+
const focusable = [
|
|
114
|
+
...e.currentTarget.querySelectorAll('button, [tabindex="0"], a[href], input, video[controls]'),
|
|
115
|
+
].filter((el) => !el.hasAttribute("disabled"));
|
|
116
|
+
if (focusable.length === 0)
|
|
117
|
+
return;
|
|
118
|
+
const first = focusable[0];
|
|
119
|
+
const last = focusable[focusable.length - 1];
|
|
120
|
+
if (e.shiftKey && document.activeElement === first) {
|
|
121
|
+
e.preventDefault();
|
|
122
|
+
last.focus();
|
|
123
|
+
}
|
|
124
|
+
else if (!e.shiftKey && document.activeElement === last) {
|
|
125
|
+
e.preventDefault();
|
|
126
|
+
first.focus();
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// State, not a ref: the player reads it while rendering, and it only
|
|
130
|
+
// changes on play/pause.
|
|
131
|
+
const [videoWasPlaying, setVideoWasPlaying] = useState(false);
|
|
132
|
+
const clampedIndex = Math.min(activeIndex, Math.max(0, results.length - 1));
|
|
133
|
+
const result = results[clampedIndex];
|
|
134
|
+
const mediaDims = measured && measured.id === result?.id ? measured : null;
|
|
135
|
+
if (!result)
|
|
136
|
+
return null;
|
|
137
|
+
const vote = getVote?.(result) ?? null;
|
|
138
|
+
const modelLabel = models?.find((m) => m.id === result.modelId)?.label ?? result.modelId;
|
|
139
|
+
const duration = formatDuration(result.durationMs);
|
|
140
|
+
const cost = formatCost(result.usage?.costUsd);
|
|
141
|
+
const tokens = formatTokens(result.usage?.totalTokens);
|
|
142
|
+
const aspectRatio = mediaDims ? formatAspectRatio(mediaDims.width, mediaDims.height) : undefined;
|
|
143
|
+
// Arrow expressions, not function declarations — a hoisted declaration
|
|
144
|
+
// doesn't inherit the `if (!result) return null;` narrowing above (a
|
|
145
|
+
// known TS limitation, not stylistic), so every one of these closing
|
|
146
|
+
// over `result` needs to be an expression instead.
|
|
147
|
+
const goTo = (index) => {
|
|
148
|
+
setActiveIndex(Math.max(0, Math.min(results.length - 1, index)));
|
|
149
|
+
};
|
|
150
|
+
const handleCopyPrompt = () => {
|
|
151
|
+
navigator.clipboard?.writeText(prompt).catch(() => { });
|
|
152
|
+
setCopied(true);
|
|
153
|
+
setTimeout(() => setCopied(false), 1500);
|
|
154
|
+
onAction("copy-prompt", result);
|
|
155
|
+
};
|
|
156
|
+
const handleDownload = async () => {
|
|
157
|
+
if (result.output) {
|
|
158
|
+
// A plain `<a download href={remoteUrl}>` only forces a real download
|
|
159
|
+
// for a same-origin or `blob:`/`data:` URL — for anything else
|
|
160
|
+
// (a normal cross-origin CDN url, which is what a real generated
|
|
161
|
+
// result's `src` almost always is) browsers ignore `download` and
|
|
162
|
+
// just navigate/open it instead, which is exactly the "pops a tab"
|
|
163
|
+
// behavior this replaces. Fetching it into a blob first sidesteps
|
|
164
|
+
// that: a blob: URL is always same-origin, so `download` works
|
|
165
|
+
// reliably regardless of where the media actually lives.
|
|
166
|
+
try {
|
|
167
|
+
const response = await fetch(result.output.src);
|
|
168
|
+
const blob = await response.blob();
|
|
169
|
+
const blobUrl = URL.createObjectURL(blob);
|
|
170
|
+
const a = document.createElement("a");
|
|
171
|
+
a.href = blobUrl;
|
|
172
|
+
a.download = guessDownloadFilename(result);
|
|
173
|
+
document.body.appendChild(a);
|
|
174
|
+
a.click();
|
|
175
|
+
a.remove();
|
|
176
|
+
URL.revokeObjectURL(blobUrl);
|
|
177
|
+
}
|
|
178
|
+
catch {
|
|
179
|
+
// The one case this can't force: the source not allowing
|
|
180
|
+
// cross-origin fetches (no CORS headers) or a real network
|
|
181
|
+
// failure. Opening it directly is the best fallback available —
|
|
182
|
+
// still better than silently doing nothing.
|
|
183
|
+
window.open(result.output.src, "_blank", "noopener");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
onAction("download", result);
|
|
187
|
+
};
|
|
188
|
+
const handleShare = async () => {
|
|
189
|
+
if (result.output && navigator.share) {
|
|
190
|
+
try {
|
|
191
|
+
await navigator.share({ url: result.output.src });
|
|
192
|
+
}
|
|
193
|
+
catch {
|
|
194
|
+
// Cancelled or unsupported for this src — fall through silently, same as a native share sheet dismissal.
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
else if (result.output) {
|
|
198
|
+
navigator.clipboard?.writeText(result.output.src).catch(() => { });
|
|
199
|
+
}
|
|
200
|
+
onAction("share", result);
|
|
201
|
+
};
|
|
202
|
+
const isVideo = result.output?.kind === "video";
|
|
203
|
+
return (_jsxs(_Fragment, { children: [_jsx("div", { className: `chai-result-card${flipped ? " chai-result-card--flipped" : ""}`, style: {
|
|
204
|
+
...(width != null && { "--chai-result-card-width": `${width}px` }),
|
|
205
|
+
...(textMaxHeight != null && { "--chai-result-card-text-max-height": `${textMaxHeight}px` }),
|
|
206
|
+
}, children: _jsxs("div", { className: "chai-result-card__inner", children: [_jsxs("div", { ref: frontRef, className: "chai-result-card__face chai-result-card__front", "aria-hidden": flipped, children: [_jsx(ResultMedia, { result: result, alt: altText?.(result) ?? prompt, disabled: disabled, mediaExpanded: mediaExpanded, onDownload: handleDownload, onShare: handleShare, onExpand: () => setMediaExpanded(true), onDimensions: (w, h) => setMeasured({ id: result.id, width: w, height: h }), videoTimeRef: videoTimeRef, videoWasPlaying: videoWasPlaying, onVideoPlayingChange: setVideoWasPlaying }), _jsxs("div", { className: "chai-result-card__bar", children: [_jsxs("div", { className: "chai-result-card__bar-row", children: [_jsxs("div", { className: "chai-result-card__bar-start", children: [_jsx(ResultIconButton, { label: "Like", active: vote === "like", disabled: disabled, onClick: () => onAction("like", result), children: _jsx(ThumbUpIcon, {}) }), _jsx(ResultIconButton, { label: "Dislike", active: vote === "dislike", disabled: disabled, onClick: () => onAction("dislike", result), children: _jsx(ThumbDownIcon, {}) }), _jsx(ResultIconButton, { label: "Retry", disabled: disabled, onClick: () => onAction("retry", result), children: _jsx(RefreshIcon, {}) }), moreActions && moreActions.length > 0 && (_jsx(MoreMenu, { actions: moreActions, open: moreOpen, onOpenChange: setMoreOpen, disabled: disabled, onSelect: (action) => onAction(action.id, result) }))] }), _jsx(ResultIconButton, { label: "Show details", disabled: disabled, onClick: () => setFlipped(true), children: _jsx(InfoIcon, {}) })] }), results.length > 1 && (_jsx(Pagination, { count: results.length, index: clampedIndex, onChange: goTo, label: "Results", disabled: disabled }))] })] }), _jsxs("div", { ref: backRef, className: "chai-result-card__face chai-result-card__back", "aria-hidden": !flipped, children: [_jsx("button", { type: "button", className: "chai-result-card__close", "aria-label": "Close details", onClick: () => setFlipped(false), children: _jsx(CloseIcon, {}) }), _jsxs("div", { className: "chai-result-card__prompt-box", children: [_jsx("p", { className: "chai-result-card__prompt-text", children: prompt }), _jsx("button", { type: "button", className: "chai-result-card__copy", "aria-label": copied ? "Copied" : "Copy prompt", title: copied ? "Copied" : "Copy prompt", onClick: handleCopyPrompt, children: copied ? _jsx(CheckIcon, {}) : _jsx(CopyIcon, {}) })] }), _jsxs("div", { className: "chai-result-card__chips", children: [_jsx("span", { className: "chai-result-card__chip", children: modelLabel }), tokens && _jsx("span", { className: "chai-result-card__chip", children: tokens }), cost && _jsx("span", { className: "chai-result-card__chip", children: cost }), duration && _jsx("span", { className: "chai-result-card__chip", children: duration }), aspectRatio && _jsx("span", { className: "chai-result-card__chip", children: aspectRatio }), result.evaluations?.map((evaluation) => (_jsxs("span", { className: `chai-result-card__chip chai-result-card__chip--evaluation chai-result-card__chip--${evaluation.passed ? "passed" : "failed"}`, title: `${evaluation.label}: ${evaluation.passed ? "passed" : "failed"}`, children: [evaluation.passed ? _jsx(CheckIcon, {}) : _jsx(CloseIcon, {}), evaluation.label, _jsx("span", { className: "chai-visually-hidden", children: evaluation.passed ? ", passed" : ", failed" })] }, evaluation.id)))] })] })] }) }), mediaExpanded && result.output && (result.output.kind === "image" || isVideo) && (_jsxs("div", { ref: overlayRef, className: "chai-result-card__expand-overlay", role: "dialog", "aria-modal": "true", "aria-label": isVideo ? "Expanded video" : "Expanded image", onKeyDown: handleOverlayKeyDown, children: [_jsx("div", { className: "chai-result-card__expand-scrim", role: "presentation", onClick: () => setMediaExpanded(false) }), _jsxs("div", { className: "chai-result-card__expand-frame", children: [isVideo ? (_jsx(ResultVideoPlayer, { src: result.output.src, expanded: true, timeRef: videoTimeRef, wasPlaying: videoWasPlaying, onPlayingChange: setVideoWasPlaying })) : (_jsx("img", { className: "chai-result-card__image", src: result.output.src, alt: altText?.(result) ?? prompt })), _jsx("button", { type: "button", className: "chai-result-card__collapse", "aria-label": "Collapse", onClick: () => setMediaExpanded(false), children: _jsx(CloseIcon, {}) })] })] }))] }));
|
|
207
|
+
}
|
|
208
|
+
// --- Media (image / video / audio / text, by status) ------------------------------------------------------------
|
|
209
|
+
function ResultMedia({ result, alt, disabled, mediaExpanded, onDownload, onShare, onExpand, onDimensions, videoTimeRef, videoWasPlaying, onVideoPlayingChange, }) {
|
|
210
|
+
const isVideo = result.output?.kind === "video";
|
|
211
|
+
const isImage = result.output?.kind === "image";
|
|
212
|
+
// "Running with output" is a text result streaming in (see `streamResult`
|
|
213
|
+
// in @chai-ui/core) — show the partial text, not the spinner.
|
|
214
|
+
const streaming = result.status === "running" && result.output?.kind === "text";
|
|
215
|
+
if ((result.status === "queued" || result.status === "running") && !streaming) {
|
|
216
|
+
return (_jsx("div", { className: "chai-result-card__media chai-result-card__media--pending", children: _jsx("span", { className: "chai-result-card__spinner", "aria-label": result.status === "running" ? "Running" : "Queued" }) }));
|
|
217
|
+
}
|
|
218
|
+
// Stopped before any output: say so. A streamed text result that was
|
|
219
|
+
// stopped keeps its partial text and renders below like any other.
|
|
220
|
+
if (result.status === "cancelled" && !result.output) {
|
|
221
|
+
return (_jsx("div", { className: "chai-result-card__media chai-result-card__media--cancelled", children: _jsx("p", { className: "chai-result-card__cancelled-text", children: "Stopped" }) }));
|
|
222
|
+
}
|
|
223
|
+
if (result.status === "error") {
|
|
224
|
+
return (_jsx("div", { className: "chai-result-card__media chai-result-card__media--error", children: _jsx("p", { className: "chai-result-card__error-text", children: result.error?.message ?? "Something went wrong." }) }));
|
|
225
|
+
}
|
|
226
|
+
if (!result.output)
|
|
227
|
+
return _jsx("div", { className: "chai-result-card__media" });
|
|
228
|
+
return (_jsxs("div", { className: `chai-result-card__media${result.output.kind === "audio" || result.output.kind === "text"
|
|
229
|
+
? " chai-result-card__media--fixed-height"
|
|
230
|
+
: ""}`, children: [result.output.kind === "video" ? (mediaExpanded ? (
|
|
231
|
+
// The real, playing `<video>` lives in the expand overlay (a
|
|
232
|
+
// sibling of the whole card — see that overlay's own comment for
|
|
233
|
+
// why) while it's open; this card face just shows a plain
|
|
234
|
+
// frozen frame in its place so the layout doesn't collapse.
|
|
235
|
+
_jsx("img", { className: "chai-result-card__image", src: result.output.src, alt: "" })) : (_jsx(ResultVideoPlayer, { src: result.output.src, timeRef: videoTimeRef, wasPlaying: videoWasPlaying, onPlayingChange: onVideoPlayingChange, onDimensions: onDimensions }))) : result.output.kind === "audio" ? (_jsx("audio", { className: "chai-result-card__audio", src: result.output.src, controls: true })) : result.output.kind === "text" ? (_jsx(ResultText, { text: result.output.src, streaming: streaming })) : (_jsx("img", { className: "chai-result-card__image", src: result.output.src, alt: alt, onLoad: (e) => {
|
|
236
|
+
const el = e.currentTarget;
|
|
237
|
+
onDimensions(el.naturalWidth, el.naturalHeight);
|
|
238
|
+
} })), !mediaExpanded && !streaming && (_jsxs("div", { className: "chai-result-card__media-actions", children: [_jsx(ResultIconButton, { label: "Download", disabled: disabled, onClick: onDownload, children: _jsx(DownloadIcon, {}) }), _jsx(ResultIconButton, { label: "Share", disabled: disabled, onClick: onShare, children: _jsx(ShareIcon, {}) }), (isVideo || isImage) && (_jsx(ResultIconButton, { label: "Expand", disabled: disabled, onClick: onExpand, children: _jsx(ExpandIcon, {}) }))] }))] }));
|
|
239
|
+
}
|
|
240
|
+
/**
|
|
241
|
+
* A text result, streaming or finished. One element for both states, so the
|
|
242
|
+
* scroll position survives the moment a stream completes. Past its max
|
|
243
|
+
* height it scrolls; while streaming it follows the newest text, unless the
|
|
244
|
+
* person has scrolled up to read, in which case it stays where they are.
|
|
245
|
+
*/
|
|
246
|
+
function ResultText({ text, streaming }) {
|
|
247
|
+
const ref = useRef(null);
|
|
248
|
+
const followRef = useRef(true);
|
|
249
|
+
useEffect(() => {
|
|
250
|
+
const el = ref.current;
|
|
251
|
+
if (el && streaming && followRef.current)
|
|
252
|
+
el.scrollTop = el.scrollHeight;
|
|
253
|
+
}, [text, streaming]);
|
|
254
|
+
return (_jsx("p", { ref: ref, className: `chai-result-card__text-output${streaming ? " chai-result-card__text-output--streaming" : ""}`, "aria-busy": streaming,
|
|
255
|
+
// Keyboard users can scroll a long answer.
|
|
256
|
+
tabIndex: 0, onScroll: (e) => {
|
|
257
|
+
const el = e.currentTarget;
|
|
258
|
+
followRef.current = el.scrollTop + el.clientHeight >= el.scrollHeight - 24;
|
|
259
|
+
}, children: text }));
|
|
260
|
+
}
|
|
261
|
+
/**
|
|
262
|
+
* A real `<video>` element plus custom play/pause + scrubber chrome built
|
|
263
|
+
* on its own playback API (`currentTime`, `duration`, the `timeupdate`
|
|
264
|
+
* event) — not the browser's native `controls` UI (reads as a different,
|
|
265
|
+
* heavier chrome than the mock's slim in-card scrubber) and not a
|
|
266
|
+
* from-scratch player (nothing here decodes or renders video itself, the
|
|
267
|
+
* real `<video>` element still does all of that).
|
|
268
|
+
*
|
|
269
|
+
* Used in two different mount points (inline in the card, and again in the
|
|
270
|
+
* expand overlay — see that overlay's own comment on why it can't just be
|
|
271
|
+
* the same element repositioned) — `timeRef`/`wasPlaying` are what let
|
|
272
|
+
* whichever one mounts pick up exactly where the other left off: seeded on
|
|
273
|
+
* mount, kept live on every timeupdate/play/pause so the *other* instance
|
|
274
|
+
* has an up-to-date value whenever it mounts next.
|
|
275
|
+
*/
|
|
276
|
+
function ResultVideoPlayer({ src, expanded, timeRef, wasPlaying, onPlayingChange, onDimensions, }) {
|
|
277
|
+
const videoRef = useRef(null);
|
|
278
|
+
const [playing, setPlaying] = useState(wasPlaying);
|
|
279
|
+
const [progress, setProgress] = useState(0);
|
|
280
|
+
function togglePlay() {
|
|
281
|
+
const el = videoRef.current;
|
|
282
|
+
if (!el)
|
|
283
|
+
return;
|
|
284
|
+
if (el.paused)
|
|
285
|
+
el.play();
|
|
286
|
+
else
|
|
287
|
+
el.pause();
|
|
288
|
+
}
|
|
289
|
+
function handleScrub(e) {
|
|
290
|
+
const el = videoRef.current;
|
|
291
|
+
if (!el || !el.duration)
|
|
292
|
+
return;
|
|
293
|
+
const rect = e.currentTarget.getBoundingClientRect();
|
|
294
|
+
const ratio = Math.min(1, Math.max(0, (e.clientX - rect.left) / rect.width));
|
|
295
|
+
el.currentTime = ratio * el.duration;
|
|
296
|
+
}
|
|
297
|
+
// Keyboard seeking, the slider pattern: arrows move 5s, Home/End jump.
|
|
298
|
+
function handleScrubKey(e) {
|
|
299
|
+
const el = videoRef.current;
|
|
300
|
+
if (!el || !el.duration)
|
|
301
|
+
return;
|
|
302
|
+
const step = { ArrowRight: 5, ArrowUp: 5, ArrowLeft: -5, ArrowDown: -5 }[e.key];
|
|
303
|
+
if (step != null)
|
|
304
|
+
el.currentTime = Math.min(el.duration, Math.max(0, el.currentTime + step));
|
|
305
|
+
else if (e.key === "Home")
|
|
306
|
+
el.currentTime = 0;
|
|
307
|
+
else if (e.key === "End")
|
|
308
|
+
el.currentTime = el.duration;
|
|
309
|
+
else
|
|
310
|
+
return;
|
|
311
|
+
e.preventDefault();
|
|
312
|
+
}
|
|
313
|
+
return (_jsxs(_Fragment, { children: [_jsx("video", { ref: videoRef, className: "chai-result-card__video", src: src, onLoadedMetadata: (e) => {
|
|
314
|
+
const el = e.currentTarget;
|
|
315
|
+
el.currentTime = timeRef.current;
|
|
316
|
+
if (wasPlaying)
|
|
317
|
+
el.play().catch(() => { });
|
|
318
|
+
onDimensions?.(el.videoWidth, el.videoHeight);
|
|
319
|
+
}, onPlay: () => {
|
|
320
|
+
setPlaying(true);
|
|
321
|
+
onPlayingChange(true);
|
|
322
|
+
}, onPause: () => {
|
|
323
|
+
setPlaying(false);
|
|
324
|
+
onPlayingChange(false);
|
|
325
|
+
}, onTimeUpdate: (e) => {
|
|
326
|
+
const el = e.currentTarget;
|
|
327
|
+
timeRef.current = el.currentTime;
|
|
328
|
+
if (el.duration)
|
|
329
|
+
setProgress(el.currentTime / el.duration);
|
|
330
|
+
} }), _jsx("button", { type: "button", className: "chai-result-card__video-toggle", "aria-label": playing ? "Pause" : "Play", onClick: togglePlay, children: !playing && (_jsx("span", { className: "chai-result-card__play", children: _jsx(PlayIcon, {}) })) }), _jsx("div", { className: `chai-result-card__scrubber${expanded ? " chai-result-card__scrubber--expanded" : ""}`, role: "slider", tabIndex: 0, "aria-label": "Seek", "aria-valuemin": 0, "aria-valuemax": 100, "aria-valuenow": Math.round(progress * 100), "aria-valuetext": `${Math.round(progress * 100)}%`, onClick: handleScrub, onKeyDown: handleScrubKey, children: _jsx("div", { className: "chai-result-card__scrubber-fill", style: { width: `${progress * 100}%` } }) })] }));
|
|
331
|
+
}
|
|
332
|
+
// --- Shared icon button (the hover circle — reference: the design note that the "like" button's hover treatment in the mock applies to every small icon button on the card) ------------------------------------------------------------
|
|
333
|
+
function ResultIconButton({ children, label, active, disabled, onClick, }) {
|
|
334
|
+
return (_jsx("button", { type: "button", className: `chai-result-card__icon-btn${active ? " chai-result-card__icon-btn--active" : ""}`, "aria-label": label, "aria-pressed": active, title: label, disabled: disabled, onClick: onClick, children: children }));
|
|
335
|
+
}
|
|
336
|
+
// --- More menu (reference: Figma "Result Card - More menu expanded") — same hand-rolled positioned-popover pattern Composer.tsx's own ComposerAttachMenu documents, for the same reason (needs to live inline under its own trigger). ------------------------------------------------------------
|
|
337
|
+
function MoreMenu({ actions, open, onOpenChange, disabled, onSelect, }) {
|
|
338
|
+
const rootRef = useRef(null);
|
|
339
|
+
useEffect(() => {
|
|
340
|
+
if (!open)
|
|
341
|
+
return;
|
|
342
|
+
function handlePointerDown(e) {
|
|
343
|
+
if (!rootRef.current?.contains(e.target))
|
|
344
|
+
onOpenChange(false);
|
|
345
|
+
}
|
|
346
|
+
function handleKeyDown(e) {
|
|
347
|
+
if (e.key === "Escape")
|
|
348
|
+
onOpenChange(false);
|
|
349
|
+
}
|
|
350
|
+
document.addEventListener("pointerdown", handlePointerDown);
|
|
351
|
+
document.addEventListener("keydown", handleKeyDown);
|
|
352
|
+
return () => {
|
|
353
|
+
document.removeEventListener("pointerdown", handlePointerDown);
|
|
354
|
+
document.removeEventListener("keydown", handleKeyDown);
|
|
355
|
+
};
|
|
356
|
+
}, [open, onOpenChange]);
|
|
357
|
+
return (_jsxs("div", { className: "chai-result-card__more", ref: rootRef, children: [_jsx(ResultIconButton, { label: "More", active: open, disabled: disabled, onClick: () => onOpenChange(!open), children: _jsx(MoreHorizIcon, {}) }), open && (_jsx("ul", { className: "chai-result-card__more-menu", role: "menu", children: actions.map((action) => (_jsx("li", { role: "none", children: _jsxs("button", { type: "button", role: "menuitem", className: "chai-result-card__more-menu-item", onClick: () => {
|
|
358
|
+
onOpenChange(false);
|
|
359
|
+
onSelect(action);
|
|
360
|
+
}, children: [action.icon && _jsx("span", { className: "chai-result-card__more-menu-icon", children: action.icon }), action.label] }) }, action.id))) }))] }));
|
|
361
|
+
}
|
|
362
|
+
// --- Icons ------------------------------------------------------------
|
|
363
|
+
// Traced from the design's exported assets ("Result from Composer Bar") — same "trace and inline as a
|
|
364
|
+
// currentColor component" convention Composer.tsx documents, icons aren't
|
|
365
|
+
// shared across files yet in this codebase. `PlayIcon`/`PauseIcon`/
|
|
366
|
+
// `ExpandIcon` aren't in the mock itself (its video state has no separate
|
|
367
|
+
// play-button layer — the triangle in the reference screenshot is baked
|
|
368
|
+
// into that frame's placeholder photo, not a real asset) — real Material
|
|
369
|
+
// Symbols glyphs / a simple hand-drawn corner-bracket mark instead.
|
|
370
|
+
function ThumbUpIcon() {
|
|
371
|
+
return (_jsx("svg", { viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M5.25039 15.7502V6.00019L10.5004 0.750193L11.8879 2.13769L10.9129 6.00019H17.2504V9.30019L14.5129 15.7502H5.25039ZM6.75039 14.2502H13.5004L15.7504 9.00019V7.50019H9.00039L10.0129 3.37519L6.75039 6.63769V14.2502ZM1.50039 15.7502V6.00019H5.25039V7.50019H3.00039V14.2502H5.25039V15.7502H1.50039Z", fill: "currentColor" }) }));
|
|
372
|
+
}
|
|
373
|
+
function ThumbDownIcon() {
|
|
374
|
+
return (_jsx("svg", { viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M2.24961 12C1.84961 12 1.49961 11.85 1.19961 11.55C0.899615 11.25 0.749615 10.9 0.749615 10.5V9C0.749615 8.9125 0.762115 8.81875 0.787115 8.71875C0.812115 8.61875 0.837115 8.525 0.862115 8.4375L3.11211 3.15C3.22461 2.9 3.41211 2.6875 3.67461 2.5125C3.93711 2.3375 4.21211 2.25 4.49961 2.25H12.7496V12L8.24961 16.4625C8.06211 16.65 7.84024 16.7594 7.58399 16.7906C7.32774 16.8219 7.08086 16.775 6.84336 16.65C6.60586 16.525 6.43086 16.35 6.31836 16.125C6.20586 15.9 6.18086 15.6688 6.24336 15.4313L7.08711 12H2.24961ZM11.2496 11.3625V3.75H4.49961L2.24961 9V10.5H8.99961L7.98711 14.625L11.2496 11.3625ZM14.9996 2.25C15.4121 2.25 15.7652 2.39688 16.059 2.69063C16.3527 2.98438 16.4996 3.3375 16.4996 3.75V10.5C16.4996 10.9125 16.3527 11.2656 16.059 11.5594C15.7652 11.8531 15.4121 12 14.9996 12H12.7496V10.5H14.9996V3.75H12.7496V2.25H14.9996Z", fill: "currentColor" }) }));
|
|
375
|
+
}
|
|
376
|
+
function RefreshIcon() {
|
|
377
|
+
return (_jsx("svg", { viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M8.99961 15.0002C7.32461 15.0002 5.90586 14.4189 4.74336 13.2564C3.58086 12.0939 2.99961 10.6752 2.99961 9.00019C2.99961 7.32519 3.58086 5.90644 4.74336 4.74394C5.90586 3.58144 7.32461 3.00019 8.99961 3.00019C9.86211 3.00019 10.6871 3.17832 11.4746 3.53457C12.2621 3.89082 12.9371 4.40019 13.4996 5.06269V3.00019H14.9996V8.25019H9.74961V6.75019H12.8996C12.4996 6.05019 11.9527 5.50019 11.259 5.10019C10.5652 4.70019 9.81211 4.50019 8.99961 4.50019C7.74961 4.50019 6.68711 4.93769 5.81211 5.81269C4.93711 6.68769 4.49961 7.75019 4.49961 9.00019C4.49961 10.2502 4.93711 11.3127 5.81211 12.1877C6.68711 13.0627 7.74961 13.5002 8.99961 13.5002C9.96211 13.5002 10.8309 13.2252 11.6059 12.6752C12.3809 12.1252 12.9246 11.4002 13.2371 10.5002H14.8121C14.4621 11.8252 13.7496 12.9064 12.6746 13.7439C11.5996 14.5814 10.3746 15.0002 8.99961 15.0002Z", fill: "currentColor" }) }));
|
|
378
|
+
}
|
|
379
|
+
function MoreHorizIcon() {
|
|
380
|
+
return (_jsx("svg", { viewBox: "0 0 24 24", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M6.41473 14C5.86473 14 5.3939 13.8042 5.00223 13.4125C4.61056 13.0208 4.41473 12.55 4.41473 12C4.41473 11.45 4.61056 10.9792 5.00223 10.5875C5.3939 10.1958 5.86473 10 6.41473 10C6.96473 10 7.43556 10.1958 7.82723 10.5875C8.2189 10.9792 8.41473 11.45 8.41473 12C8.41473 12.55 8.2189 13.0208 7.82723 13.4125C7.43556 13.8042 6.96473 14 6.41473 14ZM12.4147 14C11.8647 14 11.3939 13.8042 11.0022 13.4125C10.6106 13.0208 10.4147 12.55 10.4147 12C10.4147 11.45 10.6106 10.9792 11.0022 10.5875C11.3939 10.1958 11.8647 10 12.4147 10C12.9647 10 13.4356 10.1958 13.8272 10.5875C14.2189 10.9792 14.4147 11.45 14.4147 12C14.4147 12.55 14.2189 13.0208 13.8272 13.4125C13.4356 13.8042 12.9647 14 12.4147 14ZM18.4147 14C17.8647 14 17.3939 13.8042 17.0022 13.4125C16.6106 13.0208 16.4147 12.55 16.4147 12C16.4147 11.45 16.6106 10.9792 17.0022 10.5875C17.3939 10.1958 17.8647 10 18.4147 10C18.9647 10 19.4356 10.1958 19.8272 10.5875C20.2189 10.9792 20.4147 11.45 20.4147 12C20.4147 12.55 20.2189 13.0208 19.8272 13.4125C19.4356 13.8042 18.9647 14 18.4147 14Z", fill: "currentColor" }) }));
|
|
381
|
+
}
|
|
382
|
+
function ShareIcon() {
|
|
383
|
+
return (_jsx("svg", { viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M2.99961 16.4999V5.9999H6.74961V7.4999H4.49961V14.9999H13.4996V7.4999H11.2496V5.9999H14.9996V16.4999H2.99961ZM8.24961 11.9999V3.61865L7.04961 4.81865L5.99961 3.7499L8.99961 0.749904L11.9996 3.7499L10.9496 4.81865L9.74961 3.61865V11.9999H8.24961Z", fill: "currentColor" }) }));
|
|
384
|
+
}
|
|
385
|
+
function DownloadIcon() {
|
|
386
|
+
return (_jsx("svg", { viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M8.99961 11.9999L5.24961 8.2499L6.29961 7.1624L8.24961 9.1124V2.9999H9.74961V9.1124L11.6996 7.1624L12.7496 8.2499L8.99961 11.9999ZM2.99961 14.9999V11.2499H4.49961V13.4999H13.4996V11.2499H14.9996V14.9999H2.99961Z", fill: "currentColor" }) }));
|
|
387
|
+
}
|
|
388
|
+
function InfoIcon() {
|
|
389
|
+
return (_jsx("svg", { viewBox: "0 0 22 22", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M10.0833 6.41667H11.9167V8.25H10.0833V6.41667ZM10.0833 10.0833H11.9167V15.5833H10.0833V10.0833ZM11 1.83333C5.94 1.83333 1.83333 5.94 1.83333 11C1.83333 16.06 5.94 20.1667 11 20.1667C16.06 20.1667 20.1667 16.06 20.1667 11C20.1667 5.94 16.06 1.83333 11 1.83333ZM11 18.3333C6.9575 18.3333 3.66667 15.0425 3.66667 11C3.66667 6.9575 6.9575 3.66667 11 3.66667C15.0425 3.66667 18.3333 6.9575 18.3333 11C18.3333 15.0425 15.0425 18.3333 11 18.3333Z", fill: "currentColor" }) }));
|
|
390
|
+
}
|
|
391
|
+
function CloseIcon() {
|
|
392
|
+
return (_jsx("svg", { viewBox: "0 0 14 14", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M14 1.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z", fill: "currentColor" }) }));
|
|
393
|
+
}
|
|
394
|
+
function CopyIcon() {
|
|
395
|
+
return (_jsx("svg", { viewBox: "0 0 8.60253 11.6462", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M1.01206 11.6462C0.733745 11.6462 0.495405 11.5323 0.29704 11.3044C0.0990134 11.0761 0 10.8019 0 10.4816V2.32924H1.01206V10.4816H6.57841V11.6462H1.01206ZM3.03619 9.31697C2.75787 9.31697 2.5197 9.20303 2.32167 8.97515C2.12331 8.74689 2.02413 8.47262 2.02413 8.15235V1.16462C2.02413 0.84435 2.12331 0.570082 2.32167 0.341816C2.5197 0.113939 2.75787 0 3.03619 0H7.59047C7.86879 0 8.10713 0.113939 8.30549 0.341816C8.50352 0.570082 8.60253 0.84435 8.60253 1.16462V8.15235C8.60253 8.47262 8.50352 8.74689 8.30549 8.97515C8.10713 9.20303 7.86879 9.31697 7.59047 9.31697H3.03619ZM3.03619 8.15235H7.59047V1.16462H3.03619V8.15235Z", fill: "currentColor" }) }));
|
|
396
|
+
}
|
|
397
|
+
/** MD3 "check" symbol — same traced glyph SearchMenu.tsx uses, marking a passed evaluation. */
|
|
398
|
+
function CheckIcon() {
|
|
399
|
+
return (_jsx("svg", { viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M7.1625 13.5L2.8875 9.225L3.95625 8.15625L7.1625 11.3625L14.0438 4.48125L15.1125 5.55L7.1625 13.5Z", fill: "currentColor" }) }));
|
|
400
|
+
}
|
|
401
|
+
/** Real Material Symbols "play_arrow" (viewBox `0 -960 960 960`) — not in the mock itself, see this section's own header comment. */
|
|
402
|
+
function PlayIcon() {
|
|
403
|
+
return (_jsx("svg", { viewBox: "0 -960 960 960", "aria-hidden": "true", children: _jsx("path", { d: "M320-200v-560l440 280-440 280Z", fill: "currentColor" }) }));
|
|
404
|
+
}
|
|
405
|
+
/** Self-drawn corner-bracket mark, not a recalled/traced icon-set glyph (the mock has no "expand" asset to trace — see this section's own header comment) — four independent strokes, deliberately simple so its geometry is obviously correct rather than a compound path that's hard to eyeball. */
|
|
406
|
+
function ExpandIcon() {
|
|
407
|
+
return (_jsx("svg", { viewBox: "0 0 18 18", fill: "none", "aria-hidden": "true", children: _jsx("path", { d: "M2 6V2h4M12 2h4v4M16 12v4h-4M6 16H2v-4", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", strokeLinejoin: "round" }) }));
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=ResultCard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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AAO,EAAC,qBAAqB,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,YAC/D,eACE,CAAC,EAAC,+mBAA+mB,EACjnB,IAAI,EAAC,cAAc,GACnB,GACE,CACP,CAAC;AACJ,CAAC;AAED,+FAA+F;AAC/F,SAAS,SAAS;IAChB,OAAO,CACL,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,YACrD,eACE,CAAC,EAAC,oGAAoG,EACtG,IAAI,EAAC,cAAc,GACnB,GACE,CACP,CAAC;AACJ,CAAC;AAED,qIAAqI;AACrI,SAAS,QAAQ;IACf,OAAO,CACL,cAAK,OAAO,EAAC,gBAAgB,iBAAa,MAAM,YAC9C,eAAM,CAAC,EAAC,gCAAgC,EAAC,IAAI,EAAC,cAAc,GAAG,GAC3D,CACP,CAAC;AACJ,CAAC;AAED,sSAAsS;AACtS,SAAS,UAAU;IACjB,OAAO,CACL,cAAK,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,MAAM,iBAAa,MAAM,YACrD,eACE,CAAC,EAAC,wCAAwC,EAC1C,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,GACtB,GACE,CACP,CAAC;AACJ,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./primitives/index.js";
|
|
2
|
+
export * from "./Composer.js";
|
|
3
|
+
export * from "./MediaAnalyzer.js";
|
|
4
|
+
export * from "./ResultCard.js";
|
|
5
|
+
export * from "./useComposer.js";
|
|
6
|
+
export * from "./ChaiProvider.js";
|
|
7
|
+
export * from "./useMediaAnalyzer.js";
|
|
8
|
+
export { createFalEngine, createOpenRouterEngine, createMockEngine, mockEngine, GenerationError, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, } from "@chai-ui/core";
|
|
9
|
+
export type { DroppedMedia, Evaluation, GenerationEngine, GenerationUseCase, MediaAnalysisKind, MediaAnalysisPromptLength, MediaKind, ModelOption, ParameterOption, Request, Result, ResultStatus, Run, Usage, } from "@chai-ui/core";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AAItC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,oCAAoC,EACpC,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,eAAe,CAAC;AACvB,YAAY,EACV,YAAY,EACZ,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,iBAAiB,EACjB,yBAAyB,EACzB,SAAS,EACT,WAAW,EACX,eAAe,EACf,OAAO,EACP,MAAM,EACN,YAAY,EACZ,GAAG,EACH,KAAK,GACN,MAAM,eAAe,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export * from "./primitives/index.js";
|
|
2
|
+
export * from "./Composer.js";
|
|
3
|
+
export * from "./MediaAnalyzer.js";
|
|
4
|
+
export * from "./ResultCard.js";
|
|
5
|
+
export * from "./useComposer.js";
|
|
6
|
+
export * from "./ChaiProvider.js";
|
|
7
|
+
export * from "./useMediaAnalyzer.js";
|
|
8
|
+
// Re-export the core engines and types so a consumer typically only needs
|
|
9
|
+
// to import from @chai-ui/react.
|
|
10
|
+
export { createFalEngine, createOpenRouterEngine, createMockEngine, mockEngine, GenerationError, DEFAULT_MEDIA_ANALYSIS_PROMPT_LENGTH, MEDIA_ANALYSIS_PROMPTS, MEDIA_ANALYSIS_PROMPT_LENGTHS, } from "@chai-ui/core";
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AAEtC,0EAA0E;AAC1E,iCAAiC;AACjC,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,oCAAoC,EACpC,sBAAsB,EACtB,6BAA6B,GAC9B,MAAM,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
interface PaginationProps {
|
|
2
|
+
count: number;
|
|
3
|
+
index: number;
|
|
4
|
+
onChange: (index: number) => void;
|
|
5
|
+
/** Accessible name for the nav landmark, e.g. "Results". */
|
|
6
|
+
label: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Progress-style pager (reference: the Figma "Pagination" asset, e.g. the
|
|
11
|
+
* Result Card mock) — a pill that fills from page 1 up to
|
|
12
|
+
* the current page under a row of plain dots, not independent per-page
|
|
13
|
+
* dots with a stretched active one. A standalone primitive, not part of
|
|
14
|
+
* any one component, so every paginated surface renders the same pager
|
|
15
|
+
* rather than each growing its own.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Pagination({ count, index, onChange, label, disabled }: PaginationProps): import("react").JSX.Element;
|
|
18
|
+
export {};
|
|
19
|
+
//# sourceMappingURL=Pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.d.ts","sourceRoot":"","sources":["../../src/primitives/Pagination.tsx"],"names":[],"mappings":"AAEA,UAAU,eAAe;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,4DAA4D;IAC5D,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,eAAe,+BAqBtF"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Progress-style pager (reference: the Figma "Pagination" asset, e.g. the
|
|
4
|
+
* Result Card mock) — a pill that fills from page 1 up to
|
|
5
|
+
* the current page under a row of plain dots, not independent per-page
|
|
6
|
+
* dots with a stretched active one. A standalone primitive, not part of
|
|
7
|
+
* any one component, so every paginated surface renders the same pager
|
|
8
|
+
* rather than each growing its own.
|
|
9
|
+
*/
|
|
10
|
+
export function Pagination({ count, index, onChange, label, disabled }) {
|
|
11
|
+
return (_jsxs("nav", { className: "chai-pagination", "aria-label": label, style: { "--chai-pagination-fill": `${((index + 1) / count) * 100}%` }, children: [_jsx("span", { className: "chai-pagination__track", "aria-hidden": "true" }), Array.from({ length: count }, (_, i) => (_jsx("button", { type: "button", className: `chai-pagination__dot${i <= index ? " chai-pagination__dot--filled" : ""}`, "aria-current": i === index, "aria-label": `Result ${i + 1} of ${count}`, disabled: disabled, onClick: () => onChange(i) }, i)))] }));
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=Pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Pagination.js","sourceRoot":"","sources":["../../src/primitives/Pagination.tsx"],"names":[],"mappings":";AAWA;;;;;;;GAOG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAmB;IACrF,OAAO,CACL,eACE,SAAS,EAAC,iBAAiB,gBACf,KAAK,EACjB,KAAK,EAAE,EAAE,wBAAwB,EAAE,GAAG,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,GAAG,KAAK,CAAC,GAAG,GAAG,GAAG,EAAmB,aAEvF,eAAM,SAAS,EAAC,wBAAwB,iBAAa,MAAM,GAAG,EAC7D,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACvC,iBAEE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,uBAAuB,CAAC,IAAI,KAAK,CAAC,CAAC,CAAC,+BAA+B,CAAC,CAAC,CAAC,EAAE,EAAE,kBACvE,CAAC,KAAK,KAAK,gBACb,UAAU,CAAC,GAAG,CAAC,OAAO,KAAK,EAAE,EACzC,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,IANrB,CAAC,CAON,CACH,CAAC,IACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
export interface SearchMenuOption {
|
|
3
|
+
id: string;
|
|
4
|
+
/** Shown on the trigger once this option is selected, and used for search-filtering. Keep this the short/canonical name. */
|
|
5
|
+
label: string;
|
|
6
|
+
/**
|
|
7
|
+
* Shown in the option row itself instead of `label`, if given — e.g. a
|
|
8
|
+
* longer, clarifying variant ("Terse (short)") that would read as
|
|
9
|
+
* cluttered on a closed trigger button but is genuinely useful while
|
|
10
|
+
* still choosing (reference: Media Analyzer's "Prompt length" menu).
|
|
11
|
+
* Falls back to `label` when omitted.
|
|
12
|
+
*/
|
|
13
|
+
rowLabel?: string;
|
|
14
|
+
}
|
|
15
|
+
/** One labeled group of options, rendered under its own header with a divider before the next group (reference: Media Analyzer's "Select model" menu — Image/Video/Audio sections). */
|
|
16
|
+
export interface SearchMenuSection<T extends SearchMenuOption> {
|
|
17
|
+
label: string;
|
|
18
|
+
options: T[];
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* A toggle pinned above every group, in its own bordered/tinted block with
|
|
22
|
+
* a floating label — e.g. Media Analyzer's "Auto-select model" (reference:
|
|
23
|
+
* the design mock). While `value` is true, every option row
|
|
24
|
+
* below becomes non-interactive — grayed out, `disabled` for real — but
|
|
25
|
+
* still shows its checkmark on whichever option is the menu's own `value`
|
|
26
|
+
* (the last *manual* pick), so switching the toggle back off returns to
|
|
27
|
+
* exactly that one instead of losing it.
|
|
28
|
+
*/
|
|
29
|
+
export interface SearchMenuToggleHeader {
|
|
30
|
+
label: string;
|
|
31
|
+
value: boolean;
|
|
32
|
+
onChange: (next: boolean) => void;
|
|
33
|
+
}
|
|
34
|
+
interface SearchMenuProps<T extends SearchMenuOption> {
|
|
35
|
+
/** A flat option list. Ignored if `sections` is given. */
|
|
36
|
+
options?: T[];
|
|
37
|
+
/** Grouped options, each under its own header with a divider between groups — an alternative to `options` for a menu that needs section dividers by category. */
|
|
38
|
+
sections?: SearchMenuSection<T>[];
|
|
39
|
+
toggleHeader?: SearchMenuToggleHeader;
|
|
40
|
+
/** The currently effective option's id, if any — checkmarked in the list. An array with `multiple`. */
|
|
41
|
+
value: string | string[] | null;
|
|
42
|
+
/** Several options can be checked at once: each row gets a leading checkbox (MD3's multi-select list pattern), a row click toggles it and the panel stays open. `onSelect` still fires with the clicked option; the caller owns adding or removing it. */
|
|
43
|
+
multiple?: boolean;
|
|
44
|
+
/** Text shown on the trigger button. */
|
|
45
|
+
triggerLabel: string;
|
|
46
|
+
/** Floating label on the search field and the panel's aria-label. */
|
|
47
|
+
menuLabel: string;
|
|
48
|
+
onSelect: (option: T) => void;
|
|
49
|
+
disabled?: boolean;
|
|
50
|
+
/** Show the search field in the panel. Default true. Set false for a short, fixed option list (reference: Composer's Model/Aspect ratio triggers) where searching adds nothing. */
|
|
51
|
+
searchable?: boolean;
|
|
52
|
+
/** "outlined" (default) matches `.chai-btn--outlined`; "text" drops the border entirely — chevron + label only (reference: Composer's Model/Aspect ratio triggers). */
|
|
53
|
+
triggerVariant?: "outlined" | "text";
|
|
54
|
+
/** Panel width in px (default 280) — widen for a menu whose option labels run long; anything still too long past that ellipsizes rather than wrapping or overflowing. */
|
|
55
|
+
panelWidth?: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* The searchable menu-button pattern behind every Model/option menu
|
|
59
|
+
* (reference: Media Analyze - Model Menu) — a trigger styled as MD3's outlined button, opening an anchored panel with
|
|
60
|
+
* a search field (a real `<md-outlined-text-field>`, for its floating-label
|
|
61
|
+
* + icon-slot behavior) over a plain option list. Hand-rolled rather than
|
|
62
|
+
* `<md-menu>`: this needs to live inline as a simple absolutely-positioned
|
|
63
|
+
* panel under the trigger, not `<md-menu>`'s own corner-anchored popover
|
|
64
|
+
* positioning model — same reasoning SegmentedButton documents for why it
|
|
65
|
+
* isn't a `@material/web` custom element either.
|
|
66
|
+
*/
|
|
67
|
+
export declare function SearchMenu<T extends SearchMenuOption>({ options, sections, toggleHeader, value, multiple, triggerLabel, menuLabel, onSelect, disabled, searchable, triggerVariant, panelWidth, }: SearchMenuProps<T>): React.JSX.Element;
|
|
68
|
+
export {};
|
|
69
|
+
//# sourceMappingURL=SearchMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SearchMenu.d.ts","sourceRoot":"","sources":["../../src/primitives/SearchMenu.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAuC/B,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,4HAA4H;IAC5H,KAAK,EAAE,MAAM,CAAC;IACd;;;;;;OAMG;IACH,QA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