npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@caplipun/ai-chat-widget

v0.0.3

Published

A floating AI chat bubble widget with a terminal-inspired theme for Angular applications

Readme

@caplipun/ai-chat-widget

A floating AI chat bubble widget for Angular applications with a minimal, terminal-inspired dark theme.

Angular TypeScript License

Features

  • 🔮 Floating chat bubble fixed to bottom-right corner
  • 💬 Chat window panel with header, messages, input, and send button
  • 📝 Markdown rendering for AI responses (via ngx-markdown)
  • 🎨 Code syntax highlighting (via Prism.js)
  • Streaming support — real-time typewriter effect for AI responses
  • 📱 Fully responsive — desktop panel + mobile bottom sheet
  • 🎭 Smooth animations — open/close panel, message appearance
  • 💡 Suggested starter questions — configurable starter prompts
  • 🖥️ Terminal-inspired theme — black background, monospace font, minimal design
  • 🔍 Expand/collapse — resize the chat panel on desktop
  • Accessible — ARIA labels, keyboard navigation, focus management

Installation

npm install @caplipun/ai-chat-widget ngx-markdown marked prismjs

Peer Dependencies

| Package | Version | |---------|---------| | @angular/core | ^19.0.0 | | @angular/common | ^19.0.0 | | @angular/animations | ^19.0.0 | | @angular/forms | ^19.0.0 | | rxjs | ^7.0.0 | | ngx-markdown | ^19.0.0 | | marked | ^15.0.0 | | prismjs | ^1.29.0 |

Setup

1. Configure App Providers

In your app.config.ts:

import { provideAnimations } from '@angular/platform-browser/animations';
import { provideMarkdown } from 'ngx-markdown';

export const appConfig: ApplicationConfig = {
  providers: [
    // ... your other providers
    provideAnimations(),
    provideMarkdown(),
  ],
};

2. Add Prism.js Theme

Add the Prism.js theme CSS to your angular.json styles array:

{
  "styles": [
    "node_modules/prismjs/themes/prism-okaidia.css",
    "src/styles.css"
  ]
}

3. Load Monospace Font (Recommended)

Add JetBrains Mono to your index.html:

<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;600;700&display=swap" rel="stylesheet">

Usage

import { Component } from '@angular/core';
import { ChatWidgetComponent } from '@caplipun/ai-chat-widget';

@Component({
  selector: 'app-root',
  standalone: true,
  imports: [ChatWidgetComponent],
  template: `
    <ai-chat-widget
      apiUrl="https://api.example.com/chat"
      title="Ask Lipun AI"
      placeholder="Ask about my experience..."
      welcomeMessage="Hello! Ask me anything about Lipun."
      [suggestedQuestions]="['What technologies do you use?', 'Tell me about your experience']"
    />
  `,
})
export class AppComponent {}

Configuration Inputs

| Input | Type | Default | Description | |-------|------|---------|-------------| | apiUrl | string | required | Backend API endpoint URL | | title | string | 'AI Assistant' | Chat window header title | | placeholder | string | 'Ask a question...' | Input field placeholder text | | welcomeMessage | string | 'Hello! How can I help you?' | Initial welcome message | | suggestedQuestions | string[] | [] | Starter question chips shown before first message |

API Contract

The widget sends POST requests to the configured apiUrl.

Request

POST /chat
Content-Type: application/json

{
  "question": "What technologies does Lipun use?"
}

Standard Response (JSON)

Content-Type: application/json

{
  "answer": "Lipun works with .NET, Angular, SQL Server, and Python..."
}

Streaming Response (SSE)

The widget also supports Server-Sent Events for real-time streaming:

Content-Type: text/event-stream

data: {"answer": "Lipun "}
data: {"answer": "works "}
data: {"answer": "with "}
data: [DONE]

Each data: line contains a JSON object with an answer field containing the next text chunk. The stream ends with data: [DONE].

Design Theme

| Element | Value | |---------|-------| | Background | #000000 | | Primary text | #ffffff | | Secondary text | #aaaaaa | | Borders | #2a2a2a | | Font | JetBrains Mono / Fira Code / IBM Plex Mono |

Responsive Behavior

| Viewport | Behavior | |----------|----------| | Desktop (≥ 640px) | 380×540px panel (expand button toggles to 520×680px) | | Mobile (< 640px) | Full-width bottom sheet (85vh height) with backdrop |

Building from Source

# Clone and install
git clone <repository-url>
cd ai-chat-workspace
npm install

# Build the library
ng build ai-chat-widget

# Run the demo app
ng serve demo

# Start mock API server (in another terminal)
node mock-server.js           # Standard JSON responses
node mock-server.js --stream  # Streaming SSE responses

Publishing to NPM

# Build production library
ng build ai-chat-widget

# Navigate to dist
cd dist/ai-chat-widget

# Login to NPM (if not already)
npm login

# Publish (--access public required for scoped packages)
npm publish --access public

License

MIT