You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hipo's React based UI Toolkit / [Demo](https://react-ui-toolkit.now.sh/)
3
+
Bakers' React based UI Toolkit
4
4
5
-
### Usage
5
+
##Getting started
6
6
7
-
After installing the `@hipo/react-ui-toolkit` package you can start with simple example
7
+
First, install the package via npm:
8
+
9
+
```bash
10
+
npm install @hipo/react-ui-toolkit
11
+
```
12
+
13
+
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.:
Every component holds a minimum amount of CSS. You can modify them via the CSS variables. See `_colors.scss` and `_measurement.scss`
36
42
37
-
Here is a simple example that shows how to customize `Button` and `Input`
43
+
Here is a simple example that shows how to customize `Button` and `Input` styles by overriding the default CSS variables:
44
+
45
+
```scss
46
+
.button {
47
+
// Override the default button styles using CSS variables
38
48
39
-
```css
40
-
// _button.css
41
-
.primary-button {
42
49
--button-bg: #989898;
43
50
--button-color: black;
44
51
}
45
52
46
-
// _input.css
47
53
.input {
54
+
// Override the default input styles using CSS variables
55
+
48
56
--default-border-color: black;
49
57
}
50
58
```
51
59
60
+
## Development
61
+
62
+
[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.
63
+
64
+
First of all, you need to install the dependencies, in the project root folder, run:
65
+
66
+
```bash
67
+
npm install
68
+
```
69
+
70
+
> ⚠️ 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.
71
+
52
72
### Storybook
53
73
54
-
- To run Storybook `npm run storybook`
55
-
- To generate Storybook build `npm run storybook:build`
74
+
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.
75
+
76
+
To run the Storybook development server on your local environment, you can use the following command:
77
+
78
+
```bash
79
+
npm run storybook
80
+
```
81
+
82
+
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:
56
83
57
-
### Development
84
+
```bash
85
+
npm run storybook:build
86
+
```
58
87
59
-
For recommended `node` and `npm` versions, you can check `package.json`
88
+
### Production Build
60
89
61
-
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`.
90
+
The production deployment is automated by GitHub Actions. Check the [.github/workflows/new-version.yml](/.github/workflows/new-version.yml) file for more information.
62
91
63
-
Or you can run `npm run storybook` to see the components live. Storybook has own Webpack config that compiles and runs the components.
92
+
---
64
93
65
-
### Linter
94
+
If you need to generate a production ready build for some reason, use:
66
95
67
-
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.
96
+
```bash
97
+
npm run build
98
+
```
68
99
69
-
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)
100
+
This will generate a `dist` folder that contains the compiled components.
0 commit comments