205 lines
6.8 KiB
Markdown
205 lines
6.8 KiB
Markdown
# @social.io/catalog
|
|
|
|
A modern, beautifully designed UI component library for building conversational interfaces and support chat experiences. Built with Lit Element and TypeScript.
|
|
|
|
## Issue Reporting and Security
|
|
|
|
For reporting bugs, issues, or security vulnerabilities, please visit [community.foss.global/](https://community.foss.global/). This is the central community hub for all issue reporting. Developers who sign and comply with our contribution agreement and go through identification can also get a [code.foss.global/](https://code.foss.global/) account to submit Pull Requests directly.
|
|
|
|
## 🎯 Features
|
|
|
|
- **Complete Chat UI** - Ready-to-use conversation components with message threads, typing indicators, and attachments
|
|
- **Floating Action Button** - Eye-catching FAB with smooth animations for triggering the chat interface
|
|
- **PDF Viewer** - Built-in PDF rendering with zoom, pagination, and download capabilities
|
|
- **Image Lightbox** - Full-featured lightbox with zoom, pan, and keyboard navigation
|
|
- **Modern Design Tokens** - Consistent styling with customizable colors, spacing, typography, and shadows
|
|
- **Dark Mode Ready** - Full light/dark theme support out of the box
|
|
- **Accessibility** - Keyboard navigation and proper ARIA attributes
|
|
- **TypeScript First** - Full type definitions for all components
|
|
|
|
## 📦 Installation
|
|
|
|
```bash
|
|
npm install @social.io/catalog
|
|
# or
|
|
pnpm add @social.io/catalog
|
|
```
|
|
|
|
## 🚀 Quick Start
|
|
|
|
```typescript
|
|
import { SioFab, SioCombox } from '@social.io/catalog';
|
|
|
|
// Components auto-register as custom elements
|
|
// Just use them in your HTML:
|
|
```
|
|
|
|
```html
|
|
<!-- Floating Action Button that opens the chat -->
|
|
<sio-fab></sio-fab>
|
|
|
|
<!-- Or use the full chat box directly -->
|
|
<sio-combox></sio-combox>
|
|
```
|
|
|
|
## 🧩 Components
|
|
|
|
### Core Components
|
|
|
|
| Component | Description |
|
|
|-----------|-------------|
|
|
| `<sio-fab>` | Floating action button with animated chat icon |
|
|
| `<sio-combox>` | Complete chat interface with conversation list and message view |
|
|
| `<sio-button>` | Styled button with variants (primary, secondary, destructive, outline, ghost) |
|
|
| `<sio-icon>` | Lucide icon wrapper with size and color customization |
|
|
| `<sio-dropdown-menu>` | Animated dropdown menu with keyboard support |
|
|
|
|
### Conversation Components
|
|
|
|
| Component | Description |
|
|
|-----------|-------------|
|
|
| `<sio-conversation-selector>` | Searchable list of conversations with unread indicators |
|
|
| `<sio-conversation-view>` | Message thread with typing indicators and file attachments |
|
|
| `<sio-message-input>` | Auto-expanding textarea with file upload |
|
|
|
|
### Media Components
|
|
|
|
| Component | Description |
|
|
|-----------|-------------|
|
|
| `<sio-image-lightbox>` | Fullscreen image viewer with zoom and pan |
|
|
| `<sio-pdf-viewer>` | PDF renderer with page navigation and zoom controls |
|
|
|
|
### Utility Components
|
|
|
|
| Component | Description |
|
|
|-----------|-------------|
|
|
| `<sio-recorder>` | Session recording using rrweb |
|
|
|
|
## 💅 Styling & Theming
|
|
|
|
The library uses CSS custom properties for theming. The design system includes:
|
|
|
|
- **Colors** - Primary, secondary, accent, destructive, muted, and semantic colors
|
|
- **Typography** - System font stack with size and weight variants
|
|
- **Spacing** - Consistent spacing scale (0.5rem increments)
|
|
- **Radius** - Border radius tokens from sm to full
|
|
- **Shadows** - Elevation system from sm to 2xl
|
|
- **Transitions** - Smooth animation presets
|
|
|
|
### Dark Mode
|
|
|
|
Dark mode is automatically supported. The components use `bdTheme()` helper that switches between light and dark values:
|
|
|
|
```typescript
|
|
import { bdTheme } from '@social.io/catalog';
|
|
|
|
// Usage in styles
|
|
css`
|
|
background: ${bdTheme('hsl(0 0% 100%)', 'hsl(0 0% 10%)')};
|
|
`
|
|
```
|
|
|
|
## 📖 Usage Examples
|
|
|
|
### Basic Chat FAB
|
|
|
|
```html
|
|
<sio-fab></sio-fab>
|
|
```
|
|
|
|
The FAB opens a complete chat interface when clicked. It includes:
|
|
- Keyboard shortcut (Ctrl+S) to toggle
|
|
- Smooth scale and pulse animations
|
|
- Gradient background with glow effects
|
|
|
|
### Custom Button Variants
|
|
|
|
```html
|
|
<sio-button type="primary">Submit</sio-button>
|
|
<sio-button type="destructive">Delete</sio-button>
|
|
<sio-button type="outline">Cancel</sio-button>
|
|
<sio-button type="ghost" size="sm">
|
|
<sio-icon icon="settings"></sio-icon>
|
|
</sio-button>
|
|
```
|
|
|
|
### Image Lightbox
|
|
|
|
```typescript
|
|
const lightbox = document.querySelector('sio-image-lightbox');
|
|
lightbox.open({
|
|
url: 'https://example.com/photo.jpg',
|
|
name: 'My Photo',
|
|
size: 1024000
|
|
});
|
|
```
|
|
|
|
### PDF Viewer
|
|
|
|
```html
|
|
<sio-pdf-viewer
|
|
url="https://example.com/document.pdf"
|
|
fileName="document.pdf"
|
|
></sio-pdf-viewer>
|
|
```
|
|
|
|
### Dropdown Menu
|
|
|
|
```html
|
|
<sio-dropdown-menu
|
|
.items=${[
|
|
{ id: 'edit', label: 'Edit', icon: 'pencil' },
|
|
{ id: 'delete', label: 'Delete', icon: 'trash', destructive: true }
|
|
]}
|
|
@item-selected=${(e) => console.log('Selected:', e.detail.item)}
|
|
>
|
|
<sio-button type="ghost">
|
|
<sio-icon icon="more-vertical"></sio-icon>
|
|
</sio-button>
|
|
</sio-dropdown-menu>
|
|
```
|
|
|
|
## 🔧 Development
|
|
|
|
```bash
|
|
# Install dependencies
|
|
pnpm install
|
|
|
|
# Start development server with hot reload
|
|
pnpm watch
|
|
|
|
# Run tests
|
|
pnpm test
|
|
|
|
# Build for production
|
|
pnpm build
|
|
```
|
|
|
|
## 📚 Dependencies
|
|
|
|
- **@design.estate/dees-element** - Lit Element base with utilities
|
|
- **@design.estate/dees-domtools** - DOM manipulation helpers
|
|
- **lucide** - Beautiful open-source icons
|
|
- **rrweb** - Session recording/replay (for recorder component)
|
|
|
|
## License and Legal Information
|
|
|
|
This repository contains open-source code licensed under the MIT License. A copy of the license can be found in the [LICENSE](./LICENSE) file.
|
|
|
|
**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.
|
|
|
|
### Trademarks
|
|
|
|
This project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH or third parties, and are not included within the scope of the MIT license granted herein.
|
|
|
|
Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines or the guidelines of the respective third-party owners, and any usage must be approved in writing. Third-party trademarks used herein are the property of their respective owners and used only in a descriptive manner, e.g. for an implementation of an API or similar.
|
|
|
|
### Company Information
|
|
|
|
Task Venture Capital GmbH
|
|
Registered at District Court Bremen HRB 35230 HB, Germany
|
|
|
|
For any legal inquiries or further information, please contact us via email at hello@task.vc.
|
|
|
|
By using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.
|