@cfx-dev/ui-components 0.0.24 → 0.0.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +33 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,36 @@
|
|
|
1
|
-
#
|
|
1
|
+
# UI Component Library
|
|
2
|
+
Include design system, utils and reusable components.
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
## Instalation
|
|
5
|
+
```console
|
|
6
|
+
yarn add @cfx-dev/ui-components
|
|
7
|
+
npm install @cfx-dev/ui-components
|
|
8
|
+
```
|
|
4
9
|
|
|
5
|
-
##
|
|
6
|
-
|
|
7
|
-
|
|
10
|
+
## Usage
|
|
11
|
+
In your bundler config add this sass option to use ui utils in styles:
|
|
12
|
+
```javascript
|
|
13
|
+
additionalData: `@use "~@cfx-dev/ui-components/dist/styles-scss/ui" as ui;`,
|
|
14
|
+
```
|
|
15
|
+
```javascript
|
|
16
|
+
import '@cfx-dev/ui-components/dist/styles-scss/global.scss';
|
|
17
|
+
```
|
|
18
|
+
Import default themes or take a look inside how to make your own:
|
|
19
|
+
```javascript
|
|
20
|
+
import '@cfx-dev/ui-components/dist/styles-scss/themes.scss';
|
|
21
|
+
```
|
|
22
|
+
Add theme class name to body or root element
|
|
23
|
+
```javascript
|
|
24
|
+
<body className="cfxui-theme-dark">
|
|
25
|
+
```
|
|
26
|
+
For some components you will need to define this variables in your root stiles:
|
|
27
|
+
```css
|
|
28
|
+
html {
|
|
29
|
+
--width: 100vw;
|
|
30
|
+
--height: 100vh;
|
|
31
|
+
--quant: calc(1rem * 0.25);
|
|
32
|
+
}
|
|
33
|
+
```
|
|
8
34
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
- Add folder `lib/components/{ComponentName}`
|
|
12
|
-
- Create a component file `{ComponentName}.tsx`
|
|
13
|
-
- Create a component styles if needed `{ComponentName}.module.scss`
|
|
14
|
-
- Expose youre component in `lib/main.ts`
|
|
15
|
-
|
|
16
|
-
## Release
|
|
17
|
-
Change version in `package.json` run `npm publish --access public`.
|
|
35
|
+
## License
|
|
36
|
+
This project is licensed under the MIT License.
|