Skip to content

Commit

Permalink
Merge branch 'next-release' into fix/select
Browse files Browse the repository at this point in the history
  • Loading branch information
jamcry committed Mar 26, 2024
2 parents 18781d5 + 1cbf0cf commit a8e83a8
Show file tree
Hide file tree
Showing 8 changed files with 5,103 additions and 3,755 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/new-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,22 @@ jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- name: Setup repo
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 10
- run: npm install
- run: npm run build
node-version: 18.0.0

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

- id: publish-to-npm
uses: JS-DevTools/npm-publish@v1
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }} # This token should be added from repo settings

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v1
uses: actions/setup-node@v4
with:
node-version: 14
node-version: 18

- name: Install dependencies and build storybook
run: |
Expand Down
70 changes: 49 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
### @hipo/react-ui-toolkit 🧩
# @hipo/react-ui-toolkit 🧩

Hipo's React based UI Toolkit / [Demo](https://react-ui-toolkit.now.sh/)
Bakers' React based UI Toolkit

### Usage
## Getting started

After installing the `@hipo/react-ui-toolkit` package you can start with simple example
First, install the package via npm:

```bash
npm install @hipo/react-ui-toolkit
```

After installing the package you should import the main CSS file to gather the initial styles of the components, and then import the components you want to use in your project.:

```javascript
import {FormField, Input} from "@hipo/react-ui-toolkit/dist/Input";
Expand All @@ -30,43 +36,65 @@ function LoginForm() {
}
```

### Styling
### How to style components?

Every component holds a minimum amount of CSS. You can modify them via the CSS variables. See `_colors.scss` and `_measurement.scss`

Here is a simple example that shows how to customize `Button` and `Input`
Here is a simple example that shows how to customize `Button` and `Input` styles by overriding the default CSS variables:

```scss
.button {
// Override the default button styles using CSS variables

```css
// _button.css
.primary-button {
--button-bg: #989898;
--button-color: black;
}

// _input.css
.input {
// Override the default input styles using CSS variables

--default-border-color: black;
}
```

## Development

[Storybook](#storybook) is suggested for the development environment. It allows you to see the components in isolation and interact with them. It also supports hot-reloading, i.e. when you change the component, it automatically reloads the component in the browser.

First of all, you need to install the dependencies, in the project root folder, run:

```bash
npm install
```

> ⚠️ Make sure you are using the exact version of `node` and `npm` that are specified in the `engines` field of [package.json](/package.json) file. Otherwise, you may face some unexpected issues.
### Storybook

- To run Storybook `npm run storybook`
- To generate Storybook build `npm run storybook:build`
Storybook is a development environment for UI components. It allows you to browse a component library, view the different states of each component, and interactively develop and test components.

To run the Storybook development server on your local environment, you can use the following command:

### Development
```bash
npm run storybook
```

To generate a static build of the Storybook (usually, you don't need this. This is only necessary when you want to publish it to somewhere), you can use the following command:

Recommended system versions
```bash
npm run storybook:build
```

- `node 14.x`
- `npm 7.x`
### Production Build

You can start to development with `npm run dev` command. The command watches for changes and builds the toolkit. If you want to generate a production ready build you can use `npm run build`.
The production deployment is automated by GitHub Actions. Check the [.github/workflows/new-version.yml](/.github/workflows/new-version.yml) file for more information.

Or you can run `npm run storybook` to see the components live. Storybook has own Webpack config that compiles and runs the components.
---

### Linter
If you need to generate a production ready build for some reason, use:

ESLint and Prettier will handle the linting task. You can set a watcher for `npm run prettify` command in your IDE otherwise you need to run prettier manually or right before the production build it'll automatically runs.
```bash
npm run build
```

The ruleset can be found in [@hipo/eslint-config-base](https://github.com/Hipo/eslint-config-hipo-base), [@hipo/eslint-config-react](https://github.com/Hipo/eslint-config-hipo-base)
This will generate a `dist` folder that contains the compiled components.
Loading

0 comments on commit a8e83a8

Please sign in to comment.