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

sunglasses-ui

v1.0.0

Published

sunglasses-ui 统一组件库 - 基于 Vue 3 的现代化组件库

Readme

sunglasses-ui

sunglasses-ui 统一组件库 - 基于 Vue 3 的现代化组件库,包含组件、工具、主题和钩子。

✨ 特性

  • 🚀 基于 Vue 3 + TypeScript 开发
  • 📦 支持按需导入,减少打包体积
  • 🎨 提供完整的主题系统
  • 🔧 丰富的工具函数和组合式 API
  • 📱 响应式设计,支持移动端
  • 🌍 国际化支持
  • 📖 完整的 TypeScript 类型定义

📦 安装

npm install sunglasses-ui
# 或
pnpm add sunglasses-ui
# 或
yarn add sunglasses-ui

🚀 快速开始

完整导入

import sl from 'sunglasses-ui'
import 'sunglasses-ui/styles'
import { createApp } from 'vue'

const app = createApp()
app.use(sl)

按需导入

// 导入组件
import { SlButton, SlHeader } from 'sunglasses-ui'

// 导入工具函数
import { someUtilFunction } from 'sunglasses-ui'

// 导入 hooks
import { useNamespace } from 'sunglasses-ui'

// 导入样式
import 'sunglasses-ui/styles'

子包导入

// 从子包导入
import { slButton } from 'sunglasses-ui/components'
import { someUtilFunction } from 'sunglasses-ui/utils'
import { useNamespace } from 'sunglasses-ui/hooks'
import 'sunglasses-ui/styles'

📚 组件使用

Button 按钮

<template>
  <sl-Button 
    label="点击我" 
    type="primary" 
    size="medium"
    @click="handleClick"
  />
</template>

<script setup>
const handleClick = () => {
  console.log('按钮被点击了')
}
</script>

Header 头部

<template>
  <sl-Header title="页面标题" />
</template>

🛠️ 开发

环境要求

  • Node.js >= 16
  • pnpm >= 8

本地开发

# 安装依赖
pnpm install

# 启动开发服务器
pnpm dev

# 构建所有包
pnpm build

# 运行示例项目
pnpm dev:examples

# 类型检查
pnpm typecheck

# 清理构建文件
pnpm clean

项目结构

sunglasses-ui/
├── packages/           # 核心包
│   ├── components/     # 组件库
│   ├── hooks/         # 组合式 API
│   ├── utils/         # 工具函数
│   └── styles/        # 样式文件
├── examples/          # 示例项目
└── docs/             # 文档

📝 组件 API

SlButton

| 属性 | 类型 | 默认值 | 说明 | |------|------|--------|------| | label | string | '按钮' | 按钮文本 | | type | 'primary' | 'success' | 'default' | 'default' | 按钮类型 | | size | 'small' | 'medium' | 'large' | 'medium' | 按钮尺寸 |

| 事件 | 参数 | 说明 | |------|------|------| | click | (label: string) | 点击事件 |

🤝 贡献

欢迎贡献代码!请先阅读 贡献指南。

📄 许可证

MIT License

🔗 相关链接