From 09b1892675c07698e3d4fd1c498fe3a355db0bd2 Mon Sep 17 00:00:00 2001 From: KARTIK PANDEY Date: Tue, 10 Mar 2026 13:08:24 -0700 Subject: [PATCH 1/3] feat: add close button to widget and fix Storybook v10 config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add X close button to top-right of HomePage header (non-inline only) - Wire onClose prop through ChatWidget → HomePage - Fix Storybook v10 compatibility: remove deprecated argTypesRegex, update backgrounds.options → backgrounds.values array format Resolves BRA2-1177 Made-with: Cursor --- .storybook/preview.ts | 18 +++++----- src/components/ChatWidget/ChatWidget.tsx | 1 + src/components/HomePage/HomePage.module.css | 40 +++++++++++++++++++++ src/components/HomePage/HomePage.tsx | 38 +++++++++++++++----- 4 files changed, 80 insertions(+), 17 deletions(-) diff --git a/.storybook/preview.ts b/.storybook/preview.ts index d6c54c6..3c87775 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -3,7 +3,6 @@ import '../src/styles/variables.css'; const preview: Preview = { parameters: { - actions: { argTypesRegex: '^on[A-Z].*' }, controls: { matchers: { color: /(background|color)$/i, @@ -11,19 +10,20 @@ const preview: Preview = { }, }, backgrounds: { - options: { - light: { name: 'light', value: '#f5f5f5' }, - dark: { name: 'dark', value: '#1a1a2e' }, - white: { name: 'white', value: '#ffffff' } - } + values: [ + { name: 'light', value: '#f5f5f5' }, + { name: 'dark', value: '#1a1a2e' }, + { name: 'white', value: '#ffffff' }, + ], + default: 'light', }, }, initialGlobals: { backgrounds: { - value: 'light' - } - } + value: '#f5f5f5', + }, + }, }; export default preview; diff --git a/src/components/ChatWidget/ChatWidget.tsx b/src/components/ChatWidget/ChatWidget.tsx index 355526e..5094f8d 100644 --- a/src/components/ChatWidget/ChatWidget.tsx +++ b/src/components/ChatWidget/ChatWidget.tsx @@ -325,6 +325,7 @@ export const ChatWidget: React.FC = ({ onStartChat={handleStartChat} onNavigate={handleNavigate} currentPage="home" + onClose={isInline ? undefined : handleClose} /> ) : ( void; onNavigate: (page: 'home' | 'messages') => void; currentPage: 'home' | 'messages'; + onClose?: () => void; } export const HomePage: React.FC = ({ @@ -24,6 +25,7 @@ export const HomePage: React.FC = ({ onStartChat, onNavigate, currentPage, + onClose, }) => { const handleHomeCardClick = () => { if (homeLink) { @@ -36,15 +38,35 @@ export const HomePage: React.FC = ({
-
- {agentLogoUrl ? ( - {agentName} - ) : ( -
- -
+
+
+ {agentLogoUrl ? ( + {agentName} + ) : ( +
+ +
+ )} + {agentName} +
+ {onClose && ( + )} - {agentName}
From 423a3ab2542e962475b533a423ef92c1ec950f19 Mon Sep 17 00:00:00 2001 From: KARTIK PANDEY Date: Tue, 10 Mar 2026 13:12:00 -0700 Subject: [PATCH 2/3] fix: remove redundant backgrounds.default in favour of initialGlobals Made-with: Cursor --- .storybook/preview.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/.storybook/preview.ts b/.storybook/preview.ts index 3c87775..febe81d 100644 --- a/.storybook/preview.ts +++ b/.storybook/preview.ts @@ -15,7 +15,6 @@ const preview: Preview = { { name: 'dark', value: '#1a1a2e' }, { name: 'white', value: '#ffffff' }, ], - default: 'light', }, }, From 1a7ffb2de0285796944b78793a980c88f46a476d Mon Sep 17 00:00:00 2001 From: KARTIK PANDEY Date: Tue, 10 Mar 2026 13:16:17 -0700 Subject: [PATCH 3/3] fix: use dark overlay for close button hover to work on all header colors Made-with: Cursor --- src/components/HomePage/HomePage.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/HomePage/HomePage.module.css b/src/components/HomePage/HomePage.module.css index dc00410..b1a00f5 100644 --- a/src/components/HomePage/HomePage.module.css +++ b/src/components/HomePage/HomePage.module.css @@ -70,7 +70,7 @@ } .closeButton:hover { - background: rgba(255, 255, 255, 0.2); + background: rgba(0, 0, 0, 0.2); transform: scale(1.05); }