Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(Chat): add missing themeProps and fix className clobber (#4634)

Cindy Zhang52992ae1e188
diff --git a/packages/core/src/Chat/Chat.doc.mjs b/packages/core/src/Chat/Chat.doc.mjs
index 79b45023bd..4f60f135b8 100644
--- a/packages/core/src/Chat/Chat.doc.mjs
+++ b/packages/core/src/Chat/Chat.doc.mjs
@@ -26,6 +26,8 @@ export const docs = {
{className: 'astryx-chat-system-message', visualProps: ['variant']},
{className: 'astryx-chat-message-metadata'},
{className: 'astryx-chat-send-button'},
+ {className: 'astryx-chat-dictation-button'},
+ {className: 'astryx-chat-layout-scroll-button'},
{className: 'astryx-chat-tokenized-text'},
{className: 'astryx-chat-tool-calls'},
{className: 'astryx-trigger-menu'},
diff --git a/packages/core/src/Chat/ChatDictationButton.tsx b/packages/core/src/Chat/ChatDictationButton.tsx
index b3f05d8c8e..bea36aaed0 100644
--- a/packages/core/src/Chat/ChatDictationButton.tsx
+++ b/packages/core/src/Chat/ChatDictationButton.tsx
@@ -26,6 +26,7 @@ import {Button} from '../Button';
import {Icon} from '../Icon';
import {mergeProps} from '../utils';
import type {BaseProps} from '../BaseProps';
+import {themeProps} from '../utils/themeProps';
import {useTranslator} from '../i18n';
// =============================================================================
@@ -140,7 +141,12 @@ export function ChatDictationButton({
return (
<span
ref={ref}
- {...mergeProps(stylex.props(styles.wrapper, xstyle), className, style)}
+ {...mergeProps(
+ themeProps('chat-dictation-button'),
+ stylex.props(styles.wrapper, xstyle),
+ className,
+ style,
+ )}
{...rest}>
{isListening && (
<span
diff --git a/packages/core/src/Chat/ChatLayoutScrollButton.tsx b/packages/core/src/Chat/ChatLayoutScrollButton.tsx
index db30ba6b9b..c0112a6a37 100644
--- a/packages/core/src/Chat/ChatLayoutScrollButton.tsx
+++ b/packages/core/src/Chat/ChatLayoutScrollButton.tsx
@@ -30,6 +30,7 @@ import {Icon} from '../Icon';
import {Button} from '../Button';
import type {BaseProps} from '../BaseProps';
import {mergeProps} from '../utils';
+import {themeProps} from '../utils/themeProps';
import {useTranslator} from '../i18n';
// =============================================================================
@@ -128,7 +129,12 @@ export function ChatLayoutScrollButton({
return (
<div
ref={ref}
- {...mergeProps(stylex.props(styles.wrapper, xstyle), className, style)}
+ {...mergeProps(
+ themeProps('chat-layout-scroll-button'),
+ stylex.props(styles.wrapper, xstyle),
+ className,
+ style,
+ )}
{...rest}>
<div
{...stylex.props(
diff --git a/packages/core/src/Chat/ChatSendButton.tsx b/packages/core/src/Chat/ChatSendButton.tsx
index b72e5c29a7..ea5854b7f2 100644
--- a/packages/core/src/Chat/ChatSendButton.tsx
+++ b/packages/core/src/Chat/ChatSendButton.tsx
@@ -24,6 +24,7 @@ import {useIcon} from '../Icon';
import {useChatComposerContext} from './ChatContext';
import type {BaseProps} from '../BaseProps';
+import {mergeProps} from '../utils';
import {themeProps} from '../utils/themeProps';
import {useTranslator} from '../i18n';
@@ -117,9 +118,7 @@ export function ChatSendButton(props: ChatSendButtonProps): ReactNode {
isDisabled={!isStopShown && isDisabled}
onClick={isStopShown ? onStop : handleSend}
{...rest}
- {...themeProps('chat-send-button')}
- className={className}
- style={style}
+ {...mergeProps(themeProps('chat-send-button'), {className}, style)}
xstyle={[styles.root, xstyle]}
/>
);