@arnilo/liveframe-starter 0.0.0-stage → 0.3.0
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/LICENSE +21 -0
- package/README.md +42 -2
- package/dist/catalog.d.ts +4 -0
- package/dist/catalog.js +9 -0
- package/dist/catalog.json +1897 -0
- package/dist/design-system.d.ts +3 -0
- package/dist/design-system.js +276 -0
- package/dist/implementations.d.ts +3 -0
- package/dist/implementations.js +153 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5 -0
- package/dist/styles.d.ts +12 -0
- package/dist/styles.js +50 -0
- package/dist/themes.d.ts +3 -0
- package/dist/themes.js +138 -0
- package/dist/ui.definitions.gen.d.ts +855 -0
- package/dist/ui.definitions.gen.js +1545 -0
- package/dist/ui.gen.d.ts +1018 -0
- package/dist/ui.gen.js +102 -0
- package/package.json +55 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Niloy Rahman
|
|
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,43 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @arnilo/liveframe-starter
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A starting point for a [Liveframe](https://github.com/ashiqrniloy/liveframe) host: a reference catalog, React implementations, three themes and a design system that pass every conformance suite. **Copy it or extend it; it is not part of the core contract.** The core package ships no components (spec §3) — this one is an app's worth of them, so you can see the pieces working before you write your own.
|
|
4
|
+
|
|
5
|
+
Requires Bun ≥ 1.4.2, `@arnilo/liveframe` `~0.3.0`, React 19 and `react-aria-components`.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
bun add @arnilo/liveframe @arnilo/liveframe-starter react react-dom react-aria-components
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
```tsx
|
|
12
|
+
import { Surface } from "./surface"; // createRenderer({ catalog, implementations }).Surface
|
|
13
|
+
import { catalog, implementations, themes, designSystem, styles } from "@arnilo/liveframe-starter";
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
| Export | What it is |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `catalog` | `starter.ui@1`: 25 generic primitives (below), validated. Its source of truth is `catalog.json` (`@arnilo/liveframe-starter/catalog.json`), which `liveframe gen` and the MCP config read |
|
|
19
|
+
| `implementations` | One React implementation per kind, built on React Aria Components. Pass them to `createRenderer({ catalog, implementations })` |
|
|
20
|
+
| `themes` | `starter-light`, `starter-dark`, `starter-high-contrast`. Colours live only here (law 3) |
|
|
21
|
+
| `designSystem` | `starter@1.0.0`: values and recipes for every kind. A `tone` axis on `button` (`neutral`, `critical`) is two role aliases, not product variants; the `sheen` extension property shows how an app adds a look the library does not name |
|
|
22
|
+
| `styles()` | `{ base, primitives, themes, designSystem }`: the four sheets to serve, in that order. Each theme and design system scopes itself to the surface that names it, so all three themes load at once and a switch is an attribute change |
|
|
23
|
+
| `primitiveCss` | The trusted structural CSS (display, flex, minimum heights) the recipes deliberately leave out |
|
|
24
|
+
| `@arnilo/liveframe-starter/ui` | The generated widget components (`liveframe gen`): `import { Stack, Button } from "…/ui"` in widget TSX |
|
|
25
|
+
| `@arnilo/liveframe-starter/definitions` | The generated literal definitions `implement()` infers props from |
|
|
26
|
+
|
|
27
|
+
## The primitives
|
|
28
|
+
|
|
29
|
+
Layout `box` `stack` `inline` `grid` `scroll` `separator`; content `text` `hint` `heading` `icon` `image` `link`; controls `button` `textField` `select` `checkbox` `switch`; overlays `menu` `menuItem` `popover` `dialog` `tooltip`; navigation `tabs` `tab` `disclosure`. All are in the spec §5 primitive set except `hint` (secondary text a control can reference with `describedBy`, a node reference). There is no queue, card, metric or widget frame: if it can be built from primitives, it is widget code.
|
|
30
|
+
|
|
31
|
+
It uses the 0.3.0 features worth copying: node references (`textField.describedBy`), a variant axis with role aliases (`button.tone`), an extension property (`sheen`), and `url` rules on `link.href` and `image.src` (`https` or relative).
|
|
32
|
+
|
|
33
|
+
## Conformance
|
|
34
|
+
|
|
35
|
+
`catalogSuite`, `designSystemSuite({ contrast: true })` for all three themes, `rendererSuite` and `rendererBrowserSuite` run against it in Chromium, Firefox and WebKit in this repository's CI (`packages/starter/src/__tests__`). Use those tests as the template for your own host.
|
|
36
|
+
|
|
37
|
+
## Extending it
|
|
38
|
+
|
|
39
|
+
- **A new kind:** add it to `catalog.json`, run `liveframe gen` (twice: components and `--implementations`), add recipes for it and an `implement(…)` binding. The suites tell you what is missing.
|
|
40
|
+
- **Your own look:** keep the catalog and replace `themes` and `designSystem`; the recipes name roles, so a theme swaps colours without touching them.
|
|
41
|
+
- **Your own icons:** `implementations` draws a small generic glyph set. Replace the `icon` binding with your registry.
|
|
42
|
+
|
|
43
|
+
The starter ships no capabilities: actions and sources are your app's.
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type Catalog, type Result } from "@arnilo/liveframe";
|
|
2
|
+
export declare function valid<T>(what: string, result: Result<T>): T;
|
|
3
|
+
/** The starter catalog: the generic primitive set, validated once. `catalog.json` is its source of truth. */
|
|
4
|
+
export declare const catalog: Catalog;
|
package/dist/catalog.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { validateCatalog } from "@arnilo/liveframe";
|
|
2
|
+
import document from "./catalog.json" with { type: "json" };
|
|
3
|
+
export function valid(what, result) {
|
|
4
|
+
if (!result.ok)
|
|
5
|
+
throw new Error(`Invalid starter ${what}: ${JSON.stringify(result.errors)}`);
|
|
6
|
+
return result.value;
|
|
7
|
+
}
|
|
8
|
+
/** The starter catalog: the generic primitive set, validated once. `catalog.json` is its source of truth. */
|
|
9
|
+
export const catalog = valid("catalog", validateCatalog(document));
|