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

react-components-ff-test

v0.0.14

Published

UCloud react components

Downloads

874

Readme

React Components

npm version TravisCI CircleCI codecov Commitizen friendly Conventional Commits

前排注意事项

  • 一些没有写在文档中的 props 以及方法等强烈不建议使用,因为这类 API 可能会随时变动。版本更新后可能会发生不可预知的问题。

浏览器兼容

| IE / Edge | Firefox | Chrome | Safari | | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | IE11, Edge 18 | 29 | 30 | 7 |

如何使用

  • 组件依赖于 react(^16)、react-dom(^16),请注意引入对应依赖,从 0.7.0 开始,不再兼容 react 15。

  • 使用 npm 或 yarn 进行安装

<!-- install use yarn -->
yarn add @ucloud-fe/react-components
<!-- install use npm -->
npm install @ucloud-fe/react-components
<!-- install with a fixed version -->
yarn add @ucloud-fe/[email protected]
  • 需要注意对应修改 webpack 的 loader 配置,根据项目具体配置
{
    rules: [
        {
            test: /\.css$/,
            use: ['style-loader', 'css-loader']
        },
        {
            test: /.(svg|eot|ttf|woff)$/,
            use: [
                {
                    loader: 'file-loader',
                    options: {
                        name: 'assets/[name].[ext]'
                    }
                }
            ]
        }
    ];
}
  • 实现模块化加载

    • 通过babel-plugin-import实现模块化加载

    添加 import 插件

    npm install babel-plugin-import --dev

    在 babel 的 plugins 中添加配置

    {
        "plugins": [
            [
                "import",
                {
                    "libraryName": "@ucloud-fe/react-components",
                    "camel2DashComponentName": false,
                    "libraryDirectory": "lib/components"
                }
            ]
        ]
    }
    • 或者直接手动引用对应文件来实现模块化加载
    import Button from '@ucloud-fe/react-components/lib/components/Button';

如何在 Create-React-App 中使用

添加到依赖

  1. 通过 Create-React-App 创建好项目
  2. 按照上述文档将 react-components 添加到依赖,然后按照需要去引用

模块化支持

  1. 修改项目的自定义配置,不支持的需要先执行 npm run eject
  2. 按照上述文档在 babel 的 plugin 中添加配置

zIndex 说明

  • Modal、Drawer 默认的 zIndex 为 1010
  • Popover 默认的 zIndex 为 1030
  • Tooltip、Select、DatePicker、TimePicker、ActionList、PopConfirm 等 zIndex 同为 1030,弹出层容器、层级、滚动定位可通过 ConfigProvider 统一配置
  • Message 默认的 zIndex 为 1060
  • Loading 默认的 zIndex 为 10
  • 其余内部使用的 zIndex 为 10 以下