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

@yonus_amire01/chat

v1.0.0

Published

Reusable Vue 3 chat dashboard component extracted from the Behayand frontend.

Downloads

334

Readme

@behayand/chat

Reusable Vue 3 chat dashboard component extracted from the Behayand frontend.

The package ships a single composed page component (<ChatPage />) plus the host-adapter wiring needed to drive it.

Install

yarn add @behayand/chat
# peer dependencies
yarn add vue vue-i18n pinia @vueuse/core

Usage (plain Vue + Vite)

// main.ts
import { createApp } from "vue";
import { createPinia } from "pinia";
import { createI18n } from "vue-i18n";
import { BehayandChat, ChatPage } from "@behayand/chat";
import "@behayand/chat/style.css";

import App from "./App.vue";
// Required message keys — see "i18n keys" below.
import faMessages from "./locales/fa.json";

const app = createApp(App);

app.use(createPinia()); // Pinia must be installed BEFORE BehayandChat.
app.use(
  createI18n({
    legacy: false,
    locale: "fa",
    messages: { fa: faMessages },
  }),
);
app.use(BehayandChat /* , { adapter: myAdapter } */);

app.mount("#app");

Then render <ChatPage /> anywhere.

If no adapter is passed, createMockAdapter() is used so you can preview the UI without a backend.

import type { HostAdapter } from "@behayand/chat";

const adapter: HostAdapter = {
  chat: /* ChatAdapter */,
  chatAction: /* ChatActionAdapter */,
  service: /* ServiceAdapter */,
  medication: /* MedicationAdapter */,
};

Usage (Nuxt 3 / 4)

Create app/plugins/behayand-chat.ts:

import { BehayandChat } from "@behayand/chat";
import "@behayand/chat/style.css";

export default defineNuxtPlugin((nuxtApp) => {
  nuxtApp.vueApp.use(BehayandChat /* , { adapter } */);
});

Pinia and i18n come from @pinia/nuxt and @nuxtjs/i18n modules — don't install them manually.

What BehayandChat.install does

  • Creates the chat / chat-action / service / medication / call stores against the supplied (or mock) adapter and provides them on the Vue app.
  • Globally registers every component under components/global/*.vue (BButton, BLabel, BVirtualVerticalList, …) so templates inside <ChatPage /> resolve them.

You don't need to install PrimeVue — the package doesn't import any PrimeVue components.

i18n keys

The chat UI reads keys under chat.*. At minimum:

{
  "chat": {
    "you": "You",
    "noConversationSelected": "Select a conversation",
    "noMessages": "No conversations yet",
    "copiedMessage": "Copied",
    "filters": {
      "online": "Online",
      "ended": "Ended",
      "active": "Active"
    }
  }
}

Translations for additional message types (file/voice/request bubbles, medication picker, etc.) are required if you exercise those flows. The Persian set used in development lives in the host repo.

Styles

import "@behayand/chat/style.css" ships:

  • Tailwind v4 base + utilities (scoped to the package's class usage),
  • Theme tokens (--color-primary-*, --color-surface, gradient utilities, etc.),
  • IranYekan / IranYekanFaNum @font-face declarations (woff files bundled),
  • Bundled flag SVGs (fa/en/ar).

There is no separate theme.css/components.css to import.

Build

yarn build       # vite build
yarn build:strict # vite build + vue-tsc typecheck
yarn dev         # vite build --watch

Outputs land in dist/:

  • dist/index.mjs / dist/index.cjs — ESM and CJS bundles
  • dist/style.css — extracted styles (import once)
  • dist/assets/ — bundled fonts, flag SVGs, lib-images
  • dist/types/ — generated .d.ts tree, entry at dist/types/index.d.ts