diff --git a/app/globals.css b/app/globals.css index a58bdeec..1010887e 100644 --- a/app/globals.css +++ b/app/globals.css @@ -4,12 +4,24 @@ @plugin "daisyui"; @plugin "@tailwindcss/typography"; +/* Hide Scrollbar */ +* { + scrollbar-width: none; +} + +::-webkit-scrollbar { + appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + display: none; +} + :root { --background: #ffffff; --foreground: #171717; --message-card-background: #f0f0f0; --icon-color: #555555; - --drawer-color: #f2f2f2; + --drawer-color: #ffffff; } [data-theme="dark"] { @@ -82,10 +94,21 @@ html:has(.drawer-toggle:checked) { .icn { + /* color: var(--icon-color); */ + border-radius: 9999px; + transition: color 200ms ease, background-color 200ms ease; +} + +.icn:hover { + background-color: #e5e7eb; + color: #1f2937; +} + +[data-theme="dark"] .icn:hover { + background-color: color-mix(in srgb, var(--icon-color) 12%, transparent); color: var(--icon-color); - @apply hover:bg-gray-200 hover:text-gray-800 } -[data-theme="dark"] .icn { - @apply hover:bg-gray-800 hover:text-gray-200 +input, select { + outline: none !important; } \ No newline at end of file diff --git a/components/Chatbot/Chatbot.tsx b/components/Chatbot/Chatbot.tsx index 301b4e3c..39088f2b 100644 --- a/components/Chatbot/Chatbot.tsx +++ b/components/Chatbot/Chatbot.tsx @@ -80,7 +80,7 @@ function Chatbot({ chatSessionId, tabSessionId }: ChatbotProps) { const messageRef = useRef(null); const timeoutIdRef = useRef(null); - const { backgroundColor } = useColor(); + const { primaryBgColor } = useColor(); const { isSmallScreen } = useScreenSize(); const dispatch = useAppDispatch(); @@ -145,7 +145,7 @@ function Chatbot({ chatSessionId, tabSessionId }: ChatbotProps) {
{/* Sidebar - visible on large screens */} -
+
{ dispatch(setToggleDrawer(data)) }} isToggledrawer={isToggledrawer} @@ -162,7 +162,7 @@ function Chatbot({ chatSessionId, tabSessionId }: ChatbotProps) {
)} diff --git a/components/Chatbot/hooks/useColor.ts b/components/Chatbot/hooks/useColor.ts index 9b7ad0ce..03472fc3 100644 --- a/components/Chatbot/hooks/useColor.ts +++ b/components/Chatbot/hooks/useColor.ts @@ -1,10 +1,25 @@ -import { isColorLight } from "@/utils/themeUtility"; +import { getGradientBackground, isColorLight, withAlpha } from "@/utils/themeUtility"; import { useTheme } from "@mui/material"; export const useColor = () => { const theme = useTheme(); - const backgroundColor = theme.palette.primary.main; - const textColor = isColorLight(backgroundColor) ? "black" : "white"; - - return { backgroundColor, textColor } + const primaryColor = theme.palette.primary.main; + const mode = theme.palette.mode; + const isLight = isColorLight(primaryColor); + const foregroundColor = mode === "dark" ? "white" : isLight ? "black" : "white"; + + return { + primaryBgColor: primaryColor, + // Kept separate from primaryBgColor so the text color can be customized independently in the future. + primaryTextColor: primaryColor, + foregroundColor: foregroundColor, + primaryGradientBg: getGradientBackground(primaryColor, mode), + primaryTintColor: withAlpha(primaryColor, mode === "dark" ? 0.18 : 0.12), + primaryHoverTintColor: withAlpha(primaryColor, mode === "dark" ? 0.12 : 0.08), + headerHoverBg: mode === "dark" + ? "rgba(255, 255, 255, 0.12)" + : isLight + ? "rgba(0, 0, 0, 0.08)" + : "rgba(255, 255, 255, 0.18)", + } } \ No newline at end of file diff --git a/components/FormComponent.tsx b/components/FormComponent.tsx index 98713c5d..2ce3732d 100644 --- a/components/FormComponent.tsx +++ b/components/FormComponent.tsx @@ -6,7 +6,7 @@ import { setHelloClientInfo, setHelloKeysData } from "@/store/hello/helloSlice"; import { GetSessionStorageData } from "@/utils/ChatbotUtility"; import { useCustomSelector } from "@/utils/deepCheckSelector"; import { splitNumber } from "@/utils/utilities"; -import { BookText, Loader2, Mail, Phone, Send, User } from "lucide-react"; +import { Loader2, Mail, MessageSquare, Phone, Send, User } from "lucide-react"; import React, { useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { useColor } from "./Chatbot/hooks/useColor"; @@ -36,13 +36,17 @@ interface FormErrors { } function FormComponent({ chatSessionId }: FormComponentProps) { - const { textColor, backgroundColor } = useColor(); + const { foregroundColor, primaryTextColor, primaryBgColor } = useColor(); const dispatch = useDispatch(); - const { showWidgetForm, open, userData } = useCustomSelector((state) => ({ - showWidgetForm: state.Hello?.[chatSessionId]?.showWidgetForm ?? true, - open: state.Chat.openHelloForm, - userData: state.Hello?.[chatSessionId]?.clientInfo - })); + const { showWidgetForm, open, userData, isFullScreen } = useCustomSelector((state) => { + const fullScreen = state.Hello?.[chatSessionId]?.helloConfig?.fullScreen; + return { + showWidgetForm: state.Hello?.[chatSessionId]?.showWidgetForm ?? true, + open: state.Chat.openHelloForm, + userData: state.Hello?.[chatSessionId]?.clientInfo, + isFullScreen: (fullScreen === true || fullScreen === 'true') ?? false + }; + }); const scriptParams = JSON.parse(GetSessionStorageData('helloConfig') || '{}') const { isSmallScreen } = useScreenSize(); const [formData, setFormData] = useState({ @@ -137,32 +141,39 @@ function FormComponent({ chatSessionId }: FormComponentProps) { if (!open && !showWidgetForm) return null; if (!open && showWidgetForm) return ( -
setOpen(true)} - style={{ - background: `linear-gradient(to right, ${backgroundColor}, ${backgroundColor}CC)`, - color: textColor - }} - > -
-
- +
+
setOpen(true)} + className="flex items-center gap-3 rounded-xl px-3 py-2.5 cursor-pointer transition-all hover:opacity-95 hover:shadow-md" + style={{ backgroundColor: primaryBgColor, color: foregroundColor }} + > +
+
-
- Enter your details -

Click here to provide your information

+
+
Enter your details
+
Click here to provide your information
); return ( -
-
- {/* Card header */} - < div className="bg-primary text-white p-5 rounded-t-lg" style={{ - background: `linear-gradient(to right, ${backgroundColor}, ${backgroundColor}CC)`, - color: textColor +
setOpen(false)} + > +
e.stopPropagation()} + > + {/* Card header (sticky); drag handle shown only in bottom-sheet mode */} + < div className={`bg-primary text-white px-5 py-4 rounded-t-2xl sticky top-0 z-10`} style={{ + background: `linear-gradient(to right, ${primaryBgColor}, ${primaryBgColor}CC)`, + color: foregroundColor }}>

Enter your details

@@ -171,11 +182,15 @@ function FormComponent({ chatSessionId }: FormComponentProps) {

{/* Form content */} -
+ {/* Name field */}
-