# @social.io/catalog

Documentation for @social.io/catalog

# readme.md for @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.

# changelog.md for @social.io/catalog

## 2026-01-02 - 1.7.0 - feat(recorder)
lazy-load rrweb and rrweb-player from CDN via SioServiceLibLoader and switch sio-recorder to use the loader

- Add SioServiceLibLoader service to lazy-load rrweb and rrweb-player (and inject rrweb-player CSS)
- Add versions file (CDN_VERSIONS and CDN_BASE) and export loader from ts_web/index.ts
- Update sio-recorder to use the loader for recording and playback instead of bundling rrweb/rrweb-player
- Remove rrweb, rrweb-player and rrweb-snapshot from dependencies and bump lucide and @design.estate/dees-wcctools versions
- Small package.json changes: remove --skiplibcheck from build script and bump @git.zone/tstest devDependency

## 2025-12-18 - 1.6.1 - fix(sio-combox)
tweak dropdown shadow and bind close event on conversation selector

- Replaced unsafeCSS(shadows.xl) with explicit box-shadow values for the combox dropdown to adjust visual appearance
- Added @close listener on <sio-conversation-selector> to call this.close(), enabling the selector to close the combox when it emits a close event
- Affected file: ts_web/elements/sio-combox.ts

## 2025-12-18 - 1.6.0 - feat(conversation-selector)
add conversation status badges to conversation selector and include status in sample data

- Introduce TConversationStatus type and add optional status property to IConversation
- Render status badges in sio-conversation-selector with CSS classes and a getBadgeLabel helper
- Update sample conversations in sio-combox.ts to include statuses: 'new', 'needs-action', 'waiting', 'resolved'

## 2025-12-17 - 1.5.0 - feat(combox)
Introduce singleton SioCombox attached to document.body with open/close/toggle API and animated show/hide; integrate SioFab to use the singleton and update styles/positioning

- Add SioCombox.createOnBody() and SioCombox.getInstance() singletons
- Add isOpen state, open(), close(), toggle(), getIsOpen() and emit opened/closed/close events
- Move combox out of the FAB shadow DOM — attach to body and position fixed bottom-right with z-index and enter/exit transitions
- Update mobile layout to full-screen sizing and adjust transform origin for phablet
- Update SioFab to create the singleton on firstUpdated(), listen for close events, and toggle the singleton instead of rendering it inside the FAB
- Remove previous in-FAB combox container markup/CSS and hasShownOnce logic
- Minor visual/UX improvements: scale/opacity transitions, pointer-events control, and positioning variables for consistent behavior

## 2025-12-17 - 1.4.1 - fix(ui)
handle on-screen keyboard visibility to adjust layout and prevent inputs from being obscured

- Add keyboard visibility state (isKeyboardVisible) and keyboardBlurTimeout in sio-combox.ts
- Listen for custom 'input-focus' and 'input-blur' events and toggle keyboard-visible host attribute
- Dispatch 'input-focus'/'input-blur' from sio-conversation-selector and sio-message-input on focus/blur
- Add connected/disconnected lifecycle handlers and updated() hook to manage attribute and cleanup timeouts
- Apply :host([keyboard-visible]) CSS to set height to 100vh / 100dvh when keyboard is visible

## 2025-12-17 - 1.4.0 - feat(elements)
update design tokens and sio-fab component; bump deps and update npmextra config

- Refactor color tokens to a neutral HSL palette (ts_web/elements/00colors.ts) and adjust focus ring token (ts_web/elements/00tokens.ts).
- Refactor sio-fab: move styles to static property, add responsive FAB sizing and getMobileIconSize(), bind icon sizes, manage host class ('combox-open'), and tidy lifecycle methods for better behavior and mobile support.
- Bump dependencies and devDependencies: @design.estate/dees-wcctools -> ^2.0.1, lucide -> ^0.561.0; @git.zone/tsbuild -> ^4.0.2, @git.zone/tsrun -> ^2.0.1, @git.zone/tswatch -> ^2.3.13, @types/node -> ^25.0.3, etc.
- Update npmextra.json: rename configuration keys (gitzone -> @git.zone/cli, npmci -> @ship.zone/szci) and add release.registries and accessLevel for publishing. 

## 2025-12-08 - 1.3.0 - feat(components)
Add reusable message input component, refactor element properties to use accessor, update styles and docs, bump dependencies

- Add new <sio-message-input> component (auto-resizing textarea, file picker, send/files events) and integrate it into sio-conversation-view
- Refactor multiple element class fields to use the 'accessor' property pattern (sio-button, sio-combox, sio-conversation-view, sio-dropdown-menu, sio-fab, sio-icon, sio-image-lightbox, sio-pdf-viewer, sio-recorder, etc.)
- Significant visual and UX updates to sio-button (new secondary variant, sizing, spacing, icon sizing, focus/disabled behavior)
- Move inline conversation input logic into the new component and simplify message handling (dispatch send-message event with text and attachments)
- Improve PDF viewer: safer async pdf.js loader, resize observer for responsive rendering, better error fallback and lifecycle cleanup
- Enhance image lightbox (PDF handling via sio-pdf-viewer, zoom/drag controls, keyboard shortcuts, download/open actions)
- Add icon caching and make lucide upgrade (cache limit, PascalCase lookup) to reduce re-renders
- Polish tokens/styles: spacing, radii, shadows, transitions and small responsive/layout tweaks (e.g. main page padding)
- Update README to reflect the public package name, components, quick start and development instructions
- Bump runtime and dev dependencies (dees-element/domtools/wcctools, lucide, git.zone tools, push.rocks smartenv/types) and adjust tsconfig (target/module settings simplified)

## 2025-04-20 - 1.2.4 - fix(build)
Update build script and async function signature

- Added '--skiplibcheck' flag to the tsbuild command in package.json
- Changed startRecording return type to Promise<void> in ts_web/elements/sio-recorder.ts for proper async handling

## 2025-04-20 - 1.2.3 - fix(core)
Update dependency versions and adjust UI CSS for fab and combox elements

- Bumped @design.estate/dees-catalog, dees-domtools, dees-element, and @social.io/interfaces to newer versions in package.json
- Updated devDependencies to latest compatible versions
- Adjusted CSS positioning in sio-fab and sio-combox for improved layout

## 2025-01-26 - 1.2.2 - fix(sio-recorder)
Fixed the recording loop and ensured it stops correctly

- Added an await for domtoolsPromise in startRecording method.
- Introduced a while loop to manage the recording status effectively.
- Added delay and stop function call within the loop to manage record sessions.

## 2025-01-25 - 1.2.1 - fix(sio-recorder)
Enhance styling and positioning for rrweb player elements in SioRecorder component.

- Fixed positioning and added styling for the replayer mouse and iframe in the SioRecorder component.
- Ensured compatibility with cross-origin iframes.

## 2025-01-25 - 1.2.0 - feat(elements)
Added sio-recorder element for recording and replaying sessions

- Introduced a new 'sio-recorder' custom element that allows for recording and replaying DOM events.
- Integrated rrweb and rrweb-player dependencies for session recording and playback.
- Updated import/export in ts_web/elements/index.ts to include sio-recorder.
- Fixed assetbroker URL in the html index.html file.

## 2024-12-27 - 1.1.0 - feat(ci)
Add Gitea workflows for CI/CD process.

- Added YAML files for CI/CD workflows in Gitea
- Setup jobs for security checks, testing, and releasing
- Improved CI/CD integration by ignoring certain tag pushes
- Updated .gitignore and other configuration files for compatibility

## 2024-12-27 - 1.0.93 - fix(core)
Fix package naming inconsistencies in the project

- Updated package name from '@social.io_private/catalog' to '@social.io/catalog' in package.json
- Updated dependency from '@social.io_private/interfaces' to '@social.io/interfaces' in package.json
- Updated import statement from '@social.io_private/interfaces' to '@social.io/interfaces' in sio-subwidget-conversations.ts

## 2024-10-09 - 1.0.92 - fix(build)
Correct build command and module type configuration in package.json and tsconfig.json.

- Corrected the build command in package.json to use 'tsfolders'.
- Updated 'module' and 'moduleResolution' types in tsconfig.json to 'NodeNext'.

## 2024-10-09 - 1.0.91 - fix(elements)
Style and dependency adjustments in elements

- Updated styles for better UI consistency and appearance in elements: sio-combox, sio-fab, sio-subwidget-onboardme, sio-subwidget-conversations.
- Dependency versions updated in package.json.
- Removed .gitlab-ci.yml file.

## 2023-08-27 - 1.0.89 to 1.0.90 - core updates
Incremental updates with core fixes.

- Version 1.0.89: fix(core): update
- Version 1.0.90: No significant changes

## 2023-01-07 to 2023-01-11 - 1.0.84 to 1.0.89 - core updates
Continuous core fixes and updates over releases.

- Version 1.0.84: fix(core): update
- Version 1.0.85: fix(core): update
- Version 1.0.86: fix(core): update
- Version 1.0.87: fix(core): update
- Version 1.0.88: fix(core): update
- Version 1.0.89: No significant changes

## 2022-05-09 to 2022-05-24 - 1.0.75 to 1.0.82 - core updates
Progressive upgrades with core fixes.

- Version 1.0.75: fix(core): update
- Version 1.0.76: fix(core): update
- Version 1.0.77: fix(core): update
- Version 1.0.78: fix(core): update
- Version 1.0.79: fix(core): update
- Version 1.0.80: fix(core): update
- Version 1.0.81: fix(core): update
- Version 1.0.82: fix(core): update

## 2022-03-24 to 2022-04-25 - 1.0.72 to 1.0.74 - core updates
Minor updates focusing on core functionalities.

- Version 1.0.72: fix(core): update
- Version 1.0.73: fix(core): update
- Version 1.0.74: fix(core): update

## 2020-08-05 to 2020-12-10 - 1.0.55 to 1.0.71 - core updates
Regular maintenance with core fixes to enhance stability.

- Version 1.0.55 to 1.0.71: Multiple core updates and fixes
- Versions include: 1.0.55, 1.0.56, 1.0.57, 1.0.58, 1.0.59, 1.0.60, 1.0.61, 1.0.62, 1.0.63, 1.0.64, 1.0.65, 1.0.66, 1.0.67, 1.0.68, 1.0.69, 1.0.70, 1.0.71