@june-ai/june-ui 0.1.0 → 0.2.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 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/README.md CHANGED
@@ -1,44 +1,66 @@
1
- # June UI SDK
2
-
3
- A React Generative UI SDK powered by OpenUI.
4
-
5
- ## Installation
6
-
7
- ```bash
8
- npm install @june-ai/june-ui
9
- ```
10
-
11
- ## Usage
12
-
13
- ```tsx
14
- import { JuneUI } from "@june-ai/june-ui";
15
-
16
- function App() {
17
- return (
18
- <JuneUI
19
- response={response}
20
- isStreaming={false}
21
- />
22
- );
23
- }
24
-
25
- export default App;
26
- ```
27
-
28
- ## Features
29
-
30
- - Generative UI rendering
31
- - Streaming support
32
- - Custom React components
33
- - Theme customization
34
- - Action callbacks
35
- - Error handling
36
-
37
- ## Requirements
38
-
39
- - React 19+
40
- - React DOM 19+
41
-
42
- ## License
43
-
44
- MIT
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.