research-agent-ui 0.1.85 → 0.1.87

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 (27) hide show
  1. package/dist/components/ArticleReader/ArticleAIResponse.stories.d.ts +13 -0
  2. package/dist/components/ArticleReader/ArticleActionButtons.d.ts +58 -0
  3. package/dist/components/ArticleReader/ArticleActionButtons.stories.d.ts +21 -0
  4. package/dist/components/ArticleReader/ArticleFollowupQuestions.stories.d.ts +14 -0
  5. package/dist/components/ArticleReader/ArticlePanelHeader.stories.d.ts +10 -0
  6. package/dist/components/ArticleReader/ArticlePromptInput.stories.d.ts +13 -0
  7. package/dist/components/ArticleReader/index.d.ts +1 -0
  8. package/dist/components/ChatConversation/MessageBubble/ThinkTagProcessor.stories.d.ts +12 -0
  9. package/dist/components/ChatConversation/MessageReasoningPanel.stories.d.ts +14 -0
  10. package/dist/components/ChatHistoryDropdown/HistoryChatItem.stories.d.ts +9 -0
  11. package/dist/components/ConfigError.stories.d.ts +10 -0
  12. package/dist/components/Footer.stories.d.ts +13 -0
  13. package/dist/components/MessageActions/CopyMessageButton.stories.d.ts +11 -0
  14. package/dist/components/SearchResults/WebCitationBadge.stories.d.ts +15 -0
  15. package/dist/index.cjs +13 -13
  16. package/dist/index.mjs +1463 -1336
  17. package/dist/ui/Loader.stories.d.ts +15 -0
  18. package/dist/ui/badge.stories.d.ts +21 -0
  19. package/dist/ui/button.stories.d.ts +25 -0
  20. package/dist/ui/dialog.stories.d.ts +12 -0
  21. package/dist/ui/dropdown-menu.stories.d.ts +10 -0
  22. package/dist/ui/glowing-effect.stories.d.ts +13 -0
  23. package/dist/ui/live-waveform.stories.d.ts +15 -0
  24. package/dist/ui/popover.stories.d.ts +10 -0
  25. package/dist/ui/tooltip.stories.d.ts +15 -0
  26. package/dist/ui/visually-hidden.stories.d.ts +17 -0
  27. package/package.json +6 -6
@@ -0,0 +1,13 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ArticleAIResponse from './ArticleAIResponse';
3
+ /**
4
+ * `ArticleAIResponse` renders the AI answer to a question about the current
5
+ * article. It shows a spinner while loading, the (HTML) response when ready,
6
+ * and an error banner on failure.
7
+ */
8
+ declare const meta: Meta<typeof ArticleAIResponse>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof ArticleAIResponse>;
11
+ export declare const Loading: Story;
12
+ export declare const WithResponse: Story;
13
+ export declare const Error: Story;
@@ -1,8 +1,66 @@
1
1
  /**
2
2
  * Toolbar with Ask AI, Suggest, Copy, Highlight, Favorite, Open-in-new-tab, and Close buttons
3
3
  * shown at the top of the article extract panel.
4
+ *
5
+ * Each button has a shadcn/Radix tooltip that appears on hover (zero delay) showing the
6
+ * action label and its keyboard shortcut. The shortcut key definitions are exported as
7
+ * {@link ARTICLE_TOOLBAR_SHORTCUTS} so the panel can wire up the matching key handlers.
4
8
  */
5
9
  import React from 'react';
10
+ /**
11
+ * Keyboard shortcut definitions for the article toolbar actions. `alt` means the
12
+ * shortcut requires the Alt/Option modifier; `close` uses a bare Escape key.
13
+ * Shared between the tooltip hints here and the key handler in the panel so the
14
+ * displayed shortcut and the actual binding never drift apart.
15
+ */
16
+ export declare const ARTICLE_TOOLBAR_SHORTCUTS: {
17
+ readonly ask: {
18
+ readonly alt: true;
19
+ readonly key: "a";
20
+ };
21
+ readonly suggest: {
22
+ readonly alt: true;
23
+ readonly key: "s";
24
+ };
25
+ readonly copy: {
26
+ readonly alt: true;
27
+ readonly key: "c";
28
+ };
29
+ readonly highlight: {
30
+ readonly alt: true;
31
+ readonly key: "h";
32
+ };
33
+ readonly favorite: {
34
+ readonly alt: true;
35
+ readonly key: "f";
36
+ };
37
+ readonly open: {
38
+ readonly alt: true;
39
+ readonly key: "o";
40
+ };
41
+ readonly zoomOut: {
42
+ readonly alt: true;
43
+ readonly key: "-";
44
+ };
45
+ readonly zoomReset: {
46
+ readonly alt: true;
47
+ readonly key: "0";
48
+ };
49
+ readonly zoomIn: {
50
+ readonly alt: true;
51
+ readonly key: "=";
52
+ };
53
+ readonly close: {
54
+ readonly alt: false;
55
+ readonly key: "Escape";
56
+ };
57
+ };
58
+ export type ArticleToolbarAction = keyof typeof ARTICLE_TOOLBAR_SHORTCUTS;
59
+ /**
60
+ * Render a shortcut definition as a short, platform-aware label
61
+ * (e.g. "⌥A" on macOS, "Alt+A" elsewhere, "Esc" for the close action).
62
+ */
63
+ export declare function formatToolbarShortcut(action: ArticleToolbarAction): string;
6
64
  interface ArticleActionButtonsProps {
7
65
  isLoadingAI: boolean;
8
66
  isLoadingFollowups: boolean;
@@ -0,0 +1,21 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ArticleActionButtons from './ArticleActionButtons';
3
+ /**
4
+ * `ArticleActionButtons` is the toolbar at the top of the article extract
5
+ * panel: Ask AI, Suggest, Copy, Highlight, Favorite, Open-in-new-tab, zoom
6
+ * controls, and Close. Every button has a hover tooltip showing its keyboard
7
+ * shortcut (e.g. `Alt+A`).
8
+ */
9
+ declare const meta: Meta<typeof ArticleActionButtons>;
10
+ export default meta;
11
+ type Story = StoryObj<typeof ArticleActionButtons>;
12
+ /** Default toolbar. Hover any button to see its tooltip + shortcut. */
13
+ export declare const Default: Story;
14
+ /** Highlight mode active and the article favorited. */
15
+ export declare const ActiveStates: Story;
16
+ /** AI request in flight (the Ask button shows a loading state). */
17
+ export declare const Loading: Story;
18
+ /** Zoomed in to 130%. */
19
+ export declare const ZoomedIn: Story;
20
+ /** Without an article URL the open-in-new-tab button is hidden. */
21
+ export declare const NoUrl: Story;
@@ -0,0 +1,14 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ArticleFollowupQuestions from './ArticleFollowupQuestions';
3
+ /**
4
+ * `ArticleFollowupQuestions` renders clickable, AI-suggested follow-up
5
+ * questions for the open article. A leading "summarize" prompt is always
6
+ * offered, and multi-question strings are split into individual chips.
7
+ */
8
+ declare const meta: Meta<typeof ArticleFollowupQuestions>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof ArticleFollowupQuestions>;
11
+ export declare const Default: Story;
12
+ /** A single string containing several questions is split automatically. */
13
+ export declare const AutoSplit: Story;
14
+ export declare const Empty: Story;
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ArticlePanelHeader from './ArticlePanelHeader';
3
+ /**
4
+ * `ArticlePanelHeader` is the minimal top bar of the article extract panel,
5
+ * containing just a close button.
6
+ */
7
+ declare const meta: Meta<typeof ArticlePanelHeader>;
8
+ export default meta;
9
+ type Story = StoryObj<typeof ArticlePanelHeader>;
10
+ export declare const Default: Story;
@@ -0,0 +1,13 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ArticlePromptInput from './ArticlePromptInput';
3
+ /**
4
+ * `ArticlePromptInput` is the single-line box for asking the AI a question
5
+ * about the current article. It submits on Enter.
6
+ */
7
+ declare const meta: Meta<typeof ArticlePromptInput>;
8
+ export default meta;
9
+ type Story = StoryObj<typeof ArticlePromptInput>;
10
+ export declare const Empty: Story;
11
+ export declare const WithText: Story;
12
+ /** Fully interactive: the input is controlled by local state. */
13
+ export declare const Interactive: Story;
@@ -3,6 +3,7 @@
3
3
  */
4
4
  export { default as ArticlePanelHeader } from "./ArticlePanelHeader";
5
5
  export { default as ArticleActionButtons } from "./ArticleActionButtons";
6
+ export { ARTICLE_TOOLBAR_SHORTCUTS, formatToolbarShortcut, type ArticleToolbarAction, } from "./ArticleActionButtons";
6
7
  export { default as ArticlePromptInput } from "./ArticlePromptInput";
7
8
  export { default as ArticleFollowupQuestions } from "./ArticleFollowupQuestions";
8
9
  export { default as ArticleAIResponse } from "./ArticleAIResponse";
@@ -0,0 +1,12 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ThinkTagProcessor from './ThinkTagProcessor';
3
+ /**
4
+ * `ThinkTagProcessor` maps the custom `<think>` markdown tag in AI responses to
5
+ * the collapsible reasoning panel. It simply forwards its children as the
6
+ * reasoning content.
7
+ */
8
+ declare const meta: Meta<typeof ThinkTagProcessor>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof ThinkTagProcessor>;
11
+ export declare const Thinking: Story;
12
+ export declare const Ended: Story;
@@ -0,0 +1,14 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ThinkBox from './MessageReasoningPanel';
3
+ /**
4
+ * `MessageReasoningPanel` (ThinkBox) is the collapsible panel that shows the
5
+ * model's internal reasoning extracted from `<think>` tags. It stays expanded
6
+ * while thinking and auto-collapses once `thinkingEnded` becomes true.
7
+ */
8
+ declare const meta: Meta<typeof ThinkBox>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof ThinkBox>;
11
+ /** Actively thinking — panel is expanded. */
12
+ export declare const Thinking: Story;
13
+ /** Finished — panel auto-collapses. */
14
+ export declare const Ended: Story;
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import { HistoryChatItem } from './HistoryChatItem';
3
+ declare const meta: Meta<typeof HistoryChatItem>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof HistoryChatItem>;
6
+ export declare const Default: Story;
7
+ export declare const Pinned: Story;
8
+ export declare const NoMessages: Story;
9
+ export declare const LongTitle: Story;
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import ConfigError from './ConfigError';
3
+ /**
4
+ * `ConfigError` is the full-screen setup guide shown when no AI providers are
5
+ * configured. It lists the environment variables the host app needs.
6
+ */
7
+ declare const meta: Meta<typeof ConfigError>;
8
+ export default meta;
9
+ type Story = StoryObj<typeof ConfigError>;
10
+ export declare const Default: Story;
@@ -0,0 +1,13 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import Footer from './Footer';
3
+ /**
4
+ * `Footer` renders a compact bar of links (with optional Lucide icons) pinned
5
+ * to the bottom of the screen. On small screens it collapses into an info icon
6
+ * that reveals the links in a popover. `icon` values are Lucide icon names.
7
+ */
8
+ declare const meta: Meta<typeof Footer>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof Footer>;
11
+ export declare const Default: Story;
12
+ export declare const WithoutIcons: Story;
13
+ export declare const Empty: Story;
@@ -0,0 +1,11 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import Copy from './CopyMessageButton';
3
+ /**
4
+ * `CopyMessageButton` copies an assistant message plus its citation URLs to the
5
+ * clipboard and briefly swaps its icon to a checkmark to confirm. Hover to see
6
+ * the tooltip; click to copy.
7
+ */
8
+ declare const meta: Meta<typeof Copy>;
9
+ export default meta;
10
+ type Story = StoryObj<typeof Copy>;
11
+ export declare const Default: Story;
@@ -0,0 +1,15 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+ import Citation from './WebCitationBadge';
3
+ /**
4
+ * `WebCitationBadge` (Citation) is the inline, numbered citation chip rendered
5
+ * from `<citation>` tags in AI responses. Hovering shows the source title and
6
+ * favicon; clicking opens the source in the article extract panel (mocked here
7
+ * via `ExtractPanelProvider`).
8
+ */
9
+ declare const meta: Meta<typeof Citation>;
10
+ export default meta;
11
+ type Story = StoryObj<typeof Citation>;
12
+ /** Resolves to a known source: hover shows its title + domain. */
13
+ export declare const KnownSource: Story;
14
+ /** No matching source: the tooltip falls back to the domain only. */
15
+ export declare const UnknownSource: Story;