<p align="center">
  <img src="https://storage.googleapis.com/labs-media/images/genesis-conveyor-mark.svg" width="150" alt="Genesis logo">
</p>

# GENESIS Design System

![Rating](https://img.shields.io/badge/rating-5%2F5-brightgreen) ![License](https://img.shields.io/badge/license-MIT-green)

[Storybook hosted on Google Cloud](https://genesis-storybook-365607811897.us-central1.run.app/)

The GENESIS design system standardizes our colors, fonts, and sizing tokens across all our apps.

It unifies frontend app development around these core libraries:

- [Antd](https://ant.design/) v5
- [Styled Components](https://styled-components.com/) v5
- [Typescript](https://www.typescriptlang.org/) v5
- [React](https://react.dev/) v18

## 📦 Development

```bash
npm install
npm start
```

To scaffold a new component, run `npm run generate` and add the component name in PascalCase

example:

```
npm run generate RadioGroup
```

## 🔨 Usage

Install the GENESIS library

```
npm install @gobolt/genesis
```

The `GenesisProvider` must included within the application as it supplies the Genesis Theme.

```jsx
import { Button, GenesisProvider } from '@gobolt/genesis;

const Demo = () = {

    const onClick = (value) => {
        console.log("Genesis button clicked with value: ", value);
    }

    return (
        <GenesisProvider>
            <Button onClick={onClick}>Ship</Button>
        </GenesisProvider>
    )
 };
```

The library exports both the components and their types which are documented in our storybook.

## 🧪 Testing

```
npm test
```

[husky](https://typicode.github.io/husky/) has been configured to automatically run the tests on push to Github and will enforce that all tests pass.

## 🚀 Publishing

This project uses [rollup](https://rollupjs.org/) to create the package and [changesets](https://github.com/changesets/changesets) to manage it's versions. We only need to run changesets when we're ready to release and publish the library.

```
npx changeset
npx changeset version
npm publish
```

## 📙 Storybook Deployment to Google Cloud

```
just deploy
```

See the .justfile which simplifies this [Storybook GCP script on Notion](https://www.notion.so/gobolt/Deploy-Genesis-Storybook-to-GCP-1759f4303960806e8d88cf1e751cb19d).

requires: [just](https://github.com/casey/just)

```
brew install just
```

## Test the build

If you want to test the build before deploying...

```
rm -rf storybook-static
npm build-storybook
python3 -m http.server 6006 -d storybook-static
```
