A floating chat widget UI (WhatsApp-style bubbles, typing indicator, composer with multi-line textarea, optional branding banner).
pnpm installpnpm devpnpm build- Multi-line composer:
Entersends,Shift+Enterinserts a newline - Message grouping
- Typing indicator
src/App.tsx: thin wrapper that exports the widgetsrc/chat/ChatWidget.tsx: widget shell, open/close, header, layoutsrc/chat/ChatBody.tsx: bubble rendering, grouping logic, avatar/timestamp rowsrc/chat/ChatComposer.tsx: textarea + attach + send + branding bannersrc/chat/TypingIndicator.tsx: typing dots componentsrc/chat/sampleMessages.ts: long demo dataset for UI testing
- Tailwind utilities are applied directly in TSX.
src/chat/styles/custom.csscontains only the pieces Tailwind can’t express cleanly:- bubble tail
maskshapes - calc-based radii / “tail reserve” border
- typing keyframes
- chat font variable hook (
--chat-font)
- bubble tail
src/helpers/index.ts:getInitials(name, role)for avatar initialsgetMessageMeta(messages)returns grouping metadata (side,isLastOfGroup,initials)
- Font:
src/index.css→--chat-font - Branding banner:
src/chat/ChatWidget.tsxpassesshowBranding,brandingHref,brandingLabelintoChatComposer
- The widget uses CSS custom properties (see
src/index.css) to control sizing/positioning. - Inter is loaded via
index.htmlfor a modern, professional UI font.