agentic-ui-kit 0.5.1 → 0.7.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/dist/core.js +2 -2
- package/dist/index.js +918 -120
- package/dist/{src-Ce7xTfGU.js → src-D01l3nBc.js} +1 -1
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +44 -1
- package/dist/types/core/src/events.d.ts +2 -0
- package/dist/types/core/src/visualize.d.ts +1 -1
- package/dist/types/react/src/components/attachments.d.ts +4 -1
- package/dist/types/react/src/components/chat-list.d.ts +4 -0
- package/dist/types/react/src/components/composer.d.ts +7 -1
- package/dist/types/react/src/components/context-meter.d.ts +24 -0
- package/dist/types/react/src/components/context-panel.d.ts +5 -0
- package/dist/types/react/src/components/copy-field.d.ts +15 -0
- package/dist/types/react/src/components/dictation.d.ts +73 -0
- package/dist/types/react/src/components/effort-slider.d.ts +1 -1
- package/dist/types/react/src/components/markdown.d.ts +19 -2
- package/dist/types/react/src/components/model-picker.d.ts +6 -1
- package/dist/types/react/src/components/tools.d.ts +7 -2
- package/dist/types/react/src/hooks/sidebar-state.d.ts +6 -0
- package/dist/types/react/src/hooks/sse-transport.d.ts +7 -1
- package/dist/types/react/src/hooks/use-chat.d.ts +14 -1
- package/dist/types/react/src/index.d.ts +11 -5
- package/dist/types/react/src/primitives/button.d.ts +11 -3
- package/dist/types/react/src/primitives/cx.d.ts +3 -0
- package/dist/types/react/src/primitives/icons.d.ts +6 -0
- package/dist/types/react/src/primitives/labels.d.ts +28 -0
- package/dist/types/react/src/primitives/menu.d.ts +23 -5
- package/dist/types/react/src/primitives/overlay.d.ts +13 -1
- package/dist/types/react/src/primitives/segmented-control.d.ts +30 -5
- package/dist/types/react/src/views/app-shell.d.ts +31 -3
- package/dist/types/react/src/views/chat-view.d.ts +6 -2
- package/dist/types/react/src/views/sidebar.d.ts +31 -5
- package/package.json +3 -2
|
@@ -24,6 +24,12 @@ export interface Transport {
|
|
|
24
24
|
send(request: SendRequest): AsyncIterable<StreamEvent>;
|
|
25
25
|
/** Tells the server to stop the run. The stream is aborted locally either way. */
|
|
26
26
|
stop?(runId: string): Promise<void>;
|
|
27
|
+
/**
|
|
28
|
+
* Joins a run that is already going for the conversation (a page opened mid-reply, or a chat just created
|
|
29
|
+
* whose reply has started) and yields its events from the start of the run: `run.start` first, then the parts
|
|
30
|
+
* so far and the rest as they come. Used by `useChat({ resume: true })`; the stream ends with the run.
|
|
31
|
+
*/
|
|
32
|
+
resume?(conversationId: string, signal: AbortSignal): AsyncIterable<StreamEvent>;
|
|
27
33
|
}
|
|
28
34
|
export interface UseChatOptions {
|
|
29
35
|
transport: Transport;
|
|
@@ -34,6 +40,13 @@ export interface UseChatOptions {
|
|
|
34
40
|
agent?: AgentRegistry | null;
|
|
35
41
|
/** Continuations allowed per user message, so a looping model stops. Default 12. */
|
|
36
42
|
maxSteps?: number;
|
|
43
|
+
/**
|
|
44
|
+
* Join the run already going for `conversationId` when the hook mounts, through `transport.resume`. The reply
|
|
45
|
+
* is rebuilt from the replayed events; a trailing assistant message that is still streaming (e.g. an empty
|
|
46
|
+
* placeholder, or the part seen so far) is replaced. Does nothing without `transport.resume` or a
|
|
47
|
+
* `conversationId`. Safe in React StrictMode: the run is joined once and survives the double mount.
|
|
48
|
+
*/
|
|
49
|
+
resume?: boolean;
|
|
37
50
|
}
|
|
38
51
|
export interface SendOptions {
|
|
39
52
|
model?: string;
|
|
@@ -65,4 +78,4 @@ export declare function userMessage(text: string, parentId: string | null, attac
|
|
|
65
78
|
* retries. With an `AgentProvider` it also runs the agent loop: client tools run in the page, approvals
|
|
66
79
|
* wait for the user, then the reply continues; every finished tool call reaches its tool's `onResult`.
|
|
67
80
|
*/
|
|
68
|
-
export declare function useChat({ transport, conversationId, initialMessages, onTitle, agent, maxSteps }: UseChatOptions): UseChat;
|
|
81
|
+
export declare function useChat({ transport, conversationId, initialMessages, onTitle, agent, maxSteps, resume }: UseChatOptions): UseChat;
|
|
@@ -10,7 +10,7 @@ export type { SegmentedControlProps, SegmentedOption } from "./primitives/segmen
|
|
|
10
10
|
export { Caret } from "./primitives/caret";
|
|
11
11
|
export { Disclosure } from "./primitives/disclosure";
|
|
12
12
|
export type { DisclosureProps } from "./primitives/disclosure";
|
|
13
|
-
export { Popover, Menu, MenuItem, MenuSearch, MenuSection, MenuSeparator, MenuNote, MenuTrigger, SubmenuTrigger } from "./primitives/menu";
|
|
13
|
+
export { Popover, Menu, MenuItem, MenuSearch, MenuSection, MenuSeparator, MenuNote, MenuTrigger, SubmenuTrigger, DialogTrigger, PopoverTrigger } from "./primitives/menu";
|
|
14
14
|
export type { MenuSearchProps, PopoverProps, MenuProps, MenuItemProps, MenuSectionProps } from "./primitives/menu";
|
|
15
15
|
export { ContextMenu } from "./primitives/context-menu";
|
|
16
16
|
export type { ContextMenuProps } from "./primitives/context-menu";
|
|
@@ -38,7 +38,7 @@ export type { SidebarState } from "./hooks/sidebar-state";
|
|
|
38
38
|
export { UserMessage, AssistantMessage, formatRelativeTime, messageText } from "./components/messages";
|
|
39
39
|
export type { UserMessageProps, AssistantMessageProps, Feedback, MessageActions } from "./components/messages";
|
|
40
40
|
export { Markdown, MarkdownLinksProvider } from "./components/markdown";
|
|
41
|
-
export type { MarkdownProps, RenderLink } from "./components/markdown";
|
|
41
|
+
export type { LinkList, MarkdownProps, RenderLink, RenderLinkList } from "./components/markdown";
|
|
42
42
|
export { ActivityGroup } from "./components/activity-group";
|
|
43
43
|
export type { ActivityGroupProps } from "./components/activity-group";
|
|
44
44
|
export { ToolViewsProvider, useToolView, useToolViews, activityLabel, activityHeading, commandTool, webSearchTool, webFetchTool, memoryTool, defaultToolViews, formatDuration, useChatTool, } from "./components/tools";
|
|
@@ -53,12 +53,18 @@ export { TokenCounter, useCountUp, formatTokens } from "./components/token-count
|
|
|
53
53
|
export type { TokenCounterProps } from "./components/token-counter";
|
|
54
54
|
export { ContextPanel } from "./components/context-panel";
|
|
55
55
|
export type { ContextPanelProps } from "./components/context-panel";
|
|
56
|
+
export { ContextMeter } from "./components/context-meter";
|
|
57
|
+
export type { ContextMeterProps } from "./components/context-meter";
|
|
58
|
+
export { CopyField } from "./components/copy-field";
|
|
59
|
+
export type { CopyFieldProps } from "./components/copy-field";
|
|
56
60
|
export { Composer, AttachButton } from "./components/composer";
|
|
61
|
+
export { DictationButton, DictationControls, VoiceMeter, encodeWav, useDictation } from "./components/dictation";
|
|
62
|
+
export type { Dictation, DictationButtonProps, DictationState, UseDictationOptions, VoiceMeterProps } from "./components/dictation";
|
|
57
63
|
export { EffortSlider, EffortButton } from "./components/effort-slider";
|
|
58
64
|
export type { EffortSliderProps, EffortButtonProps } from "./components/effort-slider";
|
|
59
65
|
export type { ComposerProps, AttachButtonProps } from "./components/composer";
|
|
60
66
|
export { ModelPicker } from "./components/model-picker";
|
|
61
|
-
export type { ModelPickerProps } from "./components/model-picker";
|
|
67
|
+
export type { ModelOption, ModelPickerProps } from "./components/model-picker";
|
|
62
68
|
export { useAttachments, AttachmentCard, AttachmentRow, PastedTextDialog } from "./components/attachments";
|
|
63
69
|
export type { DraftAttachment, UploadResult, UseAttachments, UseAttachmentsOptions, AttachmentCardData, AttachmentCardProps, AttachmentRowProps, PastedTextDialogProps, } from "./components/attachments";
|
|
64
70
|
export { MessageList } from "./components/message-list";
|
|
@@ -75,5 +81,5 @@ export { ChatTranscript } from "./views/chat-transcript";
|
|
|
75
81
|
export type { ChatTranscriptProps } from "./views/chat-transcript";
|
|
76
82
|
export { AppShell, SidebarToggle } from "./views/app-shell";
|
|
77
83
|
export type { AppShellProps, SidebarToggleProps } from "./views/app-shell";
|
|
78
|
-
export { Sidebar, SidebarItem, SidebarUser } from "./views/sidebar";
|
|
79
|
-
export type { SidebarProps, SidebarItemProps, SidebarUserProps } from "./views/sidebar";
|
|
84
|
+
export { Sidebar, SidebarItem, SidebarList, SidebarUser } from "./views/sidebar";
|
|
85
|
+
export type { SidebarProps, SidebarItemProps, SidebarListProps, SidebarUserProps } from "./views/sidebar";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { type ButtonProps as AriaButtonProps } from "react-aria-components";
|
|
3
3
|
declare const variants: {
|
|
4
4
|
/** Plain text button, highlights on hover. Sidebar rows, header buttons. */
|
|
@@ -24,9 +24,15 @@ declare const sizes: {
|
|
|
24
24
|
export interface ButtonProps extends Omit<AriaButtonProps, "className"> {
|
|
25
25
|
variant?: keyof typeof variants;
|
|
26
26
|
size?: keyof typeof sizes;
|
|
27
|
+
/**
|
|
28
|
+
* Why the button is disabled. Only used with `isDisabled`: the button then stays focusable (`aria-disabled`,
|
|
29
|
+
* no press handlers, never submits), shows the reason in a tooltip on hover and focus, and exposes it as its
|
|
30
|
+
* accessible description.
|
|
31
|
+
*/
|
|
32
|
+
disabledReason?: ReactNode;
|
|
27
33
|
className?: string;
|
|
28
34
|
}
|
|
29
|
-
export declare function Button({ variant, size, className, ...
|
|
35
|
+
export declare function Button({ variant, size, className, disabledReason, ...rest }: ButtonProps): import("react").JSX.Element;
|
|
30
36
|
export interface IconButtonProps extends Omit<AriaButtonProps, "className" | "children"> {
|
|
31
37
|
/** Accessible name, also shown as the tooltip. */
|
|
32
38
|
label: string;
|
|
@@ -35,7 +41,9 @@ export interface IconButtonProps extends Omit<AriaButtonProps, "className" | "ch
|
|
|
35
41
|
size?: "sm" | "md";
|
|
36
42
|
/** Show the label as a tooltip on hover. On by default. */
|
|
37
43
|
tooltip?: boolean;
|
|
44
|
+
/** Why the button is disabled; see `Button`. Replaces the label tooltip while the button is disabled. */
|
|
45
|
+
disabledReason?: ReactNode;
|
|
38
46
|
className?: string;
|
|
39
47
|
}
|
|
40
|
-
export declare function IconButton({ label, variant, size, tooltip, className, ...
|
|
48
|
+
export declare function IconButton({ label, variant, size, tooltip, className, disabledReason, ...rest }: IconButtonProps): import("react").JSX.Element;
|
|
41
49
|
export {};
|
|
@@ -25,6 +25,12 @@ export interface ChatIcons {
|
|
|
25
25
|
stop: ReactNode;
|
|
26
26
|
/** Open the attach menu in the composer. */
|
|
27
27
|
attach: ReactNode;
|
|
28
|
+
/** Start dictation in the composer. */
|
|
29
|
+
mic: ReactNode;
|
|
30
|
+
/** Cancel dictation. */
|
|
31
|
+
dictationCancel: ReactNode;
|
|
32
|
+
/** Accept dictation: put the transcript in the box. */
|
|
33
|
+
dictationAccept: ReactNode;
|
|
28
34
|
/** Jump to the newest message. */
|
|
29
35
|
scrollToBottom: ReactNode;
|
|
30
36
|
/** Prefix of the token counter. */
|
|
@@ -25,6 +25,12 @@ export interface ChatLabels {
|
|
|
25
25
|
ranCommandLabel: string;
|
|
26
26
|
/** Heading phrase for command calls, lowercase: "ran a command", "ran 3 commands". */
|
|
27
27
|
ranCommands: (count: number) => string;
|
|
28
|
+
/** Approval question for the command tool, present tense. */
|
|
29
|
+
runCommandAsk: string;
|
|
30
|
+
/** Approval question for the web search tool. */
|
|
31
|
+
searchWebAsk: string;
|
|
32
|
+
/** Approval question for the page fetch tool. */
|
|
33
|
+
readPageAsk: string;
|
|
28
34
|
/** Row label of the web search tool. */
|
|
29
35
|
searchedWebLabel: string;
|
|
30
36
|
readPageLabel: string;
|
|
@@ -61,12 +67,22 @@ export interface ChatLabels {
|
|
|
61
67
|
expandSidebar: string;
|
|
62
68
|
/** Sidebar toggle, full width. */
|
|
63
69
|
collapseSidebar: string;
|
|
70
|
+
/** Accessible name of the sidebar's resize handle. */
|
|
71
|
+
resizeSidebar: string;
|
|
72
|
+
/** A label with its keyboard shortcut, e.g. "Collapse sidebar (⌘ B)". */
|
|
73
|
+
withShortcut: (label: string, keys: string) => string;
|
|
74
|
+
/** The Ctrl key's name in shortcut hints (non-Mac). */
|
|
75
|
+
ctrlKey: string;
|
|
64
76
|
/** Default title of the context panel. */
|
|
65
77
|
context: string;
|
|
66
78
|
/** Accessible name of the usage meter. */
|
|
67
79
|
contextUsed: string;
|
|
68
80
|
/** "42% used". */
|
|
69
81
|
percentUsed: (percent: number) => string;
|
|
82
|
+
/** Context meter summary, also its accessible name: "Context: 13.8k / 200k (7%)". */
|
|
83
|
+
contextSummary: (used: string, limit: string, percent: number) => string;
|
|
84
|
+
/** Context meter while the numbers are still loading. */
|
|
85
|
+
contextLoading: string;
|
|
70
86
|
/** Row for the unused part of the window. */
|
|
71
87
|
freeSpace: string;
|
|
72
88
|
/** "1.2k tokens"; `count` is already formatted. */
|
|
@@ -81,6 +97,16 @@ export interface ChatLabels {
|
|
|
81
97
|
stop: string;
|
|
82
98
|
/** Send button. */
|
|
83
99
|
send: string;
|
|
100
|
+
/** Composer placeholder while dictating. */
|
|
101
|
+
listening: string;
|
|
102
|
+
/** Composer placeholder while the last words are transcribed. */
|
|
103
|
+
transcribing: string;
|
|
104
|
+
/** The mic button. */
|
|
105
|
+
dictate: string;
|
|
106
|
+
/** Dictation's cancel button. */
|
|
107
|
+
dictationCancel: string;
|
|
108
|
+
/** Dictation's accept button. */
|
|
109
|
+
dictationAccept: string;
|
|
84
110
|
/** The `+` button of the composer. */
|
|
85
111
|
addFiles: string;
|
|
86
112
|
/** Accessible name of an attachment list. */
|
|
@@ -145,6 +171,8 @@ export interface ChatLabels {
|
|
|
145
171
|
copy: string;
|
|
146
172
|
/** Copy button right after copying. */
|
|
147
173
|
copied: string;
|
|
174
|
+
/** Accessible name of a copy field's read-only input. */
|
|
175
|
+
copyFieldLabel: string;
|
|
148
176
|
/** Retry button. */
|
|
149
177
|
retry: string;
|
|
150
178
|
/** Edit button. */
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
2
|
import { type MenuItemProps as AriaMenuItemProps, type MenuProps as AriaMenuProps, type PopoverProps as AriaPopoverProps, type Key, type Selection } from "react-aria-components";
|
|
3
|
-
|
|
3
|
+
import { DialogTrigger } from "react-aria-components";
|
|
4
|
+
export { MenuTrigger, SubmenuTrigger, DialogTrigger } from "react-aria-components";
|
|
5
|
+
/**
|
|
6
|
+
* Wraps a trigger button and a kit `Popover` (or `Modal`) so that pressing the button toggles it, without
|
|
7
|
+
* importing react-aria. The same component as `DialogTrigger`; use whichever name reads better.
|
|
8
|
+
*/
|
|
9
|
+
export declare const PopoverTrigger: typeof DialogTrigger;
|
|
4
10
|
export interface MenuSearchProps {
|
|
5
11
|
placeholder: string;
|
|
6
12
|
/** A `Menu`; its items are filtered by what the user types. */
|
|
@@ -13,9 +19,19 @@ export interface MenuSearchProps {
|
|
|
13
19
|
export declare function MenuSearch({ placeholder, children, value, onChange }: MenuSearchProps): import("react").JSX.Element;
|
|
14
20
|
export interface PopoverProps extends Omit<AriaPopoverProps, "className"> {
|
|
15
21
|
className?: string;
|
|
22
|
+
/**
|
|
23
|
+
* Below this viewport width (px, default 768) the popover opens as a bottom sheet over a dimmed page instead
|
|
24
|
+
* of floating at the trigger; keyboard, focus and dismissing work the same. `false` always floats. Placement
|
|
25
|
+
* props are ignored in the sheet.
|
|
26
|
+
*/
|
|
27
|
+
sheet?: number | false;
|
|
28
|
+
/** "trigger" makes the popover as wide as its trigger (react-aria's `--trigger-width`). Default "auto". */
|
|
29
|
+
width?: "auto" | "trigger";
|
|
30
|
+
/** When floating on a phone (`sheet={false}`), stretch to the viewport width. */
|
|
31
|
+
fullWidthOnPhones?: boolean;
|
|
16
32
|
}
|
|
17
|
-
/** Floating panel for menus and pickers: surface color, rounded, soft shadow, fades in. */
|
|
18
|
-
export declare function Popover({ className, offset, ...props }: PopoverProps): import("react").JSX.Element;
|
|
33
|
+
/** Floating panel for menus and pickers: surface color, rounded, soft shadow, fades in. On phones it's a bottom sheet. */
|
|
34
|
+
export declare function Popover({ className, offset, sheet, width, fullWidthOnPhones, children, ...props }: PopoverProps): import("react").JSX.Element;
|
|
19
35
|
export interface MenuProps<T> extends Omit<AriaMenuProps<T>, "className"> {
|
|
20
36
|
className?: string;
|
|
21
37
|
}
|
|
@@ -33,9 +49,11 @@ export interface MenuItemProps extends Omit<AriaMenuItemProps, "className" | "ch
|
|
|
33
49
|
shortcut?: string;
|
|
34
50
|
/** "danger" colors the item red, for Delete. */
|
|
35
51
|
tone?: "default" | "danger";
|
|
52
|
+
/** In a selection menu, how the selected state shows: a "check" mark (default) or an on/off "switch" for settings rows. */
|
|
53
|
+
indicator?: "check" | "switch";
|
|
36
54
|
className?: string;
|
|
37
55
|
}
|
|
38
|
-
export declare function MenuItem({ children, icon, description, descriptionPlacement, detail, shortcut, tone, className, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
56
|
+
export declare function MenuItem({ children, icon, description, descriptionPlacement, detail, shortcut, tone, indicator, className, ...props }: MenuItemProps): import("react").JSX.Element;
|
|
39
57
|
export interface MenuSectionProps {
|
|
40
58
|
children: ReactNode;
|
|
41
59
|
title?: ReactNode;
|
|
@@ -7,12 +7,24 @@ interface OverlayProps {
|
|
|
7
7
|
children: ReactNode;
|
|
8
8
|
className?: string;
|
|
9
9
|
}
|
|
10
|
+
declare const modalSizes: {
|
|
11
|
+
sm: string;
|
|
12
|
+
md: string;
|
|
13
|
+
lg: string;
|
|
14
|
+
xl: string;
|
|
15
|
+
/** Fills the page inside the overlay's padding. */
|
|
16
|
+
full: string;
|
|
17
|
+
};
|
|
10
18
|
export interface ModalProps extends OverlayProps {
|
|
11
19
|
/** Heading at the top, also the dialog's accessible name. */
|
|
12
20
|
title?: ReactNode;
|
|
21
|
+
/** Width of the dialog: sm 24rem, md 32rem, lg 42rem (default), xl 64rem, full fills the page. */
|
|
22
|
+
size?: keyof typeof modalSizes;
|
|
23
|
+
/** "center" (default) vertically centers the dialog; "top" puts it near the top edge, e.g. a command palette. */
|
|
24
|
+
placement?: "center" | "top";
|
|
13
25
|
}
|
|
14
26
|
/** A centered dialog over a dimmed page. Escape and clicking outside close it; focus stays inside. */
|
|
15
|
-
export declare function Modal({ isOpen, onOpenChange, title, children, className, ...props }: ModalProps): import("react").JSX.Element;
|
|
27
|
+
export declare function Modal({ isOpen, onOpenChange, title, size, placement, children, className, ...props }: ModalProps): import("react").JSX.Element;
|
|
16
28
|
export interface DrawerProps extends OverlayProps {
|
|
17
29
|
side?: "left" | "right";
|
|
18
30
|
}
|
|
@@ -5,18 +5,43 @@ export interface SegmentedOption<T extends string = string> {
|
|
|
5
5
|
icon?: ReactNode;
|
|
6
6
|
/** Show only the icon; the label becomes its accessible name and tooltip. */
|
|
7
7
|
iconOnly?: boolean;
|
|
8
|
+
/** Disable just this option. */
|
|
9
|
+
isDisabled?: boolean;
|
|
8
10
|
}
|
|
9
|
-
|
|
11
|
+
declare const sizes: {
|
|
12
|
+
sm: {
|
|
13
|
+
button: string;
|
|
14
|
+
iconOnly: string;
|
|
15
|
+
};
|
|
16
|
+
md: {
|
|
17
|
+
button: string;
|
|
18
|
+
iconOnly: string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
interface SegmentedControlBase<T extends string> {
|
|
10
22
|
/** Accessible name of the group, e.g. "Mode". */
|
|
11
23
|
label: string;
|
|
12
24
|
options: readonly SegmentedOption<T>[];
|
|
13
|
-
|
|
14
|
-
|
|
25
|
+
/** Disable the whole control. */
|
|
26
|
+
isDisabled?: boolean;
|
|
27
|
+
/** "sm" (default, 24px tall) or "md" (32px). */
|
|
28
|
+
size?: keyof typeof sizes;
|
|
15
29
|
className?: string;
|
|
16
30
|
}
|
|
31
|
+
export type SegmentedControlProps<T extends string = string> = SegmentedControlBase<T> & ({
|
|
32
|
+
/** Pressing the selected option again clears the selection: `value` may be `null` and `onChange` gets `null`. */
|
|
33
|
+
clearable?: false;
|
|
34
|
+
value: T;
|
|
35
|
+
onChange: (value: T) => void;
|
|
36
|
+
} | {
|
|
37
|
+
clearable: true;
|
|
38
|
+
value: T | null;
|
|
39
|
+
onChange: (value: T | null) => void;
|
|
40
|
+
});
|
|
17
41
|
/**
|
|
18
|
-
* One of a few options, side by side on a track,
|
|
42
|
+
* One of a few options, side by side on a track, similar to claude.ai's Chat / Cowork switch. Themed with
|
|
19
43
|
* `--chat-segment-track` (default: a shade darker than the surface it sits on) and `--chat-segment-selected`
|
|
20
44
|
* (default `--chat-raised`).
|
|
21
45
|
*/
|
|
22
|
-
export declare function SegmentedControl<T extends string>({ label, options, value, onChange, className }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
46
|
+
export declare function SegmentedControl<T extends string>({ label, options, value, onChange, clearable, isDisabled, size, className }: SegmentedControlProps<T>): import("react").JSX.Element;
|
|
47
|
+
export {};
|
|
@@ -2,19 +2,47 @@ import { type ReactNode } from "react";
|
|
|
2
2
|
export interface AppShellProps {
|
|
3
3
|
sidebar: ReactNode;
|
|
4
4
|
children: ReactNode;
|
|
5
|
-
/** Defaults to collapsed below 1024px. */
|
|
5
|
+
/** Defaults to collapsed below 1024px. Only the initial value; use `collapsed` to control it. */
|
|
6
6
|
defaultCollapsed?: boolean;
|
|
7
|
+
/** Controls whether the pinned sidebar is the icon rail. Pair with `onCollapsedChange`. */
|
|
8
|
+
collapsed?: boolean;
|
|
9
|
+
/** Called with the new value when the user collapses or expands the pinned sidebar (button or shortcut). */
|
|
10
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Where the page scrolls. `"inner"` (default): the shell is exactly the window tall and `main` scrolls inside.
|
|
13
|
+
* `"window"`: the shell grows with its content, the window scrolls (sticky headers and `position: sticky` in the
|
|
14
|
+
* page keep working) and the sidebar sticks to the top at window height.
|
|
15
|
+
*/
|
|
16
|
+
scroll?: "inner" | "window";
|
|
17
|
+
/**
|
|
18
|
+
* Lets the user drag the sidebar's right edge (or use the arrow keys on it) to change its width, in px.
|
|
19
|
+
* Without it the width is `--chat-sidebar-width`.
|
|
20
|
+
*/
|
|
21
|
+
resizable?: {
|
|
22
|
+
min: number;
|
|
23
|
+
max: number;
|
|
24
|
+
};
|
|
25
|
+
/** Controls the width in px while `resizable`. Pair with `onWidthChange`. */
|
|
26
|
+
width?: number;
|
|
27
|
+
/** Initial width in px while `resizable`, 288 (18rem) otherwise. */
|
|
28
|
+
defaultWidth?: number;
|
|
29
|
+
/** Called with the width in px when a drag ends or a key changes it (not on every pointer move). */
|
|
30
|
+
onWidthChange?: (width: number) => void;
|
|
31
|
+
/** Keeps the width in localStorage under this key, so it survives reloads. */
|
|
32
|
+
persistKey?: string;
|
|
33
|
+
/** Cmd+B (Ctrl+B off Apple platforms) toggles the sidebar. Default true. */
|
|
34
|
+
shortcut?: boolean;
|
|
7
35
|
className?: string;
|
|
8
36
|
}
|
|
9
37
|
/**
|
|
10
38
|
* A page with a sidebar: pinned and collapsible to an icon rail from tablet width up, a drawer over the
|
|
11
39
|
* content on phones. Children get `useSidebar()` and `<SidebarToggle>`.
|
|
12
40
|
*/
|
|
13
|
-
export declare function AppShell({ sidebar, children, defaultCollapsed, className }: AppShellProps): import("react").JSX.Element;
|
|
41
|
+
export declare function AppShell({ sidebar, children, defaultCollapsed, collapsed: collapsedProp, onCollapsedChange, scroll, resizable, width: widthProp, defaultWidth, onWidthChange, persistKey, shortcut, className, }: AppShellProps): import("react").JSX.Element;
|
|
14
42
|
export interface SidebarToggleProps {
|
|
15
43
|
/** Render only when the sidebar is a drawer, e.g. in the chat header. */
|
|
16
44
|
drawerOnly?: boolean;
|
|
17
45
|
className?: string;
|
|
18
46
|
}
|
|
19
|
-
/** Opens the drawer on phones, collapses / expands the pinned sidebar elsewhere. */
|
|
47
|
+
/** Opens the drawer on phones, collapses / expands the pinned sidebar elsewhere. Its label names the shortcut, e.g. "(⌘ B)". */
|
|
20
48
|
export declare function SidebarToggle({ drawerOnly, className }: SidebarToggleProps): import("react").JSX.Element | null;
|
|
@@ -35,8 +35,12 @@ export interface ChatViewProps {
|
|
|
35
35
|
widgets?: WidgetHost;
|
|
36
36
|
/** Usually a `<ChatHeader>`. */
|
|
37
37
|
header?: ReactNode;
|
|
38
|
-
/**
|
|
39
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Passed to the composer: toolbar slots, placeholder, controlled text. `false` shows no composer (a chat you
|
|
40
|
+
* can only read or answer through approvals and message actions): `renderComposer` is not called, the empty
|
|
41
|
+
* state gets `null` in place of the composer and nothing shows if there is none.
|
|
42
|
+
*/
|
|
43
|
+
composer?: Partial<Omit<ComposerProps, "onSubmit" | "onStop" | "busy">> | false;
|
|
40
44
|
/**
|
|
41
45
|
* Shown instead of the list while there are no messages; gets the centered composer to place, e.g.
|
|
42
46
|
* `(composer) => <EmptyState greeting="Good evening">{composer}</EmptyState>`. Defaults to the composer.
|
|
@@ -4,8 +4,10 @@ export interface SidebarProps {
|
|
|
4
4
|
brand?: ReactNode;
|
|
5
5
|
/** A logo mark left of `brand`, sized 1.25rem. It stays at the top of the collapsed rail. */
|
|
6
6
|
brandIcon?: ReactNode;
|
|
7
|
-
/** Buttons at the top right next to the collapse toggle, e.g. a mode switch. */
|
|
7
|
+
/** Buttons at the top right next to the collapse toggle, e.g. a mode switch. Hidden when collapsed; see `railActions`. */
|
|
8
8
|
headerActions?: ReactNode;
|
|
9
|
+
/** Icon-only buttons shown under the toggle on the collapsed rail, e.g. the same actions as `headerActions`. */
|
|
10
|
+
railActions?: ReactNode;
|
|
9
11
|
/** Fixed items under the header: New chat, Search, Projects… (`SidebarItem`s). */
|
|
10
12
|
nav?: ReactNode;
|
|
11
13
|
/** The scrolling middle, usually `ChatList`. Hidden when collapsed. */
|
|
@@ -15,18 +17,42 @@ export interface SidebarProps {
|
|
|
15
17
|
className?: string;
|
|
16
18
|
}
|
|
17
19
|
/** The claude.ai sidebar frame. Collapses to an icon rail inside `AppShell`; a drawer on phones. */
|
|
18
|
-
export declare function Sidebar({ brand, brandIcon, headerActions, nav, children, footer, className }: SidebarProps): import("react").JSX.Element;
|
|
20
|
+
export declare function Sidebar({ brand, brandIcon, headerActions, railActions, nav, children, footer, className }: SidebarProps): import("react").JSX.Element;
|
|
21
|
+
export interface SidebarListProps {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The `<ul>` for `SidebarItem`s outside `Sidebar`'s `nav` slot (e.g. inside a section): no bullets, no padding. */
|
|
26
|
+
export declare function SidebarList({ children, className }: SidebarListProps): import("react").JSX.Element;
|
|
19
27
|
export interface SidebarItemProps {
|
|
20
28
|
icon: ReactNode;
|
|
21
29
|
label: string;
|
|
22
30
|
onPress?: () => void;
|
|
31
|
+
/**
|
|
32
|
+
* Renders the row as a link. For client-side navigation wrap the app in react-aria's `RouterProvider`;
|
|
33
|
+
* otherwise a press reloads the page.
|
|
34
|
+
*/
|
|
23
35
|
href?: string;
|
|
24
36
|
active?: boolean;
|
|
25
|
-
/** Shown on the right, e.g. "⌘K". */
|
|
37
|
+
/** Shown on the right on hover, e.g. "⌘K". */
|
|
26
38
|
shortcut?: string;
|
|
39
|
+
/** Always shown on the right, e.g. an unread count. On the collapsed rail it becomes a dot. */
|
|
40
|
+
badge?: ReactNode;
|
|
41
|
+
/** A second, smaller line under the label. */
|
|
42
|
+
description?: ReactNode;
|
|
43
|
+
/** Row actions (a `…` button, say), shown on hover and focus, outside the link so they can be buttons. Hidden when collapsed. */
|
|
44
|
+
trailing?: ReactNode;
|
|
45
|
+
/** Native tooltip on the row. Without it, the label shows as a tooltip only while it is cut off by `…`. */
|
|
46
|
+
title?: string;
|
|
47
|
+
className?: string;
|
|
48
|
+
/** Any `data-*` attribute goes on the row's `<li>`, e.g. `data-testid`. */
|
|
49
|
+
[dataAttribute: `data-${string}`]: string | number | boolean | undefined;
|
|
27
50
|
}
|
|
28
|
-
/**
|
|
29
|
-
|
|
51
|
+
/**
|
|
52
|
+
* A nav row: icon and label; just the icon with a tooltip when collapsed. Closes the drawer when picked.
|
|
53
|
+
* Icons are 1rem, or `--chat-sidebar-icon-size`.
|
|
54
|
+
*/
|
|
55
|
+
export declare function SidebarItem({ icon, label, onPress, href, active, shortcut, badge, description, trailing, title, className: extra, ...rest }: SidebarItemProps): import("react").JSX.Element;
|
|
30
56
|
export interface SidebarUserProps {
|
|
31
57
|
name: string;
|
|
32
58
|
/** Second line, e.g. the plan. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "React UI kit for LLM chat and agentic apps: streaming messages, tool calls, approvals, themable with CSS variables.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -59,7 +59,8 @@
|
|
|
59
59
|
"react-aria": "3.53.1",
|
|
60
60
|
"react-aria-components": "1.22.1",
|
|
61
61
|
"shiki": "4.6.0",
|
|
62
|
-
"streamdown": "2.7.1"
|
|
62
|
+
"streamdown": "2.7.1",
|
|
63
|
+
"tailwind-merge": "^3.7.0"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
66
|
"@tailwindcss/cli": "^4.3.4",
|