# @reverb-ui/react

> Reverb Design System component kit in React

Latest version **2.4.3** (published 2022-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install @reverb-ui/react
pnpm add @reverb-ui/react
yarn add @reverb-ui/react
bun add @reverb-ui/react
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.4.3 |
| Published | 2022-07-12 |
| First published | 2021-08-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=14 |
| Dependencies | 18 |
| Unpacked size | 2 MB |
| Known vulnerabilities | 0 (+23 in 1 direct dependencies) |
| Install scripts | yes |
| Author | Rock Content - Team Reverb |
| Maintainers | rock_engineering, nataliacoelho, benitsrock, kelvin.chaves |

## Links

- npm: https://www.npmjs.com/package/@reverb-ui/react
- Repository: https://gitlab.rockcontent.com/reverb/package/reverb-package-react
- Homepage: https://gitlab.rockcontent.com/reverb/package/reverb-package-react/-/blob/c2ba34641cb88068fc5b49c232426d90a72c1f22/README.md
- Issues: https://gitlab.rockcontent.com/reverb/package/reverb-package-react/-/issues
- npm.io page: https://npm.io/package/@reverb-ui/react

## Dependencies (18)

- [axios](https://npm.io/package/axios.md) ^0.21.4
- [react-dates](https://npm.io/package/react-dates.md) 21.8.0
- [react-icons](https://npm.io/package/react-icons.md) ^4.3.1
- [react-select](https://npm.io/package/react-select.md) 5.2.1
- [framer-motion](https://npm.io/package/framer-motion.md) 3.10.6
- [@emotion/react](https://npm.io/package/@emotion/react.md) ^11.4.1
- [@popperjs/core](https://npm.io/package/@popperjs/core.md) ^2.9.3
- [react-colorful](https://npm.io/package/react-colorful.md) ^5.5.1
- [@emotion/styled](https://npm.io/package/@emotion/styled.md) ^11.3.0
- [get-user-locale](https://npm.io/package/get-user-locale.md) ^1.4.0
- [@chakra-ui/icons](https://npm.io/package/@chakra-ui/icons.md) ^1.0.15
- [react-datepicker](https://npm.io/package/react-datepicker.md) 4.2.1
- [react-input-mask](https://npm.io/package/react-input-mask.md) ^2.0.4
- [@reverb-ui/tokens](https://npm.io/package/@reverb-ui/tokens.md) ^2.2.0
- [styled-components](https://npm.io/package/styled-components.md) ^5.3.0
- [@chakra-ui/skip-nav](https://npm.io/package/@chakra-ui/skip-nav.md) ^1.1.11
- [@reverb-ui/icons-react](https://npm.io/package/@reverb-ui/icons-react.md) ^1.2.0
- [@segment/dependency-report](https://npm.io/package/@segment/dependency-report.md) ^1.1.0

## Recent versions

- 2.4.3 (latest) — 2022-07-12
- 2.4.2 — 2022-07-04
- 2.4.1 — 2022-06-21
- 2.4.0 — 2022-06-21
- 2.3.2 — 2022-05-09
- 2.3.1 — 2022-05-09
- 2.3.0 — 2022-04-26
- 2.2.1 — 2022-03-22
- 2.2.0 — 2022-03-21
- 2.1.3 — 2022-03-18
- 2.1.2 — 2022-02-25
- 2.1.1 — 2022-02-25
- 2.1.0 — 2022-02-08
- 2.0.1 — 2022-01-27
- 2.0.0 — 2022-01-06
- … 21 more at https://npm.io/package/@reverb-ui/react/versions

## README

# 📦 reverb-package-react

Reverb component kit in React, Simple, Modular & Accessible UI Components for your React Applications.

Reverb provides a set of accessible, reusable, and composable React components that make it super easy to create websites and apps.

## 📄 Using Reverb in a react project

Install the kit package in your react project

```bash
yarn add @reverb-ui/react
```

or, with npm:

```bash
npm install @reverb-ui/react
```

In your entry file (e.g `app.tsx`) use the theme provider

```typescript
# app.tsx

import * as React from "react"
import { ThemeProvider, ReverbUITheme } from "@reverb-ui/react"

// Use at the root of your app
function App() {
  return (
    <ThemeProvider theme={ReverbUITheme} resetCSS>
      <App />
    </ThemeProvider>
  )
}
```

Use any component from the library

```typescript
# MyComponent.tsx
import React from 'react'
import { Button } from '@reverb-ui/react'

const MyComponent = () => <Button colorScheme="blue">Foobar</Button>
```

## 🏗️ Getting started in Development

There are two methods for getting started with this repo.

### ➕ Familiar with Git?

```bash
git clone ssh://git@gitlab.rockcontent.com:2222/reverb/package/reverb-package-react.git
```

or with HTTPS:

```bash
git clone https://gitlab.rockcontent.com/reverb/package/reverb-package-react.git
```

then

```bash
cd reverb-package-react && npm install
```

### ➖ Not Familiar with Git?

Click [here](https://gitlab.rockcontent.com/reverb/package/reverb-package-react/-/archive/master/reverb-package-react-master.zip) to download the .zip file.  Extract the contents of the zip file, then open your terminal, change to the project directory, and:

```bash
npm install
```

## 👷 Developing

To start the developing run :

```bash
npm run start
```

This will build a version of your library, run the watcher and also run the Storybook.

To open the Storybook manually open your Browser and navigate to [http://localhost:6006](http://localhost:6006).

Start developing your components in `src/components` folder and update the `src/index.ts` file accordingly.

Always provide an `your-component/stories/your-component.stories.tsx` file, so your component will show up in the Storybook.

You can refer to example `Button` component, learn more about working in development on Reverb UI, follow [this link](https://wiki.rockcontent.com/share/87b33854-b9a1-4bed-ad2f-e310b1882da4);

## ✨ Creating a new Library

Cleanup the src folder with existing components examples, and add your own components.

### Proposals (Babel)

For smoother development some Babel plugin are included

- [class-properties](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-class-properties)
- [object-rest-spread](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-object-rest-spread)
- [optional-chaining](https://github.com/babel/babel/tree/master/packages/babel-plugin-proposal-optional-chaining)

## 🎨 Styling your components

`SCSS` and `CSS` are supported out of the box just import your styles into your component like you normally would do.

For the use of  `CSS Modules` refere to [rollup-plugin-postcss](https://github.com/egoist/rollup-plugin-postcss)

> But we indicate that you use [styled-components](https://styled-components.com/docs) for styling the components.

## 🧪 Testing

Testing is done with [Jest](https://facebook.github.io/jest/), [@testing-library](https://testing-library.com/docs/);

You can refer to `example.spec.tsx` as an example.

```bash
npm run test
```

or (for testing watch)

```bash
npm run test:watch
```

or (for getting coverage)

```bash
npm run test:coverage
```

## 🚨 Linting

Linting is set up through [ESLint](https://eslint.org/) and configured with  [eslint-config-tsdx](https://www.npmjs.com/package/eslint-config-tsdx);

You can modify linting rules by overriding them in the `.eslintrc` file.

```bash
npm run lint
```

or (for for automatic fixing if possible)

```bash
npm run lint:fix
```

## 🚀 Publishing your library to NPM

To release your library to NPM or your private Registry, make sure you have an active account at [NPM](https://www.npmjs.com/), your `.npmrc` file is correctly setup and the repository url in `package.json` file is set to your repository url, then:

```bash
npm run release
```

Or you only need create a new tag and push the new tag to remote repository, the pipeline will do all the hard work here from compiling a new bundle, creating a new storybook build, publishing the new library version to NPM, and publishing the new storybook build to AWS.

According to the `.terraform` configuration;

Example create new tag:

```bash
git tag -a v1.0.1 -m “Release new component”
```

Now let's check if a tag was created and send it to the remote repository:

```bash
git show v1.0.1 && git push origin v1.0.1
```

> Learn more about our git flow, follow [this link](https://wiki.rockcontent.com/doc/gitflow-workflow-pMwl52On0C#h-flow)

## 🎨 Storybook

For custom layouts, styling, controls, addons and more information about the Storybook please refer to [React Storybook](https://storybook.js.org/docs/react/get-started/introduction) documentation.

## 📝 Scripts

- `npm run start` : Only serves the Storybook.
- `npm run build` : Builds your library  (build can be found in `dist` folder).
- `npm run build:storybook` : Builds the static Storybook in case you want to deploy it.
- `npm run test` : Runs the tests.
- `npm run test:coverage`: Runs the test and shows the coverage.
- `npm run test:watch`: Runs the test and watch the files test.
- `npm run lint` : Runs the linter, TypeScript TypeCheck and StyleLint.
- `npm run lint:fix` : Runs the linter, TypeScript TypeCheck and StyleLint and fixes automatic fixable issues.
- `npm run eslint`: Runs only the JavaScript linter.
- `npm run eslint:fix`: Runs only the JavaScript linter and fixes automatic fixable issues.
- `npm run stylelint`: Runs only the style linter.
- `npm run stylelint:fix`: Runs only the style linter and fixes automatic fixable issues.
- `npm run check-types`: Runs typescript type checker.
- `npm run release` : Publishes your Library on NPM or your private Registry (depending on your config in your `.npmrc` file).

## 🏷️ Resources

### Bundler

- [Rollup.js](https://rollupjs.org/guide/en)

### Code Formatter

- [Prettier](https://prettier.io/)

### React Storybook

- [React Storybook](https://storybook.js.org/docs/react/get-started/introduction)

### Testing Components

- [@testing-library](https://testing-library.com/docs/)
- [Jest](https://facebook.github.io/jest/)

### Code Linting

- [ESLint](https://eslint.org/)
- [eslint-config-tsdx](https://www.npmjs.com/package/eslint-config-tsdx)
- [stylelint-prettier](https://github.com/prettier/stylelint-prettier)
- [stylelint-scss](https://github.com/kristerkari/stylelint-scss)

### Code Compiler

- [Babel 7](https://babeljs.io/)
- [Typescript](https://www.typescriptlang.org/)

---
_Source: https://npm.io/package/@reverb-ui/react · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
