The Open Standard for Generative UI
shell component
abhishek2dcbfa1c4a61
diff --git a/frontend-sdk/packages/react-core/src/hooks/useThreadManagerSelector.ts b/frontend-sdk/packages/react-core/src/hooks/useThreadManagerSelector.tsindex d7db98f55..0bad4c8b9 100644--- a/frontend-sdk/packages/react-core/src/hooks/useThreadManagerSelector.ts+++ b/frontend-sdk/packages/react-core/src/hooks/useThreadManagerSelector.ts@@ -1,4 +1,5 @@import { useStore } from "zustand";+import { useShallow } from "zustand/shallow";import { useChatContext } from "../internal/ChatContext";import { ThreadManager } from "../types";@@ -11,5 +12,5 @@ type AtomicAccessor<T> = (store: ThreadManager) => T;*/export const useThreadManagerSelector = <R>(accessor: AtomicAccessor<R>): R => {const { threadManager } = useChatContext();- return useStore(threadManager, accessor);+ return useStore(threadManager, useShallow(accessor));};diff --git a/frontend-sdk/packages/react-core/src/hooks/useThreadState.ts b/frontend-sdk/packages/react-core/src/hooks/useThreadState.tsindex e36b4e514..b3960bc9d 100644--- a/frontend-sdk/packages/react-core/src/hooks/useThreadState.ts+++ b/frontend-sdk/packages/react-core/src/hooks/useThreadState.ts@@ -13,7 +13,6 @@ export const useThreadState = (): ThreadState => {return {isRunning: useStore(threadManager, (store) => store.isRunning),- isDisabled: useStore(threadManager, (store) => store.isDisabled),messages: useStore(threadManager, (store) => store.messages),error: useStore(threadManager, (store) => store.error),responseTemplates: useStore(threadManager, (store) => store.responseTemplates),diff --git a/frontend-sdk/packages/react-core/src/internal/useThreadManagerStore.ts b/frontend-sdk/packages/react-core/src/internal/useThreadManagerStore.tsindex a88d10715..8bbcad827 100644--- a/frontend-sdk/packages/react-core/src/internal/useThreadManagerStore.ts+++ b/frontend-sdk/packages/react-core/src/internal/useThreadManagerStore.ts@@ -10,7 +10,6 @@ export const useThreadManagerStore = (inputThreadManager: ThreadManager) => {const [threadManagerStore] = useState(() =>create<ThreadManager>(() => ({- isDisabled: inputThreadManager.isDisabled,isRunning: inputThreadManager.isRunning,messages: inputThreadManager.messages,error: inputThreadManager.error,@@ -26,13 +25,11 @@ export const useThreadManagerStore = (inputThreadManager: ThreadManager) => {useEffect(() => {threadManagerStore.setState({- isDisabled: inputThreadManager.isDisabled,isRunning: inputThreadManager.isRunning,messages: inputThreadManager.messages,error: inputThreadManager.error,});- // no dependency array, since we want to update these values on each rerender- });+ }, [inputThreadManager.isRunning, inputThreadManager.messages, inputThreadManager.error]);if (inputThreadManagerRef.current.responseTemplates !== inputThreadManager.responseTemplates) {throw new Error("memoize response templates");diff --git a/frontend-sdk/packages/react-core/src/types/chatManager.ts b/frontend-sdk/packages/react-core/src/types/chatManager.tsindex ca017f8ea..81a4ca215 100644--- a/frontend-sdk/packages/react-core/src/types/chatManager.ts+++ b/frontend-sdk/packages/react-core/src/types/chatManager.ts@@ -31,7 +31,6 @@ export type ThreadActions = {* Represents the state of a thread*/export type ThreadState = {- isDisabled?: boolean | undefined;/** Indicates if the thread is currently processing and controls should be disabled */isRunning?: boolean | undefined;messages: Message[];diff --git a/frontend-sdk/packages/react-core/src/types/responseTemplate.ts b/frontend-sdk/packages/react-core/src/types/responseTemplate.tsindex 2de986f54..6f3c30a90 100644--- a/frontend-sdk/packages/react-core/src/types/responseTemplate.ts+++ b/frontend-sdk/packages/react-core/src/types/responseTemplate.ts@@ -1,4 +1,5 @@export interface ResponseTemplate {name: string;Component: React.ComponentType;+ renderWithoutMessageContainer?: boolean;}diff --git a/frontend-sdk/packages/react-ui/.storybook/main.ts b/frontend-sdk/packages/react-ui/.storybook/main.tsindex 2de07a859..239fbc760 100644--- a/frontend-sdk/packages/react-ui/.storybook/main.ts+++ b/frontend-sdk/packages/react-ui/.storybook/main.ts@@ -1,4 +1,6 @@import type { StorybookConfig } from "@storybook/react-vite";+import path from "path";+import { mergeConfig } from "vite";const config: StorybookConfig = {stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],@@ -15,5 +17,32 @@ const config: StorybookConfig = {${head}<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/normalize.css">`,+ previewBody: (body) => `+ ${body}+ <style>+ body {+ margin: 0 !important;+ padding: 0 !important;+ }+ </style>+ `,+ viteFinal: async (config) => {+ return mergeConfig(config, {+ resolve: {+ alias: {+ "@crayonai/react-core": path.resolve(__dirname, "../../react-core/src/index.ts"),+ },+ },+ optimizeDeps: {+ exclude: ["@crayonai/react-core"],+ include: ["react", "react-dom"],+ },+ build: {+ commonjsOptions: {+ include: [/@crayonai\/react-core/, /node_modules/],+ },+ },+ });+ },};export default config;diff --git a/frontend-sdk/packages/react-ui/package.json b/frontend-sdk/packages/react-ui/package.jsonindex c1b77458a..954aea3e5 100644--- a/frontend-sdk/packages/react-ui/package.json+++ b/frontend-sdk/packages/react-ui/package.json@@ -48,6 +48,7 @@"sass": "^1.83.4"},"devDependencies": {+ "vite": "^5.0.0","@chromatic-com/storybook": "^3.2.3","@storybook/addon-essentials": "^8.4.7","@storybook/addon-interactions": "^8.4.7",diff --git a/frontend-sdk/packages/react-ui/src/components/FollowUpItem/followUpItem.scss b/frontend-sdk/packages/react-ui/src/components/FollowUpItem/followUpItem.scssindex 4b88aa59b..7515750ff 100644--- a/frontend-sdk/packages/react-ui/src/components/FollowUpItem/followUpItem.scss+++ b/frontend-sdk/packages/react-ui/src/components/FollowUpItem/followUpItem.scss@@ -3,11 +3,9 @@.crayon-follow-up-item {@include cssUtils.typography(primary, default);+ @include cssUtils.button-reset;padding: map.get(cssUtils.$spacing, "xs") map.get(cssUtils.$spacing, "s");border-bottom: 1px solid map.get(cssUtils.$colors, "strokes", "default");- border-top: 0;- border-left: 0;- border-right: 0;background-color: transparent;gap: map.get(cssUtils.$spacing, "xs");display: flex;diff --git a/frontend-sdk/packages/react-ui/src/components/IconButton/iconButton.scss b/frontend-sdk/packages/react-ui/src/components/IconButton/iconButton.scssindex 04f6ea1cd..dfc967138 100644--- a/frontend-sdk/packages/react-ui/src/components/IconButton/iconButton.scss+++ b/frontend-sdk/packages/react-ui/src/components/IconButton/iconButton.scss@@ -64,8 +64,9 @@&-large {width: 36px;height: 36px;+ min-width: 36px;+ min-height: 36px;font-size: 16px;- padding: map.get(cssUtils.$spacing, "m");box-shadow: map.get(cssUtils.$shadow, "l");}diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/Container.tsx b/frontend-sdk/packages/react-ui/src/components/Shell/Container.tsxnew file mode 100644index 000000000..eaa63a50e--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/Container.tsx@@ -0,0 +1,32 @@+import clsx from "clsx";+import { useRef } from "react";+import { LayoutContextProvider } from "../../context/LayoutContext";+import { useElementSize } from "../../hooks/useElementSize";+import { ShellStoreProvider } from "./store";++interface ContainerProps {+ children?: React.ReactNode;+ logoUrl: string;+ agentName: string;+}++export const Container = ({ children, logoUrl, agentName }: ContainerProps) => {+ const ref = useRef<HTMLDivElement>(null);+ const { width } = useElementSize({ ref }) || {};+ const isMobile = width > 0 && width < 768;+ const isFullScreen = width > 768;+ const isTray = false;++ return (+ <ShellStoreProvider logoUrl={logoUrl} agentName={agentName}>+ <LayoutContextProvider isTray={isTray} isFullScreen={isFullScreen} isMobile={isMobile}>+ <div+ className={clsx("crayon-shell-container", { "crayon-shell-container--mobile": isMobile })}+ ref={ref}+ >+ {children}+ </div>+ </LayoutContextProvider>+ </ShellStoreProvider>+ );+};diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/MobileHeader.tsx b/frontend-sdk/packages/react-ui/src/components/Shell/MobileHeader.tsxnew file mode 100644index 000000000..8a8987a60--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/MobileHeader.tsx@@ -0,0 +1,34 @@+import { useThreadListActions } from "@crayonai/react-core";+import { Menu, Plus } from "lucide-react";+import { IconButton } from "../IconButton";+import { useShellStore } from "./store";++export const MobileHeader = () => {+ const { switchToNewThread } = useThreadListActions();+ const { logoUrl, agentName, setIsSidebarOpen } = useShellStore((state) => ({+ logoUrl: state.logoUrl,+ agentName: state.agentName,+ setIsSidebarOpen: state.setIsSidebarOpen,+ }));++ return (+ <div className="crayon-shell-mobile-header">+ <IconButton+ size="medium"+ icon={<Menu size="1em" />}+ onClick={() => setIsSidebarOpen(true)}+ variant="secondary"+ />+ <div className="crayon-shell-mobile-header-logo-container">+ <img className="crayon-shell-mobile-header-logo" src={logoUrl} alt="Logo" />+ <div>{agentName}</div>+ </div>+ <IconButton+ size="medium"+ icon={<Plus size="1em" />}+ onClick={switchToNewThread}+ variant="secondary"+ />+ </div>+ );+};diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/NewChatButton.tsx b/frontend-sdk/packages/react-ui/src/components/Shell/NewChatButton.tsxnew file mode 100644index 000000000..3670befec--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/NewChatButton.tsx@@ -0,0 +1,17 @@+import { useThreadListActions } from "@crayonai/react-core";+import { Plus } from "lucide-react";+import { Button } from "../Button";++export const NewChatButton = () => {+ const { switchToNewThread } = useThreadListActions();++ return (+ <Button+ className="crayon-shell-new-chat-button"+ iconRight={<Plus />}+ onClick={switchToNewThread}+ >+ New Chat+ </Button>+ );+};diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/Sidebar.tsx b/frontend-sdk/packages/react-ui/src/components/Shell/Sidebar.tsxnew file mode 100644index 000000000..30a8ee70a--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/Sidebar.tsx@@ -0,0 +1,85 @@+import clsx from "clsx";+import { PanelLeft, PanelRight } from "lucide-react";+import { useEffect } from "react";+import { useLayoutContext } from "../../context/LayoutContext";+import { IconButton } from "../IconButton";+import { useShellStore } from "./store";++export const SidebarContainer = ({ children }: { children?: React.ReactNode }) => {+ const { isSidebarOpen, setIsSidebarOpen } = useShellStore((state) => ({+ isSidebarOpen: state.isSidebarOpen,+ setIsSidebarOpen: state.setIsSidebarOpen,+ }));+ const { isMobile } = useLayoutContext() || {};++ useEffect(() => {+ if (isMobile) {+ setIsSidebarOpen(false);+ } else {+ setIsSidebarOpen(true);+ }+ }, [isMobile]);++ return (+ <>+ {isMobile && (+ <div+ className={clsx("crayon-shell-sidebar-container__overlay", {+ "crayon-shell-sidebar-container__overlay--collapsed": !isSidebarOpen,+ })}+ onClick={() => {+ setIsSidebarOpen(false);+ }}+ />+ )}+ <div+ className={clsx("crayon-shell-sidebar-container", {+ "crayon-shell-sidebar-container--collapsed": !isSidebarOpen,+ })}+ >+ {children}+ </div>+ </>+ );+};++export const SidebarHeader = () => {+ const { agentName, logoUrl, setIsSidebarOpen, isSidebarOpen } = useShellStore((state) => ({+ agentName: state.agentName,+ logoUrl: state.logoUrl,+ setIsSidebarOpen: state.setIsSidebarOpen,+ isSidebarOpen: state.isSidebarOpen,+ }));++ return (+ <div className="crayon-shell-sidebar-header">+ <img src={logoUrl} alt={agentName} className="crayon-shell-sidebar-header__logo" />+ <div className="crayon-shell-sidebar-header__agent-name">{agentName}</div>+ <IconButton+ icon={isSidebarOpen ? <PanelRight size="1em" /> : <PanelLeft size="1em" />}+ onClick={() => {+ setIsSidebarOpen(!isSidebarOpen);+ }}+ size="large"+ variant="secondary"+ className="crayon-shell-sidebar-header__toggle-button"+ />+ </div>+ );+};++export const SidebarContent = ({ children }: { children?: React.ReactNode }) => {+ const { isSidebarOpen } = useShellStore((state) => ({+ isSidebarOpen: state.isSidebarOpen,+ }));++ if (!isSidebarOpen) {+ return null;+ }++ return <div className="crayon-shell-sidebar-content">{children}</div>;+};++export const SidebarSeparator = () => {+ return <div className="crayon-shell-sidebar-separator" />;+};diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/Thread.tsx b/frontend-sdk/packages/react-ui/src/components/Shell/Thread.tsxnew file mode 100644index 000000000..356b3b341--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/Thread.tsx@@ -0,0 +1,162 @@+import {+ Message,+ useThreadActions,+ useThreadManagerSelector,+ useThreadState,+} from "@crayonai/react-core";+import clsx from "clsx";+import { ArrowRight, Square } from "lucide-react";+import React, { useRef } from "react";+import { useComposerState } from "../../hooks/useComposerState";+import { useScrollToBottom } from "../../hooks/useScrollToBottom";+import { IconButton } from "../IconButton";+import { useShellStore } from "./store";++export const ThreadContainer = ({+ children,+ className,+}: {+ children?: React.ReactNode;+ className?: string;+}) => {+ return <div className={clsx("crayon-shell-thread-container", className)}>{children}</div>;+};++export const ScrollArea = ({+ children,+ className,+}: {+ children?: React.ReactNode;+ className?: string;+}) => {+ const ref = useRef<HTMLDivElement>(null);+ const { messages } = useThreadState();+ useScrollToBottom(ref, JSON.stringify(messages[messages.length - 1]));++ return (+ <div ref={ref} className={clsx("crayon-shell-thread-scroll-area", className)}>+ {children}+ </div>+ );+};++export const Messages = ({ className }: { className?: string }) => {+ const { messages } = useThreadState();++ return (+ <div className={clsx("crayon-shell-thread-messages", className)}>+ {messages.map((message) => (+ <RenderMessage key={message.id} message={message} />+ ))}+ </div>+ );+};++const FallbackTemplate = () => {+ return <div>Unable to render the response</div>;+};++export const AssistantMessageContainer = ({+ children,+ className,+}: {+ children?: React.ReactNode;+ className?: string;+}) => {+ const { logoUrl } = useShellStore((store) => ({+ logoUrl: store.logoUrl,+ }));++ return (+ <div className={clsx("crayon-shell-thread-message-assistant", className)}>+ <img src={logoUrl} alt="Assistant" className="crayon-shell-thread-message-assistant__logo" />+ <div+ className={clsx({+ "crayon-shell-thread-message-assistant__text": typeof children === "string",+ })}+ >+ {children}+ </div>+ </div>+ );+};++export const UserMessageContainer = ({+ children,+ className,+}: {+ children?: React.ReactNode;+ className?: string;+}) => {+ return (+ <div className={clsx("crayon-shell-thread-message-user", className)}>+ <div className="crayon-shell-thread-message-user__content">{children}</div>+ </div>+ );+};++export const RenderMessage = ({ message, className }: { message: Message; className?: string }) => {+ const responseTemplates = useThreadManagerSelector((store) => store.responseTemplates);+ const MessageContainer =+ message.role === "user" ? UserMessageContainer : AssistantMessageContainer;++ if (message.role === "assistant" && message.responseTemplate) {+ const Template = responseTemplates[message.responseTemplate.name];++ const Fallback = responseTemplates["fallback"]?.Component || FallbackTemplate;++ return (+ <MessageContainer className={className}>+ {Template ? (+ <Template.Component {...message.responseTemplate.templateProps} />+ ) : (+ <Fallback {...message.responseTemplate.templateProps} />+ )}+ </MessageContainer>+ );+ }++ return <MessageContainer>{message.message}</MessageContainer>;+};++export const Composer = ({ className }: { className?: string }) => {+ const { textContent, setTextContent } = useComposerState();+ const { processMessage } = useThreadActions();+ const { isRunning } = useThreadState();++ const handleSubmit = () => {+ if (!textContent.trim() || isRunning) {+ return;+ }++ processMessage({+ role: "user",+ message: textContent,+ });++ setTextContent("");+ };++ return (+ <div className={clsx("crayon-shell-thread-composer", className)}>+ <div className="crayon-shell-thread-composer__input-wrapper">+ <textarea+ value={textContent}+ onChange={(e) => setTextContent(e.target.value)}+ className="crayon-shell-thread-composer__input"+ placeholder="Type your message..."+ onKeyDown={(e) => {+ if (e.key === "Enter" && !e.shiftKey) {+ e.preventDefault();+ handleSubmit();+ }+ }}+ />+ <IconButton+ onClick={handleSubmit}+ icon={isRunning ? <Square size="1em" fill="currentColor" /> : <ArrowRight size="1em" />}+ />+ </div>+ </div>+ );+};diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/ThreadList.tsx b/frontend-sdk/packages/react-ui/src/components/Shell/ThreadList.tsxnew file mode 100644index 000000000..c0afccc16--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/ThreadList.tsx@@ -0,0 +1,114 @@+import { Thread, useThreadListActions, useThreadListState } from "@crayonai/react-core";+import clsx from "clsx";+import { Fragment, useContext, useEffect } from "react";+import { SidebarContext } from "../fullscreen/Fullscreen";++export const ThreadList = ({ className }: { className?: string }) => {+ let { threads } = useThreadListState();+ const { load } = useThreadListActions();+ const { searchText } = useContext(SidebarContext);++ useEffect(() => {+ load();+ }, []);++ threads = threads.filter((thread) => thread.title.includes(searchText));++ const groupThreads = () => {+ const now = new Date();+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());+ const yesterday = new Date(today);+ yesterday.setDate(yesterday.getDate() - 1);+ const last7Days = new Date(today);+ last7Days.setDate(last7Days.getDate() - 7);+ const last30Days = new Date(today);+ last30Days.setDate(last30Days.getDate() - 30);+ const thisYear = new Date(today);+ thisYear.setMonth(0, 1);++ return threads.reduce(+ (groups, thread) => {+ const threadDate = new Date(thread.createdAt);++ if (threadDate >= today) {+ groups.today = [...(groups.today || []), thread];+ } else if (threadDate >= yesterday) {+ groups.yesterday = [...(groups.yesterday || []), thread];+ } else if (threadDate >= last7Days) {+ groups.last7Days = [...(groups.last7Days || []), thread];+ } else if (threadDate >= last30Days) {+ groups.last30Days = [...(groups.last30Days || []), thread];+ } else if (threadDate >= thisYear) {+ groups.thisYear = [...(groups.thisYear || []), thread];+ } else {+ groups.older = [...(groups.older || []), thread];+ }++ return groups;+ },+ {+ today: [] as Thread[],+ yesterday: [] as Thread[],+ last7Days: [] as Thread[],+ last30Days: [] as Thread[],+ thisYear: [] as Thread[],+ older: [] as Thread[],+ },+ );+ };++ const groupedThreads = groupThreads();+ const groupLabels: { [key in keyof typeof groupedThreads]: string } = {+ today: "Today",+ yesterday: "Yesterday",+ last7Days: "Previous 7 Days",+ last30Days: "Previous 30 Days",+ thisYear: "This Year",+ older: "Older",+ };++ return (+ <div className={clsx("crayon-shell-thread-list", className)}>+ {Object.entries(groupedThreads)+ .filter(([_, groupThreads]) => groupThreads.length > 0)+ .map(([group, groupThreads]) => (+ <Fragment key={group}>+ <div className="crayon-shell-thread-list-group">+ {groupLabels[group as keyof typeof groupLabels]}+ </div>+ {groupThreads.map((thread) => (+ <ThreadButton key={thread.threadId} id={thread.threadId} title={thread.title} />+ ))}+ </Fragment>+ ))}+ </div>+ );+};++export const ThreadButton = ({+ id,+ title,+ className,+}: {+ id: string;+ title: string;+ className?: string;+}) => {+ const { selectThread } = useThreadListActions();+ const { selectedThreadId } = useThreadListState();++ return (+ <button+ onClick={() => selectThread(id)}+ className={clsx(+ "crayon-shell-thread-button",+ {+ "crayon-shell-thread-button--selected": selectedThreadId === id,+ },+ className,+ )}+ >+ {title}+ </button>+ );+};diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/index.ts b/frontend-sdk/packages/react-ui/src/components/Shell/index.tsnew file mode 100644index 000000000..e69de29bbdiff --git a/frontend-sdk/packages/react-ui/src/components/Shell/mobileHeader.scss b/frontend-sdk/packages/react-ui/src/components/Shell/mobileHeader.scssnew file mode 100644index 000000000..f102582f2--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/mobileHeader.scss@@ -0,0 +1,29 @@+@use "sass:map";+@use "../../cssUtils" as cssUtils;+++.crayon-shell-mobile-header {+ display: none;++ .crayon-shell-container--mobile & {+ display: flex;+ align-items: center;+ justify-content: space-between;+ padding: map.get(cssUtils.$spacing, "m") map.get(cssUtils.$spacing, "l");+ background-color: map.get(cssUtils.$colors, fills, container);+ }++}++.crayon-shell-mobile-header-logo-container {+ display: flex;+ align-items: center;+ gap: map.get(cssUtils.$spacing, "m");+ @include cssUtils.typography(title, medium)+}++.crayon-shell-mobile-header-logo {+ width: 32px;+ height: 32px;+ border-radius: map.get(cssUtils.$radius, "m");+}diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/shell.scss b/frontend-sdk/packages/react-ui/src/components/Shell/shell.scssnew file mode 100644index 000000000..bbd7e99d4--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/shell.scss@@ -0,0 +1,30 @@+@use "../../cssUtils" as cssUtils;+@use "sass:map";+@use "./sidebar.scss";+@use "./threadlist.scss";+@use "./thread.scss";+@use "./mobileHeader.scss";++.crayon-shell-container {+ display: flex;+ position: relative;+ height: 100vh;+ width: 100vw;+ padding: map.get(cssUtils.$spacing, "m");+ overflow: hidden;+ // todo: replace with css variable+ background: #efefef;+ box-sizing: border-box;+ & * {+ box-sizing: border-box;+ }++ &.crayon-shell-container--mobile {+ padding: 0+ }+}++.crayon-shell-new-chat-button {+ width: 100%;+ justify-content: space-between;+}diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/sidebar.scss b/frontend-sdk/packages/react-ui/src/components/Shell/sidebar.scssnew file mode 100644index 000000000..07d8d1a81--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/sidebar.scss@@ -0,0 +1,106 @@+@use "../../cssUtils" as cssUtils;+@use "sass:map";++$sidebar-width: 272px;+$sidebar-padding: map.get(cssUtils.$spacing, "m");+$sidebar-mobile-width: 294px;+$sidebar-mobile-padding: map.get(cssUtils.$spacing, "l");++.crayon-shell-sidebar-container {+ //todo: fills elevated container+ background: rgba(255, 255, 255, 0.60);+ height: 100%;+ width: $sidebar-width;+ border-radius: 12px;+ padding: $sidebar-padding;+ display: flex;+ flex-direction: column;+ gap: map.get(cssUtils.$spacing, "m");++ .crayon-shell-container--mobile & {+ width: $sidebar-mobile-width;+ padding: $sidebar-mobile-padding;+ position: absolute;+ left: 0;+ top: 0;+ z-index: 1000;+ background-color: map.get(cssUtils.$colors, fills, container);+ border-radius: 0;+ transition: left 0.3s ease-in-out;+ }++ &--collapsed {+ width: min-content;+ height: min-content;++ .crayon-shell-container--mobile & {+ width: $sidebar-mobile-width;+ height: 100%;+ left: -$sidebar-mobile-width;+ }+ }+}++.crayon-shell-sidebar-header {+ display: flex;+ align-items: center;+ gap: map.get(cssUtils.$spacing, "s");++ &__logo {+ width: 36px;+ height: 36px;+ // todo check the border radius+ border-radius: map.get(cssUtils.$radius, "s");+ }++ &__agent-name {+ @include cssUtils.typography(primary, default);+ flex-grow: 1;+ color: map.get(cssUtils.$colors, "primary");++ .crayon-shell-sidebar-container--collapsed & {+ display: none;+ }+ }+}++.crayon-shell-sidebar-content {+ width: calc($sidebar-width - ($sidebar-padding * 2));++ .crayon-shell-container--mobile & {+ width: 100%;+ }++ display: flex;+ flex-direction: column;+ gap: map.get(cssUtils.$spacing, "m");+ overflow: hidden;+}++.crayon-shell-sidebar-separator {+ height: 1px;+ width: 100%;+ background-color: map.get(cssUtils.$colors, strokes, default);+}++.crayon-shell-sidebar-header__toggle-button {++ .crayon-shell-container--mobile & {+ display: none;+ }+}++.crayon-shell-sidebar-container__overlay {+ position: absolute;+ left: 0;+ top: 0;+ width: 100%;+ height: 100%;+ background-color: map.get(cssUtils.$colors, fills, overlay);+ transition: opacity 0.3s ease-in-out;++ &--collapsed {+ opacity: 0;+ pointer-events: none;+ }+}diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/store.tsx b/frontend-sdk/packages/react-ui/src/components/Shell/store.tsxnew file mode 100644index 000000000..e345d6095--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/store.tsx@@ -0,0 +1,53 @@+import { createContext, useContext, useEffect, useMemo } from "react";+import { create } from "zustand";+import { useShallow } from "zustand/shallow";++interface ShellState {+ isSidebarOpen: boolean;+ agentName: string;+ logoUrl: string;+ setIsSidebarOpen: (isOpen: boolean) => void;+ setAgentName: (name: string) => void;+ setLogoUrl: (url: string) => void;+}++export const createShellStore = () =>+ create<ShellState>((set) => ({+ isSidebarOpen: true,+ agentName: "",+ logoUrl: "",++ setIsSidebarOpen: (isOpen: boolean) => set({ isSidebarOpen: isOpen }),+ setAgentName: (name: string) => set({ agentName: name }),+ setLogoUrl: (url: string) => set({ logoUrl: url }),+ }));++export const ShellStoreContext = createContext<ReturnType<typeof createShellStore> | null>(null);++export const useShellStore = <T,>(selector: (state: ShellState) => T): T => {+ const store = useContext(ShellStoreContext);+ if (!store) {+ throw new Error("useShellStore must be used within ShellStoreProvider");+ }++ return store(useShallow(selector));+};++export const ShellStoreProvider = ({+ children,+ agentName,+ logoUrl,+}: {+ children: React.ReactNode;+ logoUrl: string;+ agentName: string;+}) => {+ const shellStore = useMemo(() => createShellStore(), []);+ useEffect(() => {+ const { setAgentName, setLogoUrl } = shellStore.getState();+ setAgentName(agentName);+ setLogoUrl(logoUrl);+ }, [agentName, logoUrl]);++ return <ShellStoreContext.Provider value={shellStore}>{children}</ShellStoreContext.Provider>;+};diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/stories/Shell.stories.tsx b/frontend-sdk/packages/react-ui/src/components/Shell/stories/Shell.stories.tsxnew file mode 100644index 000000000..916f1b9a6--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/stories/Shell.stories.tsx@@ -0,0 +1,111 @@+import {+ ChatProvider,+ Message,+ useThreadListManager,+ useThreadManager,+} from "@crayonai/react-core";+import "../../IconButton/iconButton.scss";+import { Container } from "../Container";+import { MobileHeader } from "../MobileHeader";+import { NewChatButton } from "../NewChatButton";+import "../shell.scss";+import { SidebarContainer, SidebarContent, SidebarHeader, SidebarSeparator } from "../Sidebar";+import { Composer, Messages, ScrollArea, ThreadContainer } from "../Thread";+import { ThreadList } from "../ThreadList";+import logoUrl from "./thesysdev_logo.jpeg";++export default {+ title: "Shell",+};++export const Default = {+ render: () => {+ const threadListManager = useThreadListManager({+ fetchThreadList: async () => {+ await new Promise((resolve) => setTimeout(resolve, 1000));+ return [+ {+ threadId: "1",+ title: "test",+ createdAt: new Date(),+ isRunning: false,+ },+ {+ threadId: "2",+ title: "test 2",+ createdAt: new Date(),+ isRunning: false,+ },+ {+ threadId: "3",+ title: "test 3",+ createdAt: new Date(),+ isRunning: false,+ },+ ];+ },+ deleteThread: async () => {},+ updateThread: async (t) => t,+ onSwitchToNew: () => {},+ onSelectThread: () => {},+ });++ const threadManager = useThreadManager({+ threadId: threadListManager.selectedThreadId,+ loadThread: async () => {+ return [+ {+ id: crypto.randomUUID(),+ role: "user",+ type: "prompt",+ message: "Hello",+ },+ {+ id: crypto.randomUUID(),+ role: "assistant",+ type: "response",+ message: "Hello",+ },+ ];+ },+ onProcessMessage: async ({ message, threadManager, abortController }) => {+ const newMessage = Object.assign({}, message, {+ id: crypto.randomUUID(),+ }) as Message;++ return [+ newMessage,+ {+ id: crypto.randomUUID(),+ role: "assistant",+ type: "response",+ message: "sadfasdf",+ },+ ];+ },+ responseTemplates: [],+ });++ return (+ <ChatProvider threadListManager={threadListManager} threadManager={threadManager}>+ <Container logoUrl={logoUrl} agentName="Crayon">+ <SidebarContainer>+ <SidebarHeader />+ <SidebarContent>+ <NewChatButton />+ <SidebarSeparator />+ <ThreadList />+ </SidebarContent>+ </SidebarContainer>+ <ThreadContainer>+ <MobileHeader />+ <ScrollArea>+ <Messages />+ </ScrollArea>+ <Composer />+ </ThreadContainer>+ </Container>+ </ChatProvider>+ );+ },+};diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/stories/thesysdev_logo.jpeg b/frontend-sdk/packages/react-ui/src/components/Shell/stories/thesysdev_logo.jpegnew file mode 100644index 000000000..755421486Binary files /dev/null and b/frontend-sdk/packages/react-ui/src/components/Shell/stories/thesysdev_logo.jpeg differdiff --git a/frontend-sdk/packages/react-ui/src/components/Shell/thread.scss b/frontend-sdk/packages/react-ui/src/components/Shell/thread.scssnew file mode 100644index 000000000..33f8db1e5--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/thread.scss@@ -0,0 +1,108 @@+@use "../../cssUtils" as cssUtils;+@use "sass:map";++.crayon-shell-thread-container {+ flex: 1;+ overflow: hidden;+ display: flex;+ flex-direction: column;+}++$center-align-spacing: calc(32px + map.get(cssUtils.$spacing, "s"));++.crayon-shell-thread-scroll-area {+ width: 100%;+ flex: 1;+ overflow: auto;+ padding: map.get(cssUtils.$spacing, "m") $center-align-spacing 0;++ .crayon-shell-container--mobile & {+ padding: map.get(cssUtils.$spacing, "l");+ }+}++.crayon-shell-thread-messages {+ max-width: 776px;+ margin: 0 auto;+ display: flex;+ flex-direction: column;+ gap: calc(2 * map.get(cssUtils.$spacing, "l"));+}++.crayon-shell-thread-message-assistant {+ width: 100%;+ display: flex;+ gap: map.get(cssUtils.$spacing, "s");+ padding-right: $center-align-spacing;+ overflow: hidden;++ .crayon-shell-container--mobile & {+ padding: 0;+ }++ &__text {+ margin-top: map.get(cssUtils.$spacing, "xs");+ @include cssUtils.typography(primary, default);+ }++ &__logo {+ width: 32px;+ height: 32px;+ border-radius: map.get(cssUtils.$radius, "m");+ }+}++.crayon-shell-thread-message-user {+ display: flex;+ justify-content: flex-end;+ padding: 0 $center-align-spacing;++ .crayon-shell-container--mobile & {+ padding: 0;+ }++ &__content {+ @include cssUtils.typography(primary, default);+ padding: map.get(cssUtils.$spacing, "m") map.get(cssUtils.$spacing, "l");+ // todo: update with css variable+ background-color: #000;+ color: #fff;+ border-radius: map.get(cssUtils.$radius, "2xl");+ overflow-wrap: break-word;+ max-width: 100%;+ }+}++.crayon-shell-thread-composer {+ max-width: 776px;+ width: 100%;+ margin: 0 auto map.get(cssUtils.$spacing, "m");+ padding: 0 $center-align-spacing;++ .crayon-shell-container--mobile & {+ margin: 0;+ padding: map.get(cssUtils.$spacing, "m") 14px;+ background-color: map.get(cssUtils.$colors, fills, container);+ }++ &__input-wrapper {+ border: 1.256px solid map.get(cssUtils.$colors, strokes, default);+ border-radius: map.get(cssUtils.$radius, "xl");+ display: flex;+ align-items: center;+ gap: map.get(cssUtils.$spacing, "s");+ padding: map.get(cssUtils.$spacing, "m");+ }++ &__input {+ flex-grow: 1;+ padding: 0;+ resize: none;+ height: 1.5em;+ outline: none;+ border: none;+ background: transparent;+ overflow: hidden;+ @include cssUtils.typography(primary, default);+ }+}diff --git a/frontend-sdk/packages/react-ui/src/components/Shell/threadlist.scss b/frontend-sdk/packages/react-ui/src/components/Shell/threadlist.scssnew file mode 100644index 000000000..efcf05b6b--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/components/Shell/threadlist.scss@@ -0,0 +1,32 @@+@use "../../cssUtils" as cssUtils;+@use "sass:map";++.crayon-shell-thread-list {+ display: flex;+ flex-direction: column;+ gap: map.get(cssUtils.$spacing, "s");+ overflow: auto;+}++.crayon-shell-thread-list-group {+ display: flex;+ padding-left: map.get(cssUtils.$spacing, "xs");+ color: map.get(cssUtils.$colors, "text", "secondary");+ @include cssUtils.typography(label, default);+}++.crayon-shell-thread-button {+ width: 100%;+ @include cssUtils.button-reset;+ @include cssUtils.typography(primary, default);+ padding: map.get(cssUtils.$spacing, "2xs") map.get(cssUtils.$spacing, "xs");+ border-radius: map.get(cssUtils.$radius, "s");+ border: 1px solid transparent;+ text-align: left;+ cursor: pointer;++ &--selected {+ background-color: map.get(cssUtils.$colors, "fills", "sunk");+ border-color: map.get(cssUtils.$colors, "stokes", "default");+ }+}\ No newline at end of filediff --git a/frontend-sdk/packages/react-ui/src/components/fullscreen/Fullscreen.tsx b/frontend-sdk/packages/react-ui/src/components/fullscreen/Fullscreen.tsxdeleted file mode 100644index 3a98706db..000000000--- a/frontend-sdk/packages/react-ui/src/components/fullscreen/Fullscreen.tsx+++ /dev/null@@ -1,343 +0,0 @@-import {- Message,- Thread,- useThreadActions,- useThreadListActions,- useThreadListState,- useThreadManagerSelector,- useThreadState,-} from "@crayonai/react-core";-import clsx from "clsx";-import { PanelLeft, PanelRight, Plus, Search, SendHorizontal } from "lucide-react";-import { createContext, Fragment, useContext, useEffect, useRef, useState } from "react";-import { useComposerState } from "../../hooks/useComposerState";-import { useScrollToBottom } from "../../hooks/useScrollToBottom";--export const Container = ({- children,- className,-}: React.PropsWithChildren<{ className?: string }>) => {- return <div className={clsx("cui-fullscreen-container", className)}>{children}</div>;-};--type SidebarContextType = {- isOpen: boolean;- setIsOpen: (isOpen: boolean) => void;- searchText: string;- setSearchText: (searchText: string) => void;-};--export const SidebarContext = createContext<SidebarContextType>({- isOpen: true,- setIsOpen: () => {},- searchText: "",- setSearchText: () => {},-});--export const useSidebarContext = () => useContext(SidebarContext);--export const SidebarContainer = ({- children,- className,-}: React.PropsWithChildren<{ className?: string }>) => {- const [isOpen, setIsOpen] = useState(true);- const [searchText, setSearchText] = useState("");-- return (- <SidebarContext.Provider value={{ isOpen, setIsOpen, searchText, setSearchText }}>- <div- className={clsx(- "cui-fullscreen-sidebar",- {- "cui-fullscreen-sidebar-closed": !isOpen,- },- className,- )}- >- {children}- </div>- </SidebarContext.Provider>- );-};--export const SidebarHeader = ({- logoUrl,- title,- className,-}: {- logoUrl: string;- title: string;- className?: string;-}) => {- const { isOpen, setIsOpen } = useContext(SidebarContext);-- return (- <div className={clsx("cui-fullscreen-sidebar-header", className)}>- <div className="cui-fullscreen-sidebar-header-title-icon">- <img src={logoUrl} alt="Logo" className="cui-fullscreen-sidebar-logo" />- <h1 className="cui-fullscreen-sidebar-title">{title}</h1>- </div>- <button className="cui-fullscreen-sidebar-header-button" onClick={() => setIsOpen(!isOpen)}>- {isOpen ? <PanelRight size={16} /> : <PanelLeft size={16} />}- </button>- </div>- );-};--export const SearchInput = ({ className }: { className?: string }) => {- const { searchText, setSearchText } = useContext(SidebarContext);- const inputRef = useRef<HTMLInputElement>(null);-- return (- <div- className={clsx("cui-fullscreen-search-input", className)}- onClick={() => {- if (inputRef.current) {- inputRef.current.focus();- }- }}- >- <Search size={16} />- <input- ref={inputRef}- type="text"- value={searchText}- onChange={(e) => setSearchText(e.target.value)}- className="cui-fullscreen-search-input-input"- placeholder="Search..."- />- </div>- );-};--export const NewChatButton = ({ className }: { className?: string }) => {- const { switchToNewThread } = useThreadListActions();-- return (- <button- onClick={switchToNewThread}- className={clsx("cui-fullscreen-new-chat-button", className)}- >- <Plus />- New Chat- </button>- );-};--export const ThreadButton = ({- id,- title,- className,-}: {- id: string;- title: string;- className?: string;-}) => {- const { selectThread } = useThreadListActions();- const { selectedThreadId } = useThreadListState();-- return (- <button- onClick={() => selectThread(id)}- className={clsx(- "cui-fullscreen-thread-button",- {- "cui-fullscreen-thread-button-selected": selectedThreadId === id,- },- className,- )}- >- {title}- </button>- );-};--export const ThreadList = ({ className }: { className?: string }) => {- let { threads } = useThreadListState();- const { load } = useThreadListActions();- const { searchText } = useContext(SidebarContext);-- useEffect(() => {- load();- }, []);-- threads = threads.filter((thread) => thread.title.includes(searchText));-- const groupThreads = () => {- const now = new Date();- const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());- const yesterday = new Date(today);- yesterday.setDate(yesterday.getDate() - 1);- const last7Days = new Date(today);- last7Days.setDate(last7Days.getDate() - 7);- const last30Days = new Date(today);- last30Days.setDate(last30Days.getDate() - 30);- const thisYear = new Date(today);- thisYear.setMonth(0, 1);-- return threads.reduce(- (groups, thread) => {- const threadDate = new Date(thread.createdAt);-- if (threadDate >= today) {- groups.today = [...(groups.today || []), thread];- } else if (threadDate >= yesterday) {- groups.yesterday = [...(groups.yesterday || []), thread];- } else if (threadDate >= last7Days) {- groups.last7Days = [...(groups.last7Days || []), thread];- } else if (threadDate >= last30Days) {- groups.last30Days = [...(groups.last30Days || []), thread];- } else if (threadDate >= thisYear) {- groups.thisYear = [...(groups.thisYear || []), thread];- } else {- groups.older = [...(groups.older || []), thread];- }-- return groups;- },- {- today: [] as Thread[],- yesterday: [] as Thread[],- last7Days: [] as Thread[],- last30Days: [] as Thread[],- thisYear: [] as Thread[],- older: [] as Thread[],- },- );- };-- const groupedThreads = groupThreads();- const groupLabels: { [key in keyof typeof groupedThreads]: string } = {- today: "Today",- yesterday: "Yesterday",- last7Days: "Previous 7 Days",- last30Days: "Previous 30 Days",- thisYear: "This Year",- older: "Older",- };-- return (- <div className={clsx("cui-fullscreen-thread-list", className)}>- {Object.entries(groupedThreads)- .filter(([_, groupThreads]) => groupThreads.length > 0)- .map(([group, groupThreads]) => (- <Fragment key={group}>- <div className="cui-fullscreen-thread-list-group">- {groupLabels[group as keyof typeof groupLabels]}- </div>- {groupThreads.map((thread) => (- <ThreadButton key={thread.threadId} id={thread.threadId} title={thread.title} />- ))}- </Fragment>- ))}- </div>- );-};--export const ThreadContainer = ({- children,- className,-}: React.PropsWithChildren<{ className?: string }>) => {- return <div className={clsx("cui-fullscreen-thread-container", className)}>{children}</div>;-};--export const ScrollArea = ({- children,- className,-}: React.PropsWithChildren<{ className?: string }>) => {- const ref = useRef<HTMLDivElement>(null);- const { messages } = useThreadState();- useScrollToBottom(ref, messages.length);-- return (- <div ref={ref} className={clsx("cui-fullscreen-scroll-area", className)}>- {children}- </div>- );-};--export const Messages = ({ className }: { className?: string }) => {- const { messages } = useThreadState();-- return (- <div className={clsx("cui-fullscreen-messages", className)}>- {messages.map((message) => (- <RenderMessage key={message.id} message={message} />- ))}- </div>- );-};--const FallbackTemplate = () => {- return <div>Unable to render the response</div>;-};--export const RenderMessage = ({ message, className }: { message: Message; className?: string }) => {- const responseTemplates = useThreadManagerSelector((store) => store.responseTemplates);-- if (message.role === "assistant" && message.responseTemplate) {- const Fallback = responseTemplates["fallback"]?.Component || FallbackTemplate;-- const Template = responseTemplates[message.responseTemplate.name];-- return (- <div className="cui-fullscreen-message cui-fullscreen-message-assistant">- {Template ? (- <Template.Component {...message.responseTemplate.templateProps} />- ) : (- <Fallback {...message.responseTemplate.templateProps} />- )}- </div>- );- }-- return (- <div- className={clsx(- "cui-fullscreen-message",- message.role === "user"- ? "cui-fullscreen-message-user"- : "cui-fullscreen-message-assistant",- className,- )}- >- {message.message}- </div>- );-};--export const Composer = ({ className }: { className?: string }) => {- const { textContent, setTextContent } = useComposerState();- const { processMessage: addMessages } = useThreadActions();-- const handleSubmit = () => {- if (!textContent.trim()) return;-- addMessages({- role: "user",- message: textContent,- });-- setTextContent("");- };-- return (- <div className={clsx("cui-fullscreen-composer", className)}>- <textarea- value={textContent}- onChange={(e) => setTextContent(e.target.value)}- className="cui-fullscreen-composer-input"- placeholder="Type your message..."- onKeyDown={(e) => {- if (e.key === "Enter" && !e.shiftKey) {- e.preventDefault();- handleSubmit();- }- }}- />- <button onClick={handleSubmit} className="cui-fullscreen-composer-button">- <SendHorizontal size={16} />- </button>- </div>- );-};diff --git a/frontend-sdk/packages/react-ui/src/components/fullscreen/index.ts b/frontend-sdk/packages/react-ui/src/components/fullscreen/index.tsdeleted file mode 100644index 8ce9ea805..000000000--- a/frontend-sdk/packages/react-ui/src/components/fullscreen/index.ts+++ /dev/null@@ -1 +0,0 @@-export * from "./Fullscreen";diff --git a/frontend-sdk/packages/react-ui/src/components/fullscreen/style.css b/frontend-sdk/packages/react-ui/src/components/fullscreen/style.cssdeleted file mode 100644index eb48a8c4c..000000000--- a/frontend-sdk/packages/react-ui/src/components/fullscreen/style.css+++ /dev/null@@ -1,225 +0,0 @@-.cui-fullscreen-container {- height: 100vh;- width: 100vw;- padding: 1rem;- display: flex;- gap: 1rem;-}--.cui-fullscreen-sidebar {- width: 264px;- height: 100%;- border-width: 1px;- border-color: rgba(0, 0, 0, 0.06);- flex-shrink: 0;- padding: 0.67rem;- border-radius: 1rem;- display: flex;- flex-direction: column;- gap: 0.5rem;- background-color: rgb(255, 255, 255);- white-space: nowrap;- overflow: hidden;-}--.cui-fullscreen-sidebar.cui-fullscreen-sidebar-closed {- width: 109px;- height: min-content;-}--.cui-fullscreen-sidebar.cui-fullscreen-sidebar-closed > * {- display: none;-}--.cui-fullscreen-sidebar.cui-fullscreen-sidebar-closed .cui-fullscreen-sidebar-header {- display: flex;- width: max-content;-}--.cui-fullscreen-sidebar.cui-fullscreen-sidebar-closed .cui-fullscreen-sidebar-title {- display: none;-}--.cui-fullscreen-sidebar-header {- display: flex;- align-items: center;- justify-content: space-between;- gap: 0.5rem;-}--.cui-fullscreen-sidebar-header-title-icon {- display: flex;- align-items: center;- gap: 0.5rem;-}--.cui-fullscreen-sidebar-logo {- height: 1.5rem;- width: 1.5rem;- margin-right: 0.5rem;-}--.cui-fullscreen-sidebar-title {- font-size: 1.15rem;- font-weight: 400;- font-style: normal;- line-height: 1.5rem;- color: rgb(0, 0, 0);-}--.cui-fullscreen-sidebar-header-button {- display: flex;- align-items: center;- border-radius: 0.5rem;- padding: 0.66rem;- border: 1px solid rgba(0, 0, 0, 0.06);-}--.cui-fullscreen-search-input {- display: flex;- align-items: center;- gap: 0.25rem;- padding: 0.375rem 0.5rem;- border-radius: 0.5rem;- border: 1px solid rgba(0, 0, 0, 0.04);- background-color: rgba(0, 0, 0, 0.04);-}--.cui-fullscreen-search-input-input {- flex-grow: 1;- outline: none;- border: none;- background-color: transparent;- font-size: 0.875rem;- font-style: normal;- font-weight: 400;- line-height: 1.25rem;-}--.cui-fullscreen-new-chat-button {- width: 100%;- padding: 0.5rem 1rem;- border-radius: 0.66rem;- background-color: rgb(0, 0, 0);- display: flex;- align-items: center;- justify-content: left;- gap: 0.5rem;- color: rgb(255, 255, 255);-}--.cui-fullscreen-new-chat-button:hover {- background-color: rgba(0, 0, 0, 0.8);-}--.cui-fullscreen-thread-button {- width: 100%;- padding: 8px;- text-align: left;- border-radius: 10px;- text-overflow: ellipsis;- white-space: nowrap;- overflow: hidden;- flex-shrink: 0;-}--.cui-fullscreen-thread-button-selected {- background-color: rgb(243, 244, 246);- outline: 1px solid rgba(0, 0, 0, 0.06);-}--.cui-fullscreen-thread-button-disabled {- width: 100%;- padding: 8px;- text-align: left;- border-radius: 10px;- text-overflow: ellipsis;- white-space: nowrap;- overflow: hidden;- flex-shrink: 0;- color: rgba(0, 0, 0, 0.4);-}--.cui-fullscreen-thread-list {- display: flex;- flex-direction: column;- gap: 8px;-}--.cui-fullscreen-thread-list-group {- display: flex;- padding-left: 6px;- color: rgba(0, 0, 0, 0.4);-}--.cui-fullscreen-thread-container {- flex-grow: 1;- flex-shrink: 1;- height: 100%;- display: flex;- flex-direction: column;- max-width: 800px;- margin: 0 auto;-}--.cui-fullscreen-scroll-area {- flex-grow: 1;- flex-shrink: 1;- height: 100%;- display: flex;- flex-direction: column;- overflow-y: auto;-}--.cui-fullscreen-messages {- display: flex;- flex-direction: column;- gap: 1rem;- padding: 1rem;-}--.cui-fullscreen-message {- padding: 1rem;- border-radius: 0.375rem;-}--.cui-fullscreen-message-user {- background-color: rgb(219, 234, 254);- margin-left: 2rem;-}--.cui-fullscreen-message-assistant {- background-color: rgb(243, 244, 246);- margin-right: 2rem;-}--.cui-fullscreen-composer {- display: flex;- align-items: center;- gap: 0.67rem;- padding: 0.67rem;- border: 1px solid rgba(0, 0, 0, 0.06);- border-radius: 1rem;- overflow: hidden;-}--.cui-fullscreen-composer-input {- flex-grow: 1;- padding: 0;- resize: none;- height: 1.5em;- outline: none;- overflow: hidden;- color: rgb(0, 0, 0);-}--.cui-fullscreen-composer-button {- padding: 1rem;- background-color: rgb(0, 0, 0);- color: white;- border-radius: 1rem;- border: rgba(0, 0, 0, 0.1);- display: flex;- align-items: center;- justify-content: center;-}diff --git a/frontend-sdk/packages/react-ui/src/context/LayoutContext.tsx b/frontend-sdk/packages/react-ui/src/context/LayoutContext.tsxnew file mode 100644index 000000000..a205bdc7f--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/context/LayoutContext.tsx@@ -0,0 +1,30 @@+import { createContext, useContext, useMemo } from "react";++export const LayoutContext = createContext<{+ isMobile: boolean;+ isFullScreen: boolean;+ isTray: boolean;+} | null>(null);++export const LayoutContextProvider = ({+ children,+ isTray,+ isFullScreen,+ isMobile,+}: {+ children: React.ReactNode;+ isTray: boolean;+ isFullScreen: boolean;+ isMobile: boolean;+}) => {+ const value = useMemo(+ () => ({ isMobile, isFullScreen, isTray }),+ [isMobile, isFullScreen, isTray],+ );+ return <LayoutContext.Provider value={value}>{children}</LayoutContext.Provider>;+};++export const useLayoutContext = () => {+ const context = useContext(LayoutContext);+ return context;+};diff --git a/frontend-sdk/packages/react-ui/src/cssUtils.scss b/frontend-sdk/packages/react-ui/src/cssUtils.scssindex 938c41942..46398296f 100644--- a/frontend-sdk/packages/react-ui/src/cssUtils.scss+++ b/frontend-sdk/packages/react-ui/src/cssUtils.scss@@ -112,3 +112,9 @@ $typography: (font: map.get($typography, $font-name, $font-variant, font);letter-spacing: map.get($typography, $font-name, $font-variant, letter-spacing);}++@mixin button-reset {+ padding: 0;+ border: 0;+ background: transparent;+}diff --git a/frontend-sdk/packages/react-ui/src/hooks/useElementSize.ts b/frontend-sdk/packages/react-ui/src/hooks/useElementSize.tsnew file mode 100644index 000000000..c8fccc6ba--- /dev/null+++ b/frontend-sdk/packages/react-ui/src/hooks/useElementSize.ts@@ -0,0 +1,25 @@+import { useEffect, useState } from "react";++export const useElementSize = ({ ref }: { ref: React.RefObject<HTMLElement | null> }) => {+ const [size, setSize] = useState<{ width: number; height: number }>({ width: 0, height: 0 });++ useEffect(() => {+ if (!ref.current) {+ return;+ }+ const element = ref.current;+ const handleResize = () => {+ setSize({ width: element.clientWidth, height: element.clientHeight });+ };++ const resizeObserver = new ResizeObserver(handleResize);+ resizeObserver.observe(element);++ handleResize();+ return () => {+ resizeObserver.disconnect();+ };+ }, [ref]);++ return size;+};diff --git a/frontend-sdk/packages/react-ui/src/hooks/useScrollToBottom.ts b/frontend-sdk/packages/react-ui/src/hooks/useScrollToBottom.tsindex 336d05dc0..1028cd94a 100644--- a/frontend-sdk/packages/react-ui/src/hooks/useScrollToBottom.ts+++ b/frontend-sdk/packages/react-ui/src/hooks/useScrollToBottom.ts@@ -2,16 +2,18 @@ import { RefObject, useEffect } from "react";export const useScrollToBottom = <T extends HTMLElement | null>(ref: RefObject<T>,- // if the triggerValue changes, scroll to bottom- triggerValue: any,+ // scroll to bottom when this value changes+ triggerScroll: any,) => {useEffect(() => {const element = ref.current;- if (!element) return;+ if (!element || !triggerScroll) {+ return;+ }element.scrollTo({top: element.scrollHeight,behavior: "smooth",});- }, [ref, triggerValue]);+ }, [ref, triggerScroll]);};diff --git a/frontend-sdk/packages/react-ui/src/variables.css b/frontend-sdk/packages/react-ui/src/variables.cssindex d0181c409..0ddc185ed 100644--- a/frontend-sdk/packages/react-ui/src/variables.css+++ b/frontend-sdk/packages/react-ui/src/variables.css@@ -8,7 +8,7 @@ body {--brand-el-hover-fills: #000000;--container-fills: #ffffff;/* need to provide the opacity */- --overlay-fills: #000000;+ --overlay-fills: rgba(0, 0, 0, 0.4);--sunk-fills: #000000a1;--container-hover-fills: #ffffff;--danger-fills: #7f56d9;@@ -182,7 +182,7 @@ body {--brand-el-hover-fills: #000000;--container-fills: #ffffff;/* need to provide the opacity */- --overlay-fills: #000000;+ --overlay-fills: rgba(0, 0, 0, 0.4);--sunk-fills: #000000;--container-hover-fills: #ffffff;--danger-fills: #7f56d9;diff --git a/frontend-sdk/pnpm-lock.yaml b/frontend-sdk/pnpm-lock.yamlindex 3d8b129f3..c3f4d1781 100644--- a/frontend-sdk/pnpm-lock.yaml+++ b/frontend-sdk/pnpm-lock.yaml@@ -134,7 +134,7 @@ importers:version: 8.4.7(@storybook/[email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])'@storybook/react-vite':specifier: ^8.4.7- version: 8.4.7(@storybook/[email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))+ version: 8.4.7(@storybook/[email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected]))'@storybook/test':specifier: ^8.4.7version: 8.4.7([email protected]([email protected]))@@ -174,6 +174,9 @@ importers:storybook:specifier: ^8.4.7version: 8.4.7([email protected])+ vite:+ specifier: ^5.0.0packages:@@ -295,9 +298,9 @@ packages:peerDependencies:storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0- '@esbuild/[email protected]':- resolution: {integrity: sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==}+ engines: {node: '>=12'}cpu: [ppc64]os: [aix]@@ -307,9 +310,9 @@ packages:cpu: [ppc64]os: [aix]- '@esbuild/[email protected]':- resolution: {integrity: sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-c0uX9VAUBQ7dTDCjq+wdyGLowMdtR/GoC2U5IYk/7D1H1JYC0qseD7+11iMP2mRLN9RcCMRcjC4YMclCzGwS/A==}+ engines: {node: '>=12'}cpu: [arm64]os: [android]@@ -319,9 +322,9 @@ packages:cpu: [arm64]os: [android]- '@esbuild/[email protected]':- resolution: {integrity: sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-vCPvzSjpPHEi1siZdlvAlsPxXl7WbOVUBBAowWug4rJHb68Ox8KualB+1ocNvT5fjv6wpkX6o/iEpbDrf68zcg==}+ engines: {node: '>=12'}cpu: [arm]os: [android]@@ -331,9 +334,9 @@ packages:cpu: [arm]os: [android]- '@esbuild/[email protected]':- resolution: {integrity: sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-D7aPRUUNHRBwHxzxRvp856rjUHRFW1SdQATKXH2hqA0kAZb1hKmi02OpYRacl0TxIGz/ZmXWlbZgjwWYaCakTA==}+ engines: {node: '>=12'}cpu: [x64]os: [android]@@ -343,9 +346,9 @@ packages:cpu: [x64]os: [android]- '@esbuild/[email protected]':- resolution: {integrity: sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-DwqXqZyuk5AiWWf3UfLiRDJ5EDd49zg6O9wclZ7kUMv2WRFr4HKjXp/5t8JZ11QbQfUS6/cRCKGwYhtNAY88kQ==}+ engines: {node: '>=12'}cpu: [arm64]os: [darwin]@@ -355,9 +358,9 @@ packages:cpu: [arm64]os: [darwin]- '@esbuild/[email protected]':- resolution: {integrity: sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-se/JjF8NlmKVG4kNIuyWMV/22ZaerB+qaSi5MdrXtd6R08kvs2qCN4C09miupktDitvh8jRFflwGFBQcxZRjbw==}+ engines: {node: '>=12'}cpu: [x64]os: [darwin]@@ -367,9 +370,9 @@ packages:cpu: [x64]os: [darwin]- '@esbuild/[email protected]':- resolution: {integrity: sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-5JcRxxRDUJLX8JXp/wcBCy3pENnCgBR9bN6JsY4OmhfUtIHe3ZW0mawA7+RDAcMLrMIZaf03NlQiX9DGyB8h4g==}+ engines: {node: '>=12'}cpu: [arm64]os: [freebsd]@@ -379,9 +382,9 @@ packages:cpu: [arm64]os: [freebsd]- '@esbuild/[email protected]':- resolution: {integrity: sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-J95kNBj1zkbMXtHVH29bBriQygMXqoVQOQYA+ISs0/2l3T9/kj42ow2mpqerRBxDJnmkUDCaQT/dfNXWX/ZZCQ==}+ engines: {node: '>=12'}cpu: [x64]os: [freebsd]@@ -391,9 +394,9 @@ packages:cpu: [x64]os: [freebsd]- '@esbuild/[email protected]':- resolution: {integrity: sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-ibKvmyYzKsBeX8d8I7MH/TMfWDXBF3db4qM6sy+7re0YXya+K1cem3on9XgdT2EQGMu4hQyZhan7TeQ8XkGp4Q==}+ engines: {node: '>=12'}cpu: [arm64]os: [linux]@@ -403,9 +406,9 @@ packages:cpu: [arm64]os: [linux]- '@esbuild/[email protected]':- resolution: {integrity: sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==}+ engines: {node: '>=12'}cpu: [arm]os: [linux]@@ -415,9 +418,9 @@ packages:cpu: [arm]os: [linux]- '@esbuild/[email protected]':- resolution: {integrity: sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-YvjXDqLRqPDl2dvRODYmmhz4rPeVKYvppfGYKSNGdyZkA01046pLWyRKKI3ax8fbJoK5QbxblURkwK/MWY18Tg==}+ engines: {node: '>=12'}cpu: [ia32]os: [linux]@@ -427,9 +430,9 @@ packages:cpu: [ia32]os: [linux]- '@esbuild/[email protected]':- resolution: {integrity: sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-uHf1BmMG8qEvzdrzAqg2SIG/02+4/DHB6a9Kbya0XDvwDEKCoC8ZRWI5JJvNdUjtciBGFQ5PuBlpEOXQj+JQSg==}+ engines: {node: '>=12'}cpu: [loong64]os: [linux]@@ -439,9 +442,9 @@ packages:cpu: [loong64]os: [linux]- '@esbuild/[email protected]':- resolution: {integrity: sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-IajOmO+KJK23bj52dFSNCMsz1QP1DqM6cwLUv3W1QwyxkyIWecfafnI555fvSGqEKwjMXVLokcV5ygHW5b3Jbg==}+ engines: {node: '>=12'}cpu: [mips64el]os: [linux]@@ -451,9 +454,9 @@ packages:cpu: [mips64el]os: [linux]- '@esbuild/[email protected]':- resolution: {integrity: sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-1hHV/Z4OEfMwpLO8rp7CvlhBDnjsC3CttJXIhBi+5Aj5r+MBvy4egg7wCbe//hSsT+RvDAG7s81tAvpL2XAE4w==}+ engines: {node: '>=12'}cpu: [ppc64]os: [linux]@@ -463,9 +466,9 @@ packages:cpu: [ppc64]os: [linux]- '@esbuild/[email protected]':- resolution: {integrity: sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-2HdXDMd9GMgTGrPWnJzP2ALSokE/0O5HhTUvWIbD3YdjME8JwvSCnNGBnTThKGEB91OZhzrJ4qIIxk/SBmyDDA==}+ engines: {node: '>=12'}cpu: [riscv64]os: [linux]@@ -475,9 +478,9 @@ packages:cpu: [riscv64]os: [linux]- '@esbuild/[email protected]':- resolution: {integrity: sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-zus5sxzqBJD3eXxwvjN1yQkRepANgxE9lgOW2qLnmr8ikMTphkjgXu1HR01K4FJg8h1kEEDAqDcZQtbrRnB41A==}+ engines: {node: '>=12'}cpu: [s390x]os: [linux]@@ -487,9 +490,9 @@ packages:cpu: [s390x]os: [linux]- '@esbuild/[email protected]':- resolution: {integrity: sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-1rYdTpyv03iycF1+BhzrzQJCdOuAOtaqHTWJZCWvijKD2N5Xu0TtVC8/+1faWqcP9iBCWOmjmhoH94dH82BxPQ==}+ engines: {node: '>=12'}cpu: [x64]os: [linux]@@ -505,9 +508,9 @@ packages:cpu: [arm64]os: [netbsd]- '@esbuild/[email protected]':- resolution: {integrity: sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-Woi2MXzXjMULccIwMnLciyZH4nCIMpWQAs049KEeMvOcNADVxo0UBIQPfSmxB3CWKedngg7sWZdLvLczpe0tLg==}+ engines: {node: '>=12'}cpu: [x64]os: [netbsd]@@ -517,21 +520,15 @@ packages:cpu: [x64]os: [netbsd]- '@esbuild/[email protected]':- resolution: {integrity: sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==}- engines: {node: '>=18'}- cpu: [arm64]- os: [openbsd]-'@esbuild/[email protected]':resolution: {integrity: sha512-YQbi46SBct6iKnszhSvdluqDmxCJA+Pu280Av9WICNwQmMxV7nLRHZfjQzwbPs3jeWnuAhE9Jy0NrnJ12Oz+0A==}engines: {node: '>=18'}cpu: [arm64]os: [openbsd]- '@esbuild/[email protected]':- resolution: {integrity: sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-HLNNw99xsvx12lFBUwoT8EVCsSvRNDVxNpjZ7bPn947b8gJPzeHWyNVhFsaerc0n3TsbOINvRP2byTZ5LKezow==}+ engines: {node: '>=12'}cpu: [x64]os: [openbsd]@@ -541,9 +538,9 @@ packages:cpu: [x64]os: [openbsd]- '@esbuild/[email protected]':- resolution: {integrity: sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-6+gjmFpfy0BHU5Tpptkuh8+uw3mnrvgs+dSPQXQOv3ekbordwnzTVEb4qnIvQcYXq6gzkyTnoZ9dZG+D4garKg==}+ engines: {node: '>=12'}cpu: [x64]os: [sunos]@@ -553,9 +550,9 @@ packages:cpu: [x64]os: [sunos]- '@esbuild/[email protected]':- resolution: {integrity: sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-Z0gOTd75VvXqyq7nsl93zwahcTROgqvuAcYDUr+vOv8uHhNSKROyU961kgtCD1e95IqPKSQKH7tBTslnS3tA8A==}+ engines: {node: '>=12'}cpu: [arm64]os: [win32]@@ -565,9 +562,9 @@ packages:cpu: [arm64]os: [win32]- '@esbuild/[email protected]':- resolution: {integrity: sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-SWXFF1CL2RVNMaVs+BBClwtfZSvDgtL//G/smwAc5oVK/UPu2Gu9tIaRgFmYFFKrmg3SyAjSrElf0TiJ1v8fYA==}+ engines: {node: '>=12'}cpu: [ia32]os: [win32]@@ -577,9 +574,9 @@ packages:cpu: [ia32]os: [win32]- '@esbuild/[email protected]':- resolution: {integrity: sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==}- engines: {node: '>=18'}+ '@esbuild/[email protected]':+ resolution: {integrity: sha512-tQd/1efJuzPC6rCFwEvLtci/xNFcTZknmXs98FYDfGE4wP9ClFV98nyKrzJKVPMhdDnjzLhdUyMX4PsQAPjwIw==}+ engines: {node: '>=12'}cpu: [x64]os: [win32]@@ -1881,9 +1878,9 @@ packages:peerDependencies:esbuild: '>=0.12 <1'- resolution: {integrity: sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==}- engines: {node: '>=18'}+ resolution: {integrity: sha512-mg3OPMV4hXywwpoDxu3Qda5xCKQi+vCTZq8S9J/EpkhB2HzKXq4SNFZE3+NK93JYxc8VMSep+lOUSC/RVKaBqw==}+ engines: {node: '>=12'}hasBin: true@@ -2973,27 +2970,22 @@ packages:resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==}hasBin: true- resolution: {integrity: sha512-akD5IAH/ID5imgue2DYhzsEwCi0/4VKY31uhMLEYJwPP4TiUp8pL5PIK+Wo7H8qT8JY9i+pVfPydcFPYD1EL7g==}- engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}+ resolution: {integrity: sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==}+ engines: {node: ^18.0.0 || >=20.0.0}hasBin: truepeerDependencies:- '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0- jiti: '>=1.21.0'+ '@types/node': ^18.0.0 || >=20.0.0less: '*'lightningcss: ^1.21.0sass: '*'sass-embedded: '*'stylus: '*'sugarss: '*'- terser: ^5.16.0- tsx: ^4.8.1- yaml: ^2.4.2+ terser: ^5.4.0peerDependenciesMeta:'@types/node':optional: true- jiti:- optional: trueless:optional: truelightningcss:@@ -3008,10 +3000,6 @@ packages:optional: trueterser:optional: true- tsx:- optional: true- yaml:- optional: trueresolution: {integrity: sha512-TnbFSbcOCcDgjZ4piURLCbJ3nJhznVh9kw6F6iokjiFPl8ONxe9A6nMDVXDiNbrSfLILs6vB07F7wLBrwPYzJw==}@@ -3262,103 +3250,103 @@ snapshots:- '@chromatic-com/playwright'- react- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':@@ -3367,43 +3355,40 @@ snapshots:'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':- optional: true-'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':optional: true- '@esbuild/[email protected]':+ '@esbuild/[email protected]':optional: true'@esbuild/[email protected]':@@ -3489,11 +3474,11 @@ snapshots:wrap-ansi: 8.1.0wrap-ansi-cjs: [email protected]- '@joshwooding/[email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))':+ '@joshwooding/[email protected]([email protected])([email protected](@types/[email protected])([email protected])([email protected]))':dependencies:magic-string: 0.27.0react-docgen-typescript: 2.2.2([email protected])- vite: 6.0.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])optionalDependencies:typescript: 5.7.2@@ -4026,13 +4011,13 @@ snapshots:react: 19.0.0-rc-66855b96-20241106react-dom: 19.0.0-rc-66855b96-20241106([email protected])- '@storybook/[email protected]([email protected]([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))':+ '@storybook/[email protected]([email protected]([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))':dependencies:'@storybook/csf-plugin': 8.4.7([email protected]([email protected]))browser-assert: 1.2.1storybook: 8.4.7([email protected])ts-dedent: 2.2.0- vite: 6.0.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])dependencies:@@ -4109,11 +4094,11 @@ snapshots:react-dom: 19.0.0-rc-66855b96-20241106([email protected])storybook: 8.4.7([email protected])- '@storybook/[email protected](@storybook/[email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))':+ '@storybook/[email protected](@storybook/[email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected])([email protected]([email protected]))([email protected])([email protected](@types/[email protected])([email protected])([email protected]))':dependencies:- '@joshwooding/vite-plugin-react-docgen-typescript': 0.4.2([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))+ '@joshwooding/vite-plugin-react-docgen-typescript': 0.4.2([email protected])([email protected](@types/[email protected])([email protected])([email protected]))'@rollup/pluginutils': 5.1.4([email protected])- '@storybook/builder-vite': 8.4.7([email protected]([email protected]))([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))+ '@storybook/builder-vite': 8.4.7([email protected]([email protected]))([email protected](@types/[email protected])([email protected])([email protected]))'@storybook/react': 8.4.7(@storybook/[email protected]([email protected]([email protected])))([email protected]([email protected]))([email protected])([email protected]([email protected]))([email protected])find-up: 5.0.0magic-string: 0.30.17@@ -4123,7 +4108,7 @@ snapshots:resolve: 1.22.10storybook: 8.4.7([email protected])tsconfig-paths: 4.2.0- vite: 6.0.5(@types/[email protected])([email protected])([email protected])([email protected])([email protected])transitivePeerDependencies:- '@storybook/test'- rollup@@ -4719,32 +4704,31 @@ snapshots:transitivePeerDependencies:- supports-coloroptionalDependencies:- '@esbuild/aix-ppc64': 0.24.0- '@esbuild/android-arm': 0.24.0- '@esbuild/android-arm64': 0.24.0- '@esbuild/android-x64': 0.24.0- '@esbuild/darwin-arm64': 0.24.0- '@esbuild/darwin-x64': 0.24.0- '@esbuild/freebsd-arm64': 0.24.0- '@esbuild/freebsd-x64': 0.24.0- '@esbuild/linux-arm': 0.24.0- '@esbuild/linux-arm64': 0.24.0- '@esbuild/linux-ia32': 0.24.0- '@esbuild/linux-loong64': 0.24.0- '@esbuild/linux-mips64el': 0.24.0- '@esbuild/linux-ppc64': 0.24.0- '@esbuild/linux-riscv64': 0.24.0- '@esbuild/linux-s390x': 0.24.0- '@esbuild/linux-x64': 0.24.0- '@esbuild/netbsd-x64': 0.24.0- '@esbuild/openbsd-arm64': 0.24.0- '@esbuild/openbsd-x64': 0.24.0- '@esbuild/sunos-x64': 0.24.0- '@esbuild/win32-arm64': 0.24.0- '@esbuild/win32-ia32': 0.24.0- '@esbuild/win32-x64': 0.24.0+ '@esbuild/aix-ppc64': 0.21.5+ '@esbuild/android-arm': 0.21.5+ '@esbuild/android-arm64': 0.21.5+ '@esbuild/android-x64': 0.21.5+ '@esbuild/darwin-arm64': 0.21.5+ '@esbuild/darwin-x64': 0.21.5+ '@esbuild/freebsd-arm64': 0.21.5+ '@esbuild/freebsd-x64': 0.21.5+ '@esbuild/linux-arm': 0.21.5+ '@esbuild/linux-arm64': 0.21.5+ '@esbuild/linux-ia32': 0.21.5+ '@esbuild/linux-loong64': 0.21.5+ '@esbuild/linux-mips64el': 0.21.5+ '@esbuild/linux-ppc64': 0.21.5+ '@esbuild/linux-riscv64': 0.21.5+ '@esbuild/linux-s390x': 0.21.5+ '@esbuild/linux-x64': 0.21.5+ '@esbuild/netbsd-x64': 0.21.5+ '@esbuild/openbsd-x64': 0.21.5+ '@esbuild/sunos-x64': 0.21.5+ '@esbuild/win32-arm64': 0.21.5+ '@esbuild/win32-ia32': 0.21.5+ '@esbuild/win32-x64': 0.21.5optionalDependencies:@@ -5798,18 +5782,16 @@ snapshots:- [email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]):dependencies:- esbuild: 0.24.0+ esbuild: 0.21.5postcss: 8.4.49rollup: 4.29.1optionalDependencies:'@types/node': 22.10.7fsevents: 2.3.3- jiti: 1.21.7sass: 1.83.4terser: 5.37.0- yaml: 2.6.1dependencies: