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

@hitszosa/ui

v0.1.5

Published

Astro-first shared UI assets, theme tokens, and components for HITSZ OSA sites.

Readme

@hitszosa/ui

面向 Astro 的 HITSZ OSA 共享 UI 包,提供 OSA logo 资产、Tailwind 主题 token、共享主题样式、客户端主题逻辑,以及可复用的 Astro 组件。

安装

bun add @hitszosa/ui

当前已发布至 npm

Astro 接入

在全局样式中引入共享 CSS:

@import 'tailwindcss';
@config '@hitszosa/ui/tailwind/preset';
@source '../../node_modules/@hitszosa/ui/dist/components';
@import '@hitszosa/ui/styles/theme.css';

@source 是 Tailwind CSS v4 必需的配置,因为 node_modules 默认不会被扫描。

如果你的全局样式文件不在 src/styles/ 下,请按实际目录调整相对路径。

主题初始化

在根 <html> 元素上添加主题配置:

<html
  lang="zh"
  data-default-theme-mode="system"
  data-theme-storage-key="theme-preference"
>
</html>

然后在 layout 的 <head> 中引入共享初始化脚本:

<script>
  import '@hitszosa/ui/client/theme-init'
</script>

data-default-theme-mode 支持:

  • light
  • dark
  • system

如果省略或填写了无效值,会默认回退到 system

组件

---
import { ThemeToggle } from '@hitszosa/ui'
---

<ThemeToggle size="md" />

ThemeToggle 支持以下参数:

  • size: sm | md | lg
  • defaultMode: light | dark | system
  • storageKey: localStorage key
  • class: 外层包装类名

资产

---
import { osaLogoPub } from '@hitszosa/ui'
---

<img src={osaLogoPub.src} alt={osaLogoPub.alt} />

当前可用的 logo metadata 导出:

  • osaLogoDefault
  • osaLogoMono
  • osaLogoPub
  • osaLogoAlt
  • osaLogoVtuber
  • osaLogoOld
  • osaLogo01

导出入口

  • @hitszosa/ui
  • @hitszosa/ui/client/theme
  • @hitszosa/ui/client/theme-init
  • @hitszosa/ui/tailwind/preset
  • @hitszosa/ui/styles/theme.css
  • @hitszosa/ui/components/*
  • @hitszosa/ui/assets/*

开发

bun install
bun run build

运行本地 preview:

cd preview
bun install
bun run build
bun run dev

发布前检查

先确认你已经登录 npm 官方源,并且拥有 hitszosa 组织的发布权限:

npm login
npm whoami
npm org ls hitszosa

检查产物与打包内容:

bun run build
bun pm pack --dry-run

发布

bun publish