<h1 align="center">Freemium Ui</h1>

## [DEMO](https://freemium-ui.netlify.app)

[React](https://reactjs.org/) based light weight ui components based on [Styled Components](https://styled-components.com/)

## Installation

Peer Dependencies to be installed

```
npm install styled-components
```

Install the package

```
npm install freemium-ui
```

Please note that `@next` will only point to pre-releases; to get the latest stable release use `@latest` instead.

## Usage

Here is a quick example to get you started, **it's all you need**:

```jsx
import React from 'react';
import { Button } from 'freemium-ui';
import ReactDOM from 'react-dom';

// import { Button } from 'freemium-ui/Button';

function App() {
  return <Button>Freemium Button</Button>;
}

ReactDOM.render(<App />, document.querySelector('#app'));
```

## Contribution

Install Dependencies

```
npm install
```

Start the app using storybook

```
npm run storybook
```

Build Freemium Ui Core Components

```
npm run build
```

JavaScript heap out of memory could lead to build failure. Check the [official docs](https://rollupjs.org/troubleshooting/#error-javascript-heap-out-of-memory). Or execute any of the required below config

```
export NODE_OPTIONS="--max-old-space-size=8192"
export NODE_OPTIONS="--max-old-space-size=12288"
export NODE_OPTIONS="--max-old-space-size=16384"
```

To check the heap size in MB

```
node -e 'console.log(v8.getHeapStatistics().heap_size_limit/(1024*1024))'
```

Generate a PAT with `admin:org`, `write:packages`, `read:packages`, `delete:packages`

Authenticate to npm github package

```
npm login --registry=https://registry.npmjs.org/
```

Publish the package to npm

```
npm publish
```
