@2600hz/sds-react-components 中文文档教程
@2600hz/sds-反应组件
包含用于网络和桌面开发的所有可共享组件的库。
[![NPM 版本](https://img.shields.io/npm/v/@2600hz/sds-react-components?style=flat-square)](https://img.shields.io/npm/ v/@2600hz/sds-react-components?style=flat-square) [![代码风格:更漂亮](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
2600Hz - Commio
SDS React Components Library
Installation
这个项目需要 Node.js v14+ 运行。
使用 .nvmrc 文件有助于规范所有维护者使用的节点版本。 如果您需要使用此文件中指定的版本,请运行这些命令。
nvm use
nvm install
使用包管理器 yarn v1+ 安装依赖项和 devDependencies。
yarn install
yarn
Usage
安装
yarn add @2600hz/sds-react-components
现在在你的组件中
import { Button, Telicon, ... } from "@2600hz/sds-react-components";
// ...
<Button type='Primary' icon='user-admin-plus'>
Add User
</Button>
// ...
<Telicon name='mic-slash' className='Icon' />
构建项目
yarn build
运行项目
yarn storybook
Telicon
每当一个新图标被添加到 Telicon 时,我们从 npm 获取新版本,然后更新 SvgTelicon 组件。 (这是避免 CORS 与 Safari 和 IOS 设备冲突所必需的)
yarn upgrade @2600hz/sds-telicon --latest
yarn run telicon
Utilities
yarn run prettify
Needed packages
如果您的应用程序中尚未安装它们,yarn 将安装以下可用性所需的软件包。 这些包作为 peerDependencies 添加,
- @2600hz/commio-native-utilities - Contains useful js functions and shareable configurations
- @2600hz/sds-telicon - Contains svg file with all icons available
Tech Stack
Contributing
欢迎拉取请求。 对于重大更改,请先打开一个问题来讨论您想要更改的内容。
承诺 提交必须遵循常规提交格式 确保您的消息看起来像以下示例
feat: Adding new table component
fix: Table component not being exported correctly
fix!: Drop support for Typescript
请注意,最后一个将生成主要提交。 它与添加重大更改页脚具有相同的结果
按照Semantic Versioning 2.0.0 更新项目版本。
Release-It 将负责版本控制,您只需提供正确的类型即可提交:
- fix - to indicate a bug fix (PATCH) ex . v0.0.1
- feat - to indicate a new feature (MINOR) ex. v0.1.0
- chore - for updates that do not require a version bump (.gitignore, comments, etc.)
- docs - for updates to the documentation
- BREAKING CHANGE - regardless of type, indicates a Major release (MAJOR) ex. v1.0.0
访问 常规提交 获取更多示例。
License
@2600hz/sds-react-components
Library that contains all sharable components for web and desktop development.
[![NPM version](https://img.shields.io/npm/v/@2600hz/sds-react-components?style=flat-square)](https://img.shields.io/npm/v/@2600hz/sds-react-components?style=flat-square) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
2600Hz - Commio
SDS React Components Library
Installation
This project requires Node.js v14+ to run.
Using .nvmrc file helps to normalize node version used by all maintainers. If you are required to use version specified in this file, run these commands.
nvm use
nvm install
Use the package manager yarn v1+ to install dependencies and devDependencies.
yarn install
yarn
Usage
Installation
yarn add @2600hz/sds-react-components
Now in your components
import { Button, Telicon, ... } from "@2600hz/sds-react-components";
// ...
<Button type='Primary' icon='user-admin-plus'>
Add User
</Button>
// ...
<Telicon name='mic-slash' className='Icon' />
Build project
yarn build
Run project
yarn storybook
Telicon
Whenever a new icon is added to Telicon, we get the new version from npm, then update SvgTelicon component. (This is necessary to avoid CORS conflicts with Safari and IOS devices)
yarn upgrade @2600hz/sds-telicon --latest
yarn run telicon
Utilities
Format code using Prettier and Eslint
yarn run prettify
Needed packages
If you don't already have them on your app, yarn will install the following packages needed for usability. These packages are added as peerDependencies
- @2600hz/commio-native-utilities - Contains useful js functions and shareable configurations
- @2600hz/sds-telicon - Contains svg file with all icons available
Tech Stack
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Commits Commits must follow conventional commit format Make sure your messages look like the following examples
feat: Adding new table component
fix: Table component not being exported correctly
fix!: Drop support for Typescript
Note that the last one will generate a Major commit. It has the same result as adding a breaking change footer
Follow Semantic Versioning 2.0.0 to update project version.
Release-It will take care of versioning, you just have to give the correct type to commit:
- fix - to indicate a bug fix (PATCH) ex . v0.0.1
- feat - to indicate a new feature (MINOR) ex. v0.1.0
- chore - for updates that do not require a version bump (.gitignore, comments, etc.)
- docs - for updates to the documentation
- BREAKING CHANGE - regardless of type, indicates a Major release (MAJOR) ex. v1.0.0
Visit Conventional Commits for more examples.