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

@bbki.ng/ui

v0.1.28

Published

Design system component library for bbki.ng

Downloads

2,788

Readme

@bbki.ng/ui

设计系统组件库 - 基于原子设计方法论和 CSS 变量的主题系统。

架构特点

  • 设计令牌层: W3C DTCG 格式的 JSON 令牌,作为单一真相源
  • CSS 变量主题: 通过 CSS 变量实现动态主题切换,支持 light/dark/system
  • 原子设计分层: Atoms → Layout,强制依赖方向
  • Tree-shaking: 独立模块输出,按需导入

安装

pnpm add @bbki.ng/ui

使用

基础用法

import { ThemeProvider, Button, Container } from '@bbki.ng/ui';
import '@bbki.ng/ui/styles';

function App() {
  return (
    <ThemeProvider defaultTheme="light">
      <Container maxWidth="lg">
        <Button variant="primary" size="lg">
          Get Started
        </Button>
      </Container>
    </ThemeProvider>
  );
}

主题切换

import { useTheme } from '@bbki.ng/ui';

function ThemeToggle() {
  const { theme, setTheme, toggleTheme } = useTheme();

  return <button onClick={toggleTheme}>Current: {theme}</button>;
}

组件

Button

<Button variant="default" size="md">
  Click me
</Button>

Props:

  • variant: 'default' | 'primary' | 'danger' | 'ghost' | 'disabled'
  • size: 'sm' | 'md' | 'lg'
  • transparent: boolean
  • loading: boolean
  • disabled: boolean

注意: 点击时有 280ms 的延迟动画效果,与旧版 Button 行为一致。

Container

<Container maxWidth="lg" padding="md" centered>
  Content
</Container>

Grid

// 标准网格
<Grid cols={3} gap="md">...items...</Grid>

// 三栏布局
<Grid leftAside={...} rightAside={...}>
  Main content
</Grid>

开发

# 开发模式
pnpm dev

# 构建令牌
pnpm build:tokens

# 构建包
pnpm build

# 启动 Storybook
pnpm storybook

# 类型检查
pnpm typecheck

设计令牌

令牌存储在 tokens/ 目录下:

  • tokens/base/: 基础令牌(颜色、间距、字体、阴影)
  • tokens/semantic/: 语义令牌(light/dark 主题映射)

修改令牌后运行 pnpm build:tokens 生成 CSS 变量。

设计原则

  1. Token 优先: 所有数值来自设计令牌,禁止组件内硬编码
  2. CSS 变量主题: 通过 CSS 变量切换主题,而非 Tailwind 的 dark: 前缀
  3. 类型安全: Props 继承原生 HTML 属性
  4. Tree-shaking: 按需导入,不使用的组件不会打包