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 🙏

© 2024 – Pkg Stats / Ryan Hefner

sermonizer

v0.1.1

Published

personal mini React components library

Downloads

2

Readme

仿Antd组件库

TypeScript + React + Sass + Jest + Storybook/

组件开发流程

主体代码

样式文件

storys文件

test文件

组件库样式变量分类

基础颜色系统

字体系统

表单

按钮

边框和阴影

可配置开关

添加Normalize.css

改为scss样式 styles/_reboots.scss

将原有的变量替换为新定义的变量

添加classnames工具

图标解决方案

SVG: 完全可控 即取既用 Bug少

使用fontawesome组件库

安装: yarn add @fortawesome/fontawesome-svg-core yarn add @fortawesome/free-solid-svg-icons yarn add @fortawesome/react-fontawesome

使用: // 引入图标库 import { library } from '@fortawesome/fontawesome-svg-core' // 引入全部图标 import { fas } from '@fortawesome/free-solid-svg-icons' // 在库里添所有图标 就可以引用了 library.add(fas)

动画效果

一般的动画:css简单 性能好 但是一些复杂动画无法实现

react动画库:react transition group

安装: yarn add react-transition-group

实现过程

enter => (添加动画效果 force a reflow) enter-active => (自定义timeout) => enter-done

exit => (添加动画效果 force a reflow) exit-active => (自定义timeout) => exit-done

动画效果封装成组件库

  <CSSTransition
        in={open}
        timeout={300}
        classNames="my-node"
        appear
        unmountOnExit
  >
        {node}
  </CSSTransition>

组件化封装成:

  <Transition
        in={open}
        timeout={300}
        <!-- 字符串自变量 (可被className覆盖) -->
        animation="zoom-in-top"
  >
        {node}
  </Transition> 

组件开发展示工具

分开展示各个组件不同属性下的状态

能追踪组件的行为并且具有属性调试功能

可以为组件自动生成文档和属性列表

安装storybook: cd my-project-directory npx -p @storybook/cli sb init

添加addon-info装饰器 用来自动生成源码展示等 yarn add @storybook/addon-info yarn add @type ...

自动生成文档

  yarn add react-docgen-typescript-loader

Autocompeleted和Input组件

Autocompeleted要有搜索框自动补全功能

input样式

基本input

不同大小

disabled

右侧带图标

带前缀(http://)后缀(@qq.com)

自动补全功能

需求分析: <Input disabled size="lg|sm" icon="fontawesome支持的图标" prepand="input 前缀, string 或者 ReactElement" append="input 后缀, string 或者 ReactElement" {...restProps} 支持其他所有的HTMLInput属性 />