agentic-ui-kit 0.6.0 → 0.7.1
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/index.js +719 -123
- package/dist/styles.css +1 -1
- package/dist/tailwind.css +49 -0
- package/dist/types/react/src/components/attachments.d.ts +4 -1
- package/dist/types/react/src/components/chat-list.d.ts +16 -0
- 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/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 -7
- package/dist/types/react/src/primitives/button.d.ts +11 -3
- package/dist/types/react/src/primitives/chat-theme.d.ts +3 -1
- package/dist/types/react/src/primitives/cx.d.ts +3 -0
- package/dist/types/react/src/primitives/icons.d.ts +2 -0
- package/dist/types/react/src/primitives/labels.d.ts +18 -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/panel.d.ts +3 -1
- package/dist/types/react/src/primitives/segmented-control.d.ts +29 -4
- 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 +35 -6
- package/package.json +3 -2
|
@@ -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 {};
|
|
@@ -29,6 +29,8 @@ export interface ChatThemeProps {
|
|
|
29
29
|
/**
|
|
30
30
|
* Applies a chat theme to part of a page. Menus, tooltips and dialogs opened inside render into this
|
|
31
31
|
* element instead of `<body>`, so they get the same theme. An app themed as a whole (variables on
|
|
32
|
-
* `:root`) does not need it for colors, but still uses it for `codeThemes` and `motion`.
|
|
32
|
+
* `:root`) does not need it for colors, but still uses it for `codeThemes` and `motion`. The element is
|
|
33
|
+
* `height: 100%` of its parent by default (so `ChatView` has a height without Tailwind); a `className` such
|
|
34
|
+
* as `h-screen`, or a style rule of your own, replaces that.
|
|
33
35
|
*/
|
|
34
36
|
export declare function ChatTheme({ theme, codeThemes, motion, labels, icons, children, className }: ChatThemeProps): import("react").JSX.Element;
|
|
@@ -81,6 +81,8 @@ export interface ChatIcons {
|
|
|
81
81
|
file: ReactNode;
|
|
82
82
|
/** Remove an attachment. */
|
|
83
83
|
remove: ReactNode;
|
|
84
|
+
/** The recent-chats button on the collapsed sidebar rail (`ChatListRailButton`). */
|
|
85
|
+
chatList: ReactNode;
|
|
84
86
|
/**
|
|
85
87
|
* Left of the thinking / tool-steps summary while the model works, e.g. your logo animating. None by
|
|
86
88
|
* default.
|
|
@@ -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. */
|
|
@@ -155,6 +171,8 @@ export interface ChatLabels {
|
|
|
155
171
|
copy: string;
|
|
156
172
|
/** Copy button right after copying. */
|
|
157
173
|
copied: string;
|
|
174
|
+
/** Accessible name of a copy field's read-only input. */
|
|
175
|
+
copyFieldLabel: string;
|
|
158
176
|
/** Retry button. */
|
|
159
177
|
retry: string;
|
|
160
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
|
}
|
|
@@ -9,6 +9,8 @@ export interface PanelProps {
|
|
|
9
9
|
children: ReactNode;
|
|
10
10
|
/** "card": bordered and rounded, for grids and docks. "flush": no frame, for a pane that fills a column. */
|
|
11
11
|
variant?: "card" | "flush";
|
|
12
|
+
/** Pads the body (0.75rem, like the header). Off by default so a `ChatView` or list can run edge to edge. */
|
|
13
|
+
padded?: boolean;
|
|
12
14
|
"aria-label"?: string;
|
|
13
15
|
className?: string;
|
|
14
16
|
}
|
|
@@ -16,4 +18,4 @@ export interface PanelProps {
|
|
|
16
18
|
* A titled region that fills its container and lets the body scroll: a dock panel, an agent pane in a
|
|
17
19
|
* grid, a settings card. A `ChatView` placed in the body sizes itself to the panel.
|
|
18
20
|
*/
|
|
19
|
-
export declare function Panel({ title, actions, footer, children, variant, className, ...props }: PanelProps): import("react").JSX.Element;
|
|
21
|
+
export declare function Panel({ title, actions, footer, children, variant, padded, className, ...props }: PanelProps): import("react").JSX.Element;
|
|
@@ -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
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.
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
+
import { type PopoverProps } from "../primitives/menu";
|
|
2
3
|
export interface SidebarProps {
|
|
3
4
|
/** Name or logo at the top left; hidden when collapsed. */
|
|
4
5
|
brand?: ReactNode;
|
|
5
6
|
/** A logo mark left of `brand`, sized 1.25rem. It stays at the top of the collapsed rail. */
|
|
6
7
|
brandIcon?: ReactNode;
|
|
7
|
-
/** Buttons at the top right next to the collapse toggle, e.g. a mode switch. */
|
|
8
|
+
/** Buttons at the top right next to the collapse toggle, e.g. a mode switch. Hidden when collapsed; see `railActions`. */
|
|
8
9
|
headerActions?: ReactNode;
|
|
10
|
+
/** Icon-only buttons shown under the toggle on the collapsed rail, e.g. the same actions as `headerActions`. */
|
|
11
|
+
railActions?: ReactNode;
|
|
9
12
|
/** Fixed items under the header: New chat, Search, Projects… (`SidebarItem`s). */
|
|
10
13
|
nav?: ReactNode;
|
|
11
14
|
/** The scrolling middle, usually `ChatList`. Hidden when collapsed. */
|
|
@@ -15,18 +18,42 @@ export interface SidebarProps {
|
|
|
15
18
|
className?: string;
|
|
16
19
|
}
|
|
17
20
|
/** 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;
|
|
21
|
+
export declare function Sidebar({ brand, brandIcon, headerActions, railActions, nav, children, footer, className }: SidebarProps): import("react").JSX.Element;
|
|
22
|
+
export interface SidebarListProps {
|
|
23
|
+
children: ReactNode;
|
|
24
|
+
className?: string;
|
|
25
|
+
}
|
|
26
|
+
/** The `<ul>` for `SidebarItem`s outside `Sidebar`'s `nav` slot (e.g. inside a section): no bullets, no padding. */
|
|
27
|
+
export declare function SidebarList({ children, className }: SidebarListProps): import("react").JSX.Element;
|
|
19
28
|
export interface SidebarItemProps {
|
|
20
29
|
icon: ReactNode;
|
|
21
30
|
label: string;
|
|
22
31
|
onPress?: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* Renders the row as a link. For client-side navigation wrap the app in react-aria's `RouterProvider`;
|
|
34
|
+
* otherwise a press reloads the page.
|
|
35
|
+
*/
|
|
23
36
|
href?: string;
|
|
24
37
|
active?: boolean;
|
|
25
|
-
/** Shown on the right, e.g. "⌘K". */
|
|
38
|
+
/** Shown on the right on hover, e.g. "⌘K". */
|
|
26
39
|
shortcut?: string;
|
|
40
|
+
/** Always shown on the right, e.g. an unread count. On the collapsed rail it becomes a dot. */
|
|
41
|
+
badge?: ReactNode;
|
|
42
|
+
/** A second, smaller line under the label. */
|
|
43
|
+
description?: ReactNode;
|
|
44
|
+
/** Row actions (a `…` button, say), shown on hover and focus, outside the link so they can be buttons. Hidden when collapsed. */
|
|
45
|
+
trailing?: ReactNode;
|
|
46
|
+
/** Native tooltip on the row. Without it, the label shows as a tooltip only while it is cut off by `…`. */
|
|
47
|
+
title?: string;
|
|
48
|
+
className?: string;
|
|
49
|
+
/** Any `data-*` attribute goes on the row's `<li>`, e.g. `data-testid`. */
|
|
50
|
+
[dataAttribute: `data-${string}`]: string | number | boolean | undefined;
|
|
27
51
|
}
|
|
28
|
-
/**
|
|
29
|
-
|
|
52
|
+
/**
|
|
53
|
+
* A nav row: icon and label; just the icon with a tooltip when collapsed. Closes the drawer when picked.
|
|
54
|
+
* Icons are 1rem, or `--chat-sidebar-icon-size`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function SidebarItem({ icon, label, onPress, href, active, shortcut, badge, description, trailing, title, className: extra, ...rest }: SidebarItemProps): import("react").JSX.Element;
|
|
30
57
|
export interface SidebarUserProps {
|
|
31
58
|
name: string;
|
|
32
59
|
/** Second line, e.g. the plan. */
|
|
@@ -35,6 +62,8 @@ export interface SidebarUserProps {
|
|
|
35
62
|
avatarUrl?: string;
|
|
36
63
|
/** Opens upward from the row, e.g. settings and log out. */
|
|
37
64
|
menu?: ReactNode;
|
|
65
|
+
/** Passed to the menu's popover, e.g. `{ width: "trigger" }` to match the row's width, or a different `placement`. */
|
|
66
|
+
popoverProps?: Omit<PopoverProps, "children">;
|
|
38
67
|
}
|
|
39
68
|
/** The account row at the bottom: avatar, name, plan, and a menu. */
|
|
40
|
-
export declare function SidebarUser({ name, detail, avatarUrl, menu }: SidebarUserProps): import("react").JSX.Element;
|
|
69
|
+
export declare function SidebarUser({ name, detail, avatarUrl, menu, popoverProps }: SidebarUserProps): import("react").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-ui-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.1",
|
|
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",
|