@public-ui/react-standalone 2.0.0-rc.12 → 2.0.0-rc.13
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 +34 -4
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,7 +1,37 @@
|
|
|
1
|
-
#
|
|
1
|
+
# KoliBri - Standalone React-Adapter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Motivation
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Provide an adapter for [React](https://reactjs.org) to use the KoliBri components, without the need for a build/bundle process.
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Load the necessary scripts in your HTML file, either from a CDN or from your local installation:
|
|
10
|
+
|
|
11
|
+
```html
|
|
12
|
+
<!-- React -->
|
|
13
|
+
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
|
|
14
|
+
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
|
|
15
|
+
|
|
16
|
+
<!-- KoliBri -->
|
|
17
|
+
<script crossorigin src="https://unpkg.com/@public-ui/components@2.0.0-rc.13/dist/kolibri/kolibri.esm.js" type="module"></script>
|
|
18
|
+
<script crossorigin src="https://unpkg.com/@public-ui/react-standalone@2.0.0-rc.13/dist/index.mjs" type="module"></script>
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
First, initialize KoliBri with a [theme](https://github.com/public-ui/kolibri/tree/develop/packages/themes):
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { register } from 'https://unpkg.com/@public-ui/components@2.0.0-rc.13/dist/esm/index.js';
|
|
27
|
+
import { DEFAULT } from 'https://unpkg.com/@public-ui/themes/dist/index.mjs';
|
|
28
|
+
register(DEFAULT, []).catch(console.warn);
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
KoliBri components, such as `KolButton`, are globally accessible and can be utilized directly from the global namespace:
|
|
32
|
+
|
|
33
|
+
```js
|
|
34
|
+
const node = document.querySelector('#app');
|
|
35
|
+
const root = ReactDOM.createRoot(node);
|
|
36
|
+
root.render(React.createElement(KolButton, { _label: 'Hello World' }));
|
|
37
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@public-ui/react-standalone",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.13",
|
|
4
4
|
"license": "EUPL-1.2",
|
|
5
5
|
"homepage": "https://public-ui.github.io",
|
|
6
6
|
"repository": "https://github.com/public-ui/kolibri",
|
|
@@ -42,12 +42,12 @@
|
|
|
42
42
|
"react"
|
|
43
43
|
],
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@public-ui/react": "2.0.0-rc.
|
|
45
|
+
"@public-ui/react": "2.0.0-rc.13",
|
|
46
46
|
"cpy-cli": "5.0.0",
|
|
47
47
|
"rimraf": "3.0.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@public-ui/components": "2.0.0-rc.
|
|
50
|
+
"@public-ui/components": "2.0.0-rc.13",
|
|
51
51
|
"react": ">=16.14.0",
|
|
52
52
|
"react-dom": ">=16.14.0"
|
|
53
53
|
},
|