@agentman/chat-widget
Version:
Agentman Chat Widget for easy integration with web applications
2 lines (1 loc) • 12.1 kB
TypeScript
export declare const baseStyles = "\n :root{\n --am-bg-item-hover:#eef3ff;\n --am-bg-item-active:#dbeafe;\n --am-text-muted:#6b7280;\n --am-bg-badge:#ef4444;\n }\n\n .am-chat-widget {\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;\n z-index: 999999;\n height: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .am-chat-container {\n background: var(--chat-background-color, #FFFFFF);\n flex-direction: column;\n overflow: hidden;\n display: flex;\n width: 480px;\n height: 600px;\n border-radius: 8px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n flex: 1;\n z-index: 999999;\n position: relative;\n }\n\n .am-chat-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n padding: 12px 16px;\n border-bottom: 1px solid rgba(0, 0, 0, 0.1);\n height: 54px;\n background: white !important;\n color: #111827 !important;\n box-sizing: border-box;\n }\n\n .am-chat-header-content {\n display: flex;\n align-items: center;\n justify-content: space-between;\n width: 100%;\n gap: 8px;\n }\n\n .am-chat-logo-title {\n display: flex;\n align-items: center;\n gap: 4px;\n font-size: 16px;\n font-weight: normal;\n color: #111827;\n flex-shrink: 1;\n min-width: 0;\n }\n \n .am-chat-logo-title span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n }\n\n /* Hamburger menu button */\n .am-hamburger {\n background: none;\n border: none;\n cursor: pointer;\n padding: 4px;\n display: flex;\n align-items: center;\n justify-content: center;\n color: inherit;\n margin-right: 4px;\n }\n\n .am-chat-logo {\n width: 28px;\n height: 28px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .am-chat-logo svg {\n width: 100%;\n height: 100%;\n }\n\n .am-chat-header-logo {\n width: 32px;\n height: 32px;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .am-chat-header-logo svg {\n width: 100%;\n height: 100%;\n }\n\n .am-chat-header h3 {\n margin: 0;\n font-size: 16px;\n font-weight: 500;\n color: inherit !important;\n }\n\n .am-chat-header button {\n background: none;\n padding: 4px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 0px !important;\n }\n\n .am-chat-header button svg {\n width: 18px;\n height: 18px;\n fill: var(--chat-header-text-color, #FFFFFF);\n }\n\n .am-chat-header button:hover {\n opacity: 0.8;\n }\n\n .am-chat-header-actions {\n display: flex;\n align-items: center;\n gap: 8px !important;\n flex-shrink: 0;\n }\n\n .am-chat-header-button {\n background: none;\n border: none;\n padding: 6px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: background-color 0.2s;\n border-radius: 4px;\n color: #6b7280 !important;\n }\n\n .am-chat-header-button:hover {\n background: rgba(0, 0, 0, 0.05) !important;\n color: #374151 !important;\n }\n\n .am-chat-header-button svg {\n width: 18px;\n height: 18px;\n display: block;\n margin: auto;\n }\n\n /* For stroke-based icons (new collection) */\n .am-chat-header-button svg[stroke],\n .am-chat-header-button svg[stroke-width] {\n stroke: #6b7280 !important;\n fill: none !important;\n }\n\n .am-chat-header-button:hover svg[stroke],\n .am-chat-header-button:hover svg[stroke-width] {\n stroke: #374151 !important;\n fill: none !important;\n }\n\n /* For fill-based icons (old collection) */\n .am-chat-header-button svg[fill]:not([fill=\"none\"]) {\n fill: #6b7280 !important;\n }\n\n .am-chat-header-button:hover svg[fill]:not([fill=\"none\"]) {\n fill: #374151 !important;\n }\n\n /* Header button labels */\n .am-button-label {\n margin-left: 4px;\n font-size: 14px;\n font-weight: normal;\n }\n\n .am-header-button-with-text {\n gap: 4px;\n }\n\n\n .am-chat-messages {\n flex: 1 1 auto;\n overflow-y: auto;\n overflow-x: hidden;\n padding: 1rem;\n display: flex;\n flex-direction: column;\n gap: 1rem;\n min-height: 0;\n height: 0;\n background-color: var(--chat-background-color, #ffffff);\n color: var(--chat-text-color, #111827);\n }\n\n /* Style scrollbar to be always visible when content is scrollable */\n .am-chat-messages::-webkit-scrollbar {\n width: 6px;\n }\n\n .am-chat-messages::-webkit-scrollbar-track {\n background: rgba(0, 0, 0, 0.05);\n border-radius: 3px;\n }\n\n .am-chat-messages::-webkit-scrollbar-thumb {\n background: rgba(0, 0, 0, 0.2);\n border-radius: 3px;\n }\n\n .am-chat-messages::-webkit-scrollbar-thumb:hover {\n background: rgba(0, 0, 0, 0.3);\n }\n\n /* Firefox scrollbar styling */\n .am-chat-messages {\n scrollbar-width: thin;\n scrollbar-color: rgba(0, 0, 0, 0.2) rgba(0, 0, 0, 0.05);\n }\n\n .am-conversation-view {\n display: flex;\n flex-direction: column;\n height: 100%;\n overflow: hidden;\n position: relative;\n }\n\n /* Stage-2 conversation drawer */\n .am-drawer {\n position: absolute;\n left: 0;\n top: 0;\n height: 100%;\n width: 240px;\n transform: translateX(-100%);\n transition: transform .2s ease-out;\n background: #f5f5f5;\n box-shadow: 2px 0 6px rgba(0,0,0,.08);\n display: flex;\n flex-direction: column;\n z-index: 3;\n }\n .am-drawer.open {\n transform: translateX(0);\n }\n\n .am-drawer header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n font-weight: 600;\n padding: .6rem 1rem;\n border-bottom: 1px solid #e5e7eb;\n }\n .am-drawer header button.am-new {\n font-size: 1.1rem;\n line-height: 1;\n border: none;\n background: var(--chat-header-background-color, #2563eb);\n color: var(--chat-header-text-color, #FFFFFF);\n cursor: pointer;\n border-radius: 4px;\n padding: 4px 8px;\n font-weight: bold;\n }\n \n .am-drawer button.am-close {\n width: 100%;\n padding: 8px;\n margin-top: auto;\n border: none;\n background: #f0f0f0;\n cursor: pointer;\n border-top: 1px solid #e5e7eb;\n font-size: 0.9rem;\n text-align: center;\n }\n\n .am-drawer ul {\n list-style: none;\n margin: 0;\n padding: .4rem 0;\n flex: 1;\n overflow-y: auto;\n }\n \n /* drawer list styling */\n .am-drawer li {\n display: flex;\n align-items: center;\n gap: .5rem;\n position: relative;\n padding: .45rem 1rem;\n cursor: pointer;\n }\n \n .am-drawer li:hover {\n background: var(--am-bg-item-hover);\n }\n \n .am-drawer li.active {\n background: var(--am-bg-item-active);\n }\n \n .am-drawer li .title {\n flex: 1;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n \n .am-drawer li .time {\n font-size: .72rem;\n color: var(--am-text-muted);\n }\n \n .am-drawer li .badge {\n background: var(--am-bg-badge);\n color: #fff;\n border-radius: 9999px;\n font-size: .65rem;\n padding: 0 .4em;\n min-width: 1.2em;\n text-align: center;\n }\n\n /* swipe hint overlay (mobile) */\n @media(max-width:479px){\n .am-drawer{\n touch-action:pan-y;\n }\n }\n \n .am-drawer .am-close {\n border: none;\n background: none;\n padding: .6rem 1rem;\n text-align: left;\n cursor: pointer;\n border-top: 1px solid #e5e7eb;\n }\n\n .am-chat-avatar {\n width: 32px;\n height: 32px;\n border-radius: 50%;\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n }\n\n .am-chat-avatar.agent {\n background: var(--chat-header-background-color, #BE185D);\n }\n\n .am-chat-avatar.user {\n background: var(--chat-user-background-color, #F43F5E);\n }\n\n .am-chat-avatar img, .am-chat-avatar svg {\n width: 20px;\n height: 20px;\n }\n\n .am-chat-avatar.agent svg {\n fill: var(--chat-agent-icon-color, #FFFFFF);\n }\n\n .am-chat-avatar.user svg {\n fill: var(--chat-user-icon-color, #FFFFFF);\n }\n\n .am-chat-branding {\n text-align: left;\n font-size: 10px;\n padding: 4px 16px;\n color: #334155;\n background: white;\n }\n\n .am-chat-branding a {\n color: #2563eb;\n text-decoration: none;\n font-weight: 500;\n }\n\n .am-chat-branding a:hover {\n text-decoration: underline;\n }\n\n .am-chat-input-wrapper {\n background: white;\n width: 100%;\n display: flex;\n flex-direction: column;\n }\n\n .am-chat-input-container {\n display: flex;\n align-items: center;\n padding: 8px 16px;\n gap: 8px;\n }\n\n .am-chat-input {\n flex: 1;\n min-height: 44px;\n max-height: 120px;\n padding: 10px 12px 6px 12px;\n border: 1px solid rgba(0, 0, 0, 0.1);\n border-radius: 8px;\n font-size: 14px;\n line-height: 20px;\n resize: none;\n overflow-y: auto;\n background: white;\n box-sizing: border-box;\n }\n\n .am-chat-send {\n margin-left: 8px;\n width: 32px;\n height: 32px;\n padding: 6px;\n background: var(--chat-button-color, #2563eb);\n color: var(--chat-button-text-color, #ffffff);\n border: none;\n border-radius: 4px;\n cursor: pointer;\n display: flex;\n align-items: center;\n justify-content: center;\n transition: filter 0.2s;\n }\n\n .am-chat-send:not(:disabled):hover {\n background-color: var(--chat-button-color, #2563eb);\n filter: brightness(1.1);\n }\n\n .am-chat-send:disabled {\n cursor: not-allowed;\n opacity: 0.8;\n }\n\n .am-chat-send:disabled:hover {\n background: var(--chat-button-color, #2563eb);\n filter: none;\n opacity: 0.8;\n }\n\n .am-chat-send svg {\n width: 20px;\n height: 20px;\n }\n\n .am-chat-send:disabled svg {\n opacity: 0.8;\n }\n\n .am-chat-initializing {\n padding: 16px;\n text-align: center;\n color: #6B7280;\n }\n\n .desktop-only {\n display: none;\n }\n\n @media (min-width: 768px) {\n .desktop-only {\n display: flex;\n }\n }\n\n .am-chat-toggle {\n position: fixed;\n bottom: 20px;\n right: 20px;\n border: none;\n border-radius: 100px;\n padding: 0;\n cursor: pointer;\n transition: transform 0.2s;\n z-index: 1000;\n }\n\n .am-chat-toggle:hover {\n transform: scale(1.05);\n }\n\n .am-chat-toggle-content {\n display: flex;\n align-items: center;\n gap: 8px;\n background: var(--chat-toggle-background-color, #2563eb);\n color: var(--chat-toggle-text-color, #FFFFFF);\n padding: 8px 16px 8px 8px;\n border-radius: 100px;\n box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);\n }\n\n .am-chat-toggle-text {\n font-size: 16px;\n font-weight: 500;\n }\n\n .am-chat-toggle .am-chat-logo {\n color: var(--chat-toggle-icon-color, #FFFFFF);\n }\n\n .am-chat-expanded {\n position: fixed !important;\n top: 12px !important;\n right: 0 !important;\n bottom: 12px !important;\n width: 100vw !important;\n margin: 0 !important;\n border-radius: 0 !important;\n transition: all 0.3s ease-in-out !important;\n display: flex !important;\n justify-content: center !important;\n }\n\n .am-chat-expanded .am-chat-container {\n width: 66.67vw !important;\n max-width: 600px !important;\n height: calc(95vh - 24px) !important;\n border-radius: 8px !important;\n transition: all 0.3s ease-in-out !important;\n }\n\n .am-chat-expanded .am-chat-messages {\n height: calc(95vh - 148px) !important; /* 24px margins + 124px for header and input */\n }\n\n .am-chat-minimize {\n border: none;\n background: none;\n cursor: pointer;\n }\n\n /* Override any external styles that might affect the header text */\n .am-chat-header * {\n color: inherit !important;\n }\n";