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

@openjiuwen/relay-web

v0.1.4

Published

OfficeClaw Web 组件库,包含 React 组件、Hooks 和工具函数。

Readme

@openjiuwen/relay-web

OfficeClaw Web 组件库,包含 React 组件、Hooks 和工具函数。

安装

npm install @openjiuwen/relay-web
# 或
pnpm add @openjiuwen/relay-web

Peer Dependencies

需要确保项目中已安装:

  • react >= 18.2.0
  • react-dom >= 18.2.0
  • @office-claw/shared >= 0.1.0

使用方式

按需导入

// 导入基础组件
import { Button, IconButton, Alert } from '@openjiuwen/relay-web/shared';

// 导入业务组件
import { ConfirmDialog, Lightbox } from '@openjiuwen/relay-web/business';

// 导入 hooks
import { useCountdown, useEscapeKey } from '@openjiuwen/relay-web/hooks';

// 导入 utils
import { compressImage, apiFetch } from '@openjiuwen/relay-web/utils';

// 导入 stores(Zustand 状态管理)
import { useChatStore, useToastStore, useThemeStore } from '@openjiuwen/relay-web/stores';

// 导入样式(CSS 变量 + Tailwind)
import '@openjiuwen/relay-web/styles.css';

直接使用(从主入口导入)

import { Button, ConfirmDialog, useCountdown } from '@openjiuwen/relay-web';
import '@openjiuwen/relay-web/styles.css';

定制替换

UI 一致,逻辑不同

使用原始 UI 组件 + 定制 hook:

import { ConfirmDialog } from '@openjiuwen/relay-web/business';
import { myUseConfirm } from './myUseConfirm';

// 用 ConfirmProvider 包装,注入定制逻辑

UI 不同,逻辑一致

使用定制 UI + 原始 hook:

import { useConfirm } from '@openjiuwen/relay-web/hooks';
import { MyConfirmDialog } from './MyConfirmDialog';

const confirm = useConfirm();
<MyConfirmDialog onConfirm={() => confirm(true)} />

全部定制

import { MyConfirmDialog, myUseConfirm } from './my-components';

导出内容

| 子路径 | 内容 | |--------|------| | shared | 19 个基础 UI 组件(Button, IconButton, Alert 等) | | business | 业务组件(ConfirmDialog, Lightbox, AppModal 等) + cli-output、document-preview、workspace、ppt-studio、rich、icons 等子目录组件 | | hooks | 39 个 hooks(通用 hooks + 业务 hooks) | | utils | 20 个工具函数 | | stores | Zustand stores(useChatStore, useToastStore, useThemeStore 等) | | styles.css | CSS 变量 + Tailwind 样式 | | assets | 静态资源(图片、图标) |

静态资源配置

组件中使用的图片/图标资源需要复制到您的项目中:

# 复制静态资源到 public 目录(首次使用时执行)
cp -r node_modules/@openjiuwen/relay-web/dist/assets/* public/

# Windows PowerShell
Copy-Item -Recurse -Force node_modules/@openjiuwen/relay-web/dist/assets/* public/

# pnpm 用户(路径可能不同)
cp -r .pnpm/@office-claw+web-components@*/node_modules/@openjiuwen/relay-web/dist/assets/* public/

License

MIT