Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
3056640
Update exports in react-core and enhance styles in react-ui components
ankit-thesys Dec 16, 2025
45344bf
Enhance BottomTray component with open/close states and add Trigger b…
ankit-thesys Dec 16, 2025
4cd4c1e
Remove onOpenChange prop from BottomTray Container component for clea…
ankit-thesys Dec 16, 2025
b82979b
Update exports in react-core to streamline usage of thread manager hooks
ankit-thesys Dec 16, 2025
65cf2f4
Update Thread component dependencies in useEffect and enhance CrayonC…
ankit-thesys Dec 16, 2025
9972dca
Refactor BottomTray styles and enhance Header component with new chat…
ankit-thesys Dec 21, 2025
5040120
Enhance BottomTray component with improved styles and functionality
ankit-thesys Dec 21, 2025
9bd38d1
Refactor BottomTray component by removing deprecated styles and updat…
ankit-thesys Dec 21, 2025
3530731
Clean up BottomTray SCSS files by removing unnecessary empty lines
ankit-thesys Dec 21, 2025
c4f5aa7
Refactor BottomTray SCSS imports by renaming index.scss to bottomTray…
ankit-thesys Dec 22, 2025
5680cd8
Refactor BottomTray SCSS styles for consistency and improved layout
ankit-thesys Dec 22, 2025
1ccce93
Adjust max-height in threadList.scss for improved layout consistency
ankit-thesys Dec 22, 2025
e227403
Add scroll gradient to BottomTray and adjust padding in thread composer
ankit-thesys Dec 22, 2025
387afd2
Refactor BottomTray Thread component to simplify gradient implementation
ankit-thesys Dec 22, 2025
5b10fad
Enhance BottomTray ThreadList styles with additional padding
ankit-thesys Dec 22, 2025
02623c0
Refactor BottomTray and CrayonChat components for improved functional…
ankit-thesys Dec 23, 2025
e66d43b
Merge branch 'main' of https://github.com/thesysdev/crayon into butto…
ankit-thesys Dec 23, 2025
34c6a40
Update version in package.json from 0.9.8 to 0.9.9 for @crayonai/reac…
ankit-thesys Dec 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/packages/react-core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export { useThreadListState } from "./hooks/useThreadListState";
export { useThreadManagerSelector } from "./hooks/useThreadManagerSelector";
export { useThreadState } from "./hooks/useThreadState";
export { processStreamedMessage } from "./stream/processStreamedMessage";
export { UseThreadListManagerParams, useThreadListManager } from "./useThreadListManager";
export { UseThreadManagerParams, useThreadManager } from "./useThreadManager";
export { useThreadListManager, type UseThreadListManagerParams } from "./useThreadListManager";
export { useThreadManager, type UseThreadManagerParams } from "./useThreadManager";

export * from "./types";
2 changes: 1 addition & 1 deletion js/packages/react-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"type": "module",
"name": "@crayonai/react-ui",
"license": "MIT",
"version": "0.9.8",
"version": "0.9.9",
"description": "Component library for Generative UI SDK",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
39 changes: 39 additions & 0 deletions js/packages/react-ui/src/components/BottomTray/Container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import clsx from "clsx";
import { LayoutContextProvider } from "../../context/LayoutContext";
import { ShellStoreProvider } from "../Shell/store";

interface ContainerProps {
children?: React.ReactNode;
logoUrl: string;
agentName: string;
className?: string;
/** Control the open state of the tray */
isOpen?: boolean;
}

export const Container = ({
children,
logoUrl,
agentName,
className,
isOpen = false,
}: ContainerProps) => {
return (
<ShellStoreProvider logoUrl={logoUrl} agentName={agentName}>
<LayoutContextProvider layout="tray">
<div
className={clsx(
"crayon-bottom-tray-container",
{
"crayon-bottom-tray-container--open": isOpen,
"crayon-bottom-tray-container--closed": !isOpen,
},
className,
)}
>
{children}
</div>
</LayoutContextProvider>
</ShellStoreProvider>
);
};
72 changes: 72 additions & 0 deletions js/packages/react-ui/src/components/BottomTray/Header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
import { useThreadListActions } from "@crayonai/react-core";
import clsx from "clsx";
import { SquarePen, X } from "lucide-react";
import { ReactNode } from "react";
import { IconButton } from "../IconButton";
import { useShellStore } from "../Shell/store";
import { ThreadListContainer } from "./ThreadListContainer";

export const BottomTrayNewChatButton = () => {
const { switchToNewThread } = useThreadListActions();

return (
<IconButton
icon={<SquarePen size="1em" />}
onClick={switchToNewThread}
variant="tertiary"
aria-label="New chat"
className="crayon-bottom-tray-header-new-chat-button"
/>
);
};

interface HeaderProps {
className?: string;
/** Custom content to render on the rightmost side of the logo container */
rightChildren?: ReactNode;
/** Callback when minimize button is clicked */
onMinimize?: () => void;
/** Hide the minimize button */
hideMinimizeButton?: boolean;
/** Custom new chat button */
hideNewChatButton?: boolean;
/** Hide the thread list container */
hideThreadListContainer?: boolean;
}

export const Header = ({
className,
rightChildren,
onMinimize,
hideMinimizeButton = false,
hideNewChatButton = false,
hideThreadListContainer = false,
}: HeaderProps) => {
const { logoUrl, agentName } = useShellStore((state) => ({
logoUrl: state.logoUrl,
agentName: state.agentName,
}));

return (
<div className={clsx("crayon-bottom-tray-header", className)}>
<div className="crayon-bottom-tray-header-logo-container">
<img className="crayon-bottom-tray-header-logo" src={logoUrl} alt="Logo" />
<span className="crayon-bottom-tray-header-agent-name">{agentName}</span>
</div>
<div className="crayon-bottom-tray-header-actions">
{rightChildren}
{!hideThreadListContainer && <ThreadListContainer />}
{!hideNewChatButton && <BottomTrayNewChatButton />}
{!hideMinimizeButton && onMinimize && (
<IconButton
icon={<X size="1em" />}
onClick={onMinimize}
variant="tertiary"
aria-label="Minimize chat"
className="crayon-bottom-tray-header-minimize"
/>
)}
</div>
</div>
);
};
Loading