@agnosticui/a2ui-lit 0.0.0-stage → 2.0.0-alpha.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 +34 -2
- package/SKILL.md +52 -0
- package/agnosticui-catalog.json +2184 -0
- package/dist/catalog.d.ts +5 -0
- package/dist/catalog.js +36 -0
- package/dist/components/AgAccordion.d.ts +82 -0
- package/dist/components/AgAccordion.js +29 -0
- package/dist/components/AgAlert.d.ts +971 -0
- package/dist/components/AgAlert.js +46 -0
- package/dist/components/AgAvatar.d.ts +511 -0
- package/dist/components/AgAvatar.js +44 -0
- package/dist/components/AgBadge.d.ts +793 -0
- package/dist/components/AgBadge.js +49 -0
- package/dist/components/AgButton.d.ts +1568 -0
- package/dist/components/AgButton.js +61 -0
- package/dist/components/AgCard.d.ts +565 -0
- package/dist/components/AgCard.js +45 -0
- package/dist/components/AgCheckbox.d.ts +1497 -0
- package/dist/components/AgCheckbox.js +63 -0
- package/dist/components/AgCombobox.d.ts +2733 -0
- package/dist/components/AgCombobox.js +91 -0
- package/dist/components/AgDivider.d.ts +169 -0
- package/dist/components/AgDivider.js +38 -0
- package/dist/components/AgEmptyState.d.ts +607 -0
- package/dist/components/AgEmptyState.js +42 -0
- package/dist/components/AgFieldset.d.ts +433 -0
- package/dist/components/AgFieldset.js +39 -0
- package/dist/components/AgHeader.d.ts +205 -0
- package/dist/components/AgHeader.js +35 -0
- package/dist/components/AgInput.d.ts +2988 -0
- package/dist/components/AgInput.js +91 -0
- package/dist/components/AgMessageBubble.d.ts +670 -0
- package/dist/components/AgMessageBubble.js +45 -0
- package/dist/components/AgProgress.d.ts +433 -0
- package/dist/components/AgProgress.js +39 -0
- package/dist/components/AgProgressRing.d.ts +274 -0
- package/dist/components/AgProgressRing.js +38 -0
- package/dist/components/AgRadio.d.ts +1848 -0
- package/dist/components/AgRadio.js +71 -0
- package/dist/components/AgRating.d.ts +1433 -0
- package/dist/components/AgRating.js +67 -0
- package/dist/components/AgSelect.d.ts +1839 -0
- package/dist/components/AgSelect.js +69 -0
- package/dist/components/AgSpinner.d.ts +151 -0
- package/dist/components/AgSpinner.js +34 -0
- package/dist/components/AgTabs.d.ts +328 -0
- package/dist/components/AgTabs.js +39 -0
- package/dist/components/AgTag.d.ts +752 -0
- package/dist/components/AgTag.js +44 -0
- package/dist/components/AgTimeline.d.ts +274 -0
- package/dist/components/AgTimeline.js +38 -0
- package/dist/components/AgToggle.d.ts +1848 -0
- package/dist/components/AgToggle.js +71 -0
- package/dist/functions/validate-surface.d.ts +27 -0
- package/dist/functions/validate-surface.js +56 -0
- package/dist/harness/mock-stream.d.ts +8 -0
- package/dist/harness/mock-stream.js +5 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +31 -0
- package/dist/primitives/AgText.d.ts +150 -0
- package/dist/primitives/AgText.js +44 -0
- package/dist/test-setup.d.ts +1 -0
- package/dist/test-setup.js +83 -0
- package/package.json +59 -4
package/README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# `@agnosticui/a2ui-lit`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Spec-compliant **A2UI `v1.0`** [component catalog](https://github.com/AgnosticUI/agnosticui/blob/master/v2/a2ui/catalog/agnosticui-catalog.json) and Light-DOM Web Component renderer (`<a2ui-surface>`) for AgnosticUI.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **25 Curated AgnosticUI Components:** `AgText` + 24 `Ag*` core components (`AgCard`, `AgInput`, `AgCombobox`, `AgMessageBubble`, `AgSelect`, `AgCheckbox`, `AgRadio`, `AgRating`, `AgToggle`, `AgButton`, etc.) rendered in Light DOM so AgnosticUI's **21 runtime skins** and **Light/Dark mode** CSS tokens (`--ag-*`) cascade naturally.
|
|
8
|
+
- **Native FACE Validation (`validateSurface`):** Validates Form-Associated Custom Elements (`ElementInternals`) via `reportValidity()` before dispatching `a2uiaction` events.
|
|
9
|
+
- **Two-Way `@path` DataModel Sync:** Automatically syncs interactive form inputs back into `@a2ui/web_core`'s `DataModel`.
|
|
10
|
+
|
|
11
|
+
## Local Development Workflow
|
|
12
|
+
|
|
13
|
+
All commands below assume you are at the **repository root**:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
# 1. Regenerate catalog wrappers & schema from v2/lib (if v2/lib props changed)
|
|
17
|
+
(cd v2/a2ui/catalog && npm run generate)
|
|
18
|
+
|
|
19
|
+
# 2. Run Vitest unit specs and build dist/ (required before building react/vue renderers)
|
|
20
|
+
(cd v2/a2ui/renderers/lit && npm test && npm run build && npm pack)
|
|
21
|
+
|
|
22
|
+
# 3. Verify zero codegen drift across agnosticui-catalog.json, SKILL.md, and Lit wrappers
|
|
23
|
+
(cd v2/a2ui/catalog && npx tsx scripts/check-codegen.ts)
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
> **Note:** Files under `src/components/` and `src/catalog.ts` are generated by `v2/a2ui/catalog/scripts/generate-catalog.ts`. Edit the generator rather than modifying generated wrappers by hand.
|
|
27
|
+
|
|
28
|
+
## Updating `agnosticui-core` Local Tarball
|
|
29
|
+
|
|
30
|
+
During monorepo development, `devDependencies` references the local tarball `file:../../../lib/agnosticui-core-2.0.0-alpha.31.tgz`. If you modify components in `v2/lib`:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
(cd v2/lib && npm run build && npm pack)
|
|
34
|
+
(cd v2/a2ui/renderers/lit && npm install)
|
|
35
|
+
```
|
package/SKILL.md
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# AgnosticUI A2UI v1.0 Component Catalog Skill
|
|
2
|
+
|
|
3
|
+
Use this skill when generating **A2UI `v1.0`** JSONL/JSON message streams targeting AgnosticUI surfaces.
|
|
4
|
+
|
|
5
|
+
## Catalog Metadata
|
|
6
|
+
|
|
7
|
+
- **Protocol Version:** `1.0`
|
|
8
|
+
- **Catalog ID:** `https://agnosticui.com/a2ui/v1/catalog.json`
|
|
9
|
+
- **Total Components:** 25 (`AgText`, `Accordion`, `Alert`, `Avatar`, `Badge`, `Button`, `Card`, `Checkbox`, `Combobox`, `Divider`, `EmptyState`, `Fieldset`, `Header`, `Input`, `MessageBubble`, `Progress`, `ProgressRing`, `Radio`, `Rating`, `Select`, `Spinner`, `Tabs`, `Tag`, `Timeline`, `Toggle`)
|
|
10
|
+
- **Client Validation Function:** `validateSurface` (validates FACE controls via `reportValidity()`)
|
|
11
|
+
|
|
12
|
+
## Strict Authoring Rules
|
|
13
|
+
|
|
14
|
+
1. **Envelope Version & Catalog ID:** Every wire message MUST include `"version": "1.0"`, and `createSurface` MUST set `"catalogId": "https://agnosticui.com/a2ui/v1/catalog.json"`.
|
|
15
|
+
2. **UAX #31 Component IDs:** Every component `id` MUST match `^[A-Za-z_][A-Za-z0-9_]*$` (letters, digits, underscores only; **never** hyphens).
|
|
16
|
+
3. **Adjacency List Children:** Container components (`AgCard`, `AgFieldset`, `AgAccordion`, `AgCollapsible`, `AgTabs`, `AgHeader`, `AgMessageBubble`, `AgAlert`, `AgBadge`, `AgButton`, `AgTag`, `AgProgress`) reference child component IDs via `"children": ["child_id_1", ...]`.
|
|
17
|
+
4. **Two-Way `@path` Data Binding:** Bind interactive form inputs (`AgInput`, `AgCombobox`, `AgSelect`, `AgCheckbox`, `AgRadio`, `AgRating`, `AgToggle`) using `{"@path": "/form/field"}` pointers and initialize values via `updateDataModel`.
|
|
18
|
+
5. **Actions:** Interactive buttons and controls trigger actions via `"action": { "event": { "name": "ACTION_NAME" } }`.
|
|
19
|
+
|
|
20
|
+
## Minimal A2UI v1.0 Wire Example
|
|
21
|
+
|
|
22
|
+
```json
|
|
23
|
+
[
|
|
24
|
+
{
|
|
25
|
+
"version": "1.0",
|
|
26
|
+
"createSurface": {
|
|
27
|
+
"surfaceId": "support_surface",
|
|
28
|
+
"catalogId": "https://agnosticui.com/a2ui/v1/catalog.json"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"version": "1.0",
|
|
33
|
+
"updateComponents": {
|
|
34
|
+
"surfaceId": "support_surface",
|
|
35
|
+
"components": [
|
|
36
|
+
{ "id": "root", "component": "AgCard", "shadow": true, "stacked": true, "children": ["title_text", "email_input", "submit_btn"] },
|
|
37
|
+
{ "id": "title_text", "component": "AgText", "el": "h2", "text": "Account Support" },
|
|
38
|
+
{ "id": "email_input", "component": "AgInput", "label": "Work Email", "type": "email", "required": true, "value": { "@path": "/form/email" } },
|
|
39
|
+
{ "id": "submit_btn", "component": "AgButton", "variant": "primary", "shape": "rounded", "label": "Submit", "action": { "event": { "name": "SUBMIT_TICKET" } } }
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"version": "1.0",
|
|
45
|
+
"updateDataModel": {
|
|
46
|
+
"surfaceId": "support_surface",
|
|
47
|
+
"path": "/",
|
|
48
|
+
"value": { "form": { "email": "" } }
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
]
|
|
52
|
+
```
|