@xemahq/ui-kernel 0.25.0 → 0.25.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/README.md +9 -68
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,49 +1,15 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<svg width="680" height="120" viewBox="0 0 680 120" fill="none" xmlns="http://www.w3.org/2000/svg" role="img" aria-label="@xemahq/ui-kernel">
|
|
3
|
-
<rect width="680" height="120" rx="14" fill="#0B1020"/>
|
|
4
|
-
<g transform="translate(28,34)">
|
|
5
|
-
<path d="M26 0 L52 15 L52 45 L26 60 L0 45 L0 15 Z" fill="#8B5CF6" opacity="0.18"/>
|
|
6
|
-
<path d="M26 12 L41 21 L41 39 L26 48 L11 39 L11 21 Z" fill="#8B5CF6"/>
|
|
7
|
-
</g>
|
|
8
|
-
<text x="92" y="52" font-family="ui-monospace,SFMono-Regular,Menlo,monospace" font-size="22" fill="#F8FAFC" font-weight="700">@xemahq/ui-kernel</text>
|
|
9
|
-
<text x="92" y="80" font-family="ui-sans-serif,system-ui,sans-serif" font-size="15" fill="#94A3B8">Host-agnostic UI kernel for the Xema frontend</text>
|
|
10
|
-
<text x="652" y="105" text-anchor="end" font-family="ui-sans-serif,system-ui,sans-serif" font-size="12" fill="#475569">xema.dev</text>
|
|
11
|
-
</svg>
|
|
12
|
-
</p>
|
|
13
|
-
|
|
14
|
-
<p align="center">
|
|
15
|
-
<a href="https://xema.dev">Website</a> ·
|
|
16
|
-
<a href="https://www.npmjs.com/package/@xemahq/ui-kernel">npm</a>
|
|
17
|
-
</p>
|
|
18
|
-
|
|
19
|
-
<p align="center">
|
|
20
|
-
<img alt="npm" src="https://img.shields.io/npm/v/%40xemahq%2Fui-kernel?color=2563eb&label=npm">
|
|
21
|
-
<img alt="license" src="https://img.shields.io/npm/l/%40xemahq%2Fui-kernel?color=10b981">
|
|
22
|
-
<img alt="types" src="https://img.shields.io/npm/types/%40xemahq%2Fui-kernel?color=3178c6">
|
|
23
|
-
</p>
|
|
24
|
-
|
|
25
1
|
# @xemahq/ui-kernel
|
|
26
2
|
|
|
27
3
|
> Host-agnostic UI kernel for the Xema frontend
|
|
28
4
|
|
|
29
5
|
## Overview
|
|
30
6
|
|
|
31
|
-
The host-
|
|
32
|
-
defines the system bus — the orchestration contract for capability invocation,
|
|
33
|
-
cross-biome intents, the command palette, deeplinks, and window management — and
|
|
34
|
-
the biome-host contract surface, including the frontend-biome and host-bridge
|
|
35
|
-
shapes, the singleton biome registry, and session contributions. React is the
|
|
36
|
-
shared component model, but the kernel carries no router, bundler, or
|
|
37
|
-
host-specific wiring; concrete host adapters live in separate packages. The
|
|
38
|
-
system bus is pure orchestration — it never authorizes; policy is enforced by
|
|
39
|
-
the backend.
|
|
7
|
+
The host-agnostic UI kernel that Xema frontend biomes are built on. It provides `defineWebBiome` for declaring pages, the biome registry, the system bus for capability invocation, intents, the command palette and deeplinks, and the shared design system under `@xemahq/ui-kernel/ui`. The bus only orchestrates; the backend enforces policy.
|
|
40
8
|
|
|
41
9
|
## When to use it
|
|
42
10
|
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
- Reach for the system bus to dispatch capability invocations, intents, or
|
|
46
|
-
deeplinks across biomes.
|
|
11
|
+
- You are authoring a frontend biome and registering it with the host.
|
|
12
|
+
- You need the shared components so a biome looks identical to built-in ones.
|
|
47
13
|
|
|
48
14
|
## Installation
|
|
49
15
|
|
|
@@ -53,10 +19,6 @@ pnpm add @xemahq/ui-kernel
|
|
|
53
19
|
|
|
54
20
|
## Usage
|
|
55
21
|
|
|
56
|
-
Author a web biome with `defineWebBiome` — a declarative page list where each
|
|
57
|
-
`slug` single-sources both the nav route and the route path, and each page
|
|
58
|
-
declares its menu `category` (the host owns where that category renders):
|
|
59
|
-
|
|
60
22
|
```tsx
|
|
61
23
|
import { defineWebBiome } from '@xemahq/ui-kernel';
|
|
62
24
|
import { Layers } from 'lucide-react';
|
|
@@ -76,45 +38,24 @@ export default defineWebBiome({
|
|
|
76
38
|
});
|
|
77
39
|
```
|
|
78
40
|
|
|
79
|
-
|
|
80
|
-
`<Suspense>` boundary) and passes through `init`/`panels`/`session` for bespoke
|
|
81
|
-
biomes. Pass a per-page `id` to keep a short nav id distinct from the route
|
|
82
|
-
slug, or `navHidden: true` to register a route with no nav item.
|
|
41
|
+
Each page's `slug` sets both its nav route and its path. Use a per-page `id` for a short nav id, or `navHidden: true` for a route with no nav item.
|
|
83
42
|
|
|
84
|
-
Lower-level
|
|
43
|
+
Lower-level pieces:
|
|
85
44
|
|
|
86
45
|
```ts
|
|
87
46
|
import { buildSystemBus, biomeRegistry } from '@xemahq/ui-kernel';
|
|
88
47
|
|
|
89
48
|
const bus = buildSystemBus(hostPorts);
|
|
90
|
-
|
|
91
|
-
// Register a frontend biome so the host can render its contributions:
|
|
92
49
|
biomeRegistry.registerBiome(myBiome);
|
|
93
50
|
```
|
|
94
51
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
Build your pages with the shared design system from `@xemahq/ui-kernel/ui` so a
|
|
98
|
-
third-party biome renders pixel-identical to a built-in one (they resolve
|
|
99
|
-
against the host theme at render):
|
|
100
|
-
|
|
101
|
-
```tsx
|
|
102
|
-
import {
|
|
103
|
-
Button, Badge, Input, Select, Dialog, Card, Tabs, Table, // primitives
|
|
104
|
-
PageShell, PageHeader, EmptyState, ErrorCard, StateCard, LoadingState, AsyncBoundary,
|
|
105
|
-
StatusBadge, ScopeBadge, ConfirmDeleteDialog, FormStepper, AsyncCombobox,
|
|
106
|
-
getStatusStyle, cn,
|
|
107
|
-
} from '@xemahq/ui-kernel/ui';
|
|
108
|
-
```
|
|
109
|
-
|
|
110
|
-
Host-service hooks (toast, error copy, URL-backed page state) come from the
|
|
111
|
-
`HostBridge` — e.g. `useMutationWithErrorToast`, `usePageState` from
|
|
112
|
-
`@xemahq/ui-kernel` — so biomes never import host internals directly.
|
|
52
|
+
Components come from `@xemahq/ui-kernel/ui` (for example `Button`, `Card`, `Table`, `PageShell`). Host hooks such as `useMutationWithErrorToast` and `usePageState` come from `@xemahq/ui-kernel`.
|
|
113
53
|
|
|
114
54
|
## Peer requirements
|
|
115
55
|
|
|
116
|
-
- `react`
|
|
117
|
-
- `@tanstack/react-query`
|
|
56
|
+
- `react` `^18.3.1`
|
|
57
|
+
- `@tanstack/react-query` `^5.0.0`
|
|
58
|
+
- `@xemahq/contracts` `>=0.4.0`
|
|
118
59
|
|
|
119
60
|
## License
|
|
120
61
|
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xemahq/ui-kernel",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"description": "Host-framework-agnostic UI kernel for
|
|
6
|
+
"description": "Host-framework-agnostic UI kernel for Xema. Defines the SystemBus orchestration contract (capability.invoke, cross-biome intents, command palette, xema:// deeplinks, window manager) AND the biome-host contract surface (FrontendBiome/FrontendBiomeFactory, HostBridge, the singleton biomeRegistry, session contributions) that every frontend biome composes against. No Vite, Next.js, or React-Router — React itself IS allowed as the shared component model (the contracts traffic in ReactNode/ComponentType and a React context). Concrete host adapters (router/auth/toast wiring) live in separate packages that consume this kernel. The SystemBus is pure orchestration: it never authorizes, the backend capability-router enforces all policy.",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"xema",
|
|
9
9
|
"xema-platform",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@radix-ui/react-switch": "^1.2.5",
|
|
51
51
|
"@radix-ui/react-tabs": "^1.1.12",
|
|
52
52
|
"@radix-ui/react-tooltip": "^1.2.7",
|
|
53
|
-
"@xemahq/registry": "^0.1.
|
|
53
|
+
"@xemahq/registry": "^0.1.7",
|
|
54
54
|
"class-variance-authority": "^0.7.1",
|
|
55
55
|
"clsx": "^2.1.1",
|
|
56
56
|
"lucide-react": "^0.462.0",
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"@types/node": "25.2.3",
|
|
75
75
|
"@types/react": "^18.3.30",
|
|
76
76
|
"@types/react-dom": "^18.3.7",
|
|
77
|
-
"@xemahq/contracts": "^0.
|
|
77
|
+
"@xemahq/contracts": "^0.79.0",
|
|
78
78
|
"eslint": "^9.39.4",
|
|
79
79
|
"prettier": "3.6.2",
|
|
80
80
|
"react": "^18.3.1",
|
|
81
81
|
"react-dom": "^18.3.1",
|
|
82
82
|
"typescript": "5.9.3",
|
|
83
83
|
"vitest": "^3.2.4",
|
|
84
|
-
"@xemahq/eslint-config": "0.
|
|
84
|
+
"@xemahq/eslint-config": "0.14.0"
|
|
85
85
|
},
|
|
86
86
|
"exports": {
|
|
87
87
|
".": {
|
|
@@ -119,6 +119,6 @@
|
|
|
119
119
|
"typecheck": "tsc -p tsconfig.lint.json --noEmit"
|
|
120
120
|
},
|
|
121
121
|
"xemaRelease": {
|
|
122
|
-
"sourceDigest": "sha256:
|
|
122
|
+
"sourceDigest": "sha256:5a2f772fbd3db90cf259986714ab70187641c76c164abcaf315852b181235921"
|
|
123
123
|
}
|
|
124
124
|
}
|