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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@zapmyco/ui

v0.0.1

Published

Zapmyco UI - 智能家居系统前端组件库

Downloads

68

Readme

@zapmyco/ui

Zapmyco UI 是一个为智能家居系统设计的React组件库,旨在帮助开发者快速构建智能家居应用的用户界面。

特性

  • 🏠 专为智能家居设计的组件
  • 🎨 可定制的主题和样式
  • 📱 响应式设计,适配各种设备
  • 🔌 易于集成的API
  • 📦 支持按需加载
  • 🌙 内置暗黑模式支持

安装

# 使用npm
npm install @zapmyco/ui

# 使用yarn
yarn add @zapmyco/ui

# 使用pnpm
pnpm add @zapmyco/ui

使用示例

import { DeviceCard } from '@zapmyco/ui';

// 设备数据
const device = {
  id: 'light-1',
  name: '客厅灯',
  type: 'light',
  status: {
    online: true,
    power: true,
    brightness: 80
  }
};

// 在组件中使用
function MyComponent() {
  const handleToggle = (device, value) => {
    console.log(`设备 ${device.name} 状态切换为 ${value ? '开启' : '关闭'}`);
  };

  return (
    <DeviceCard 
      device={device} 
      onToggle={handleToggle}
    />
  );
}

组件

基础组件

  • Button - 按钮组件
  • Card - 卡片组件
  • Icon - 图标组件

设备组件

  • DeviceCard - 设备卡片组件
  • DeviceControl - 设备控制组件
  • DeviceList - 设备列表组件

工具组件

  • ThemeProvider - 主题提供者
  • useDeviceStatus - 设备状态钩子
  • useMediaQuery - 媒体查询钩子

自定义主题

import { ThemeProvider } from '@zapmyco/ui';

function App() {
  return (
    <ThemeProvider
      theme={{
        colorScheme: 'dark',
        primaryColor: '#10b981', // 绿色
        borderRadius: 'large',
        animation: true
      }}
    >
      <YourApp />
    </ThemeProvider>
  );
}

开发

本项目使用NX进行管理,提供了以下命令:

# 安装依赖
pnpm install

# 启动开发服务器(监视模式)
pnpm dev

# 构建
pnpm build

# 运行测试
pnpm test

# 运行Storybook
pnpm storybook

技术栈

  • React: UI库基础框架
  • TypeScript: 类型安全
  • Vite: 快速的构建工具
  • Storybook: 组件文档和开发环境
  • NX: Monorepo管理工具

贡献指南

欢迎贡献代码、报告问题或提出建议。请查看我们的贡献指南了解更多信息。

许可证

Apache-2.0