@june-ai/june-ui 0.0.0-stage → 0.1.1
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/CHANGELOG.md +22 -0
- package/LICENSE +21 -0
- package/README.md +66 -3
- package/dist/index.cjs +1126 -0
- package/dist/index.d.cts +256 -0
- package/dist/index.d.ts +256 -0
- package/dist/index.js +1086 -0
- package/dist/june.css +21 -0
- package/package.json +77 -4
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [Unreleased] (planned 0.2.0)
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
- `JuneRenderer` and `@june-ai/june-ui/core` entry (no built-in library import).
|
|
7
|
+
- Theme support: `theme` ("light" | "dark" | "system"), `themeVars`, `className`, `style`;
|
|
8
|
+
`@june-ai/june-ui/styles.css`.
|
|
9
|
+
- Error boundary, `onJuneError` structured errors (`JuneError`), fallbacks, `resetKeys`.
|
|
10
|
+
- Streaming: `useJuneStream`, `consumeStream`, `fetchStream`, `sseToText`, abort + unmount cleanup.
|
|
11
|
+
- Actions: `defineJuneAction`, `actions` prop, schema validation, confirmation for sensitive actions.
|
|
12
|
+
- `createJuneLibrary` (validation, allow/deny lists) on top of OpenUI's `createLibrary`.
|
|
13
|
+
- All other OpenUI `Renderer` props are forwarded and typed from the installed OpenUI version.
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- `@openuidev/react-lang` is now a peer dependency (single shared parser); `zod`, `zustand`,
|
|
17
|
+
`@openuidev/react-headless` declared as peers.
|
|
18
|
+
- React peer range widened to `^18.3.1 || ^19.0.0`.
|
|
19
|
+
- `onAction` is typed with OpenUI's event type (handlers typed `(event: unknown) => void` still work).
|
|
20
|
+
|
|
21
|
+
### Compatibility
|
|
22
|
+
- `<JuneUI response isStreaming onAction onError />` from 0.1.0 works unchanged.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 June AI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,66 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
# @june-ai/june-ui
|
|
2
|
+
|
|
3
|
+
React Generative UI SDK built on [OpenUI](https://github.com/thesysdev/openui). June adds streaming
|
|
4
|
+
helpers, themes, safe actions, error recovery, and library validation. OpenUI does all parsing and
|
|
5
|
+
rendering.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @june-ai/june-ui
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import styles once in your app entry:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import "@openuidev/react-ui/components.css"; // OpenUI built-in components
|
|
17
|
+
import "@june-ai/june-ui/styles.css"; // June theme variables
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```tsx
|
|
23
|
+
import { JuneUI } from "@june-ai/june-ui";
|
|
24
|
+
|
|
25
|
+
<JuneUI response={response} isStreaming={isStreaming} theme="system" onJuneError={console.error} />
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### Streaming (works with any backend)
|
|
29
|
+
|
|
30
|
+
```tsx
|
|
31
|
+
const stream = useJuneStream();
|
|
32
|
+
stream.startFetch("/api/generate", { method: "POST", body, sse: false }); // sse: true for SSE
|
|
33
|
+
<JuneUI response={stream.response} isStreaming={stream.isStreaming} />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Custom library
|
|
37
|
+
|
|
38
|
+
```tsx
|
|
39
|
+
import { createJuneLibrary } from "@june-ai/june-ui";
|
|
40
|
+
const library = createJuneLibrary({ root: "Stack", components: [Stack, Card] }); // module scope
|
|
41
|
+
<JuneUI library={library} response={response} />
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### Actions
|
|
45
|
+
|
|
46
|
+
```tsx
|
|
47
|
+
const actions = { submit: defineJuneAction({ schema, sensitive: true, handler }) };
|
|
48
|
+
<JuneUI actions={actions} confirmAction={({ name }) => window.confirm(name)} ... />
|
|
49
|
+
```
|
|
50
|
+
Model output never executes code. Only actions you registered by name can run, and sensitive
|
|
51
|
+
actions are denied unless confirmed.
|
|
52
|
+
|
|
53
|
+
### Lightweight entry
|
|
54
|
+
|
|
55
|
+
`@june-ai/june-ui/core` exports `JuneRenderer`, which requires your own `library` and does not
|
|
56
|
+
import OpenUI's built-in component library.
|
|
57
|
+
|
|
58
|
+
## OpenUI features
|
|
59
|
+
|
|
60
|
+
Tool providers, query loaders, state callbacks, and parse-result callbacks are forwarded to
|
|
61
|
+
OpenUI's `Renderer` as props. See OpenUI's docs for their behaviour. Never put API keys in the
|
|
62
|
+
browser; do tool/MCP calls in your backend.
|
|
63
|
+
|
|
64
|
+
## Requirements
|
|
65
|
+
|
|
66
|
+
React 18.3.1+ or 19, plus the OpenUI peer dependencies listed in package.json.
|