@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.
Files changed (64) hide show
  1. package/README.md +34 -2
  2. package/SKILL.md +52 -0
  3. package/agnosticui-catalog.json +2184 -0
  4. package/dist/catalog.d.ts +5 -0
  5. package/dist/catalog.js +36 -0
  6. package/dist/components/AgAccordion.d.ts +82 -0
  7. package/dist/components/AgAccordion.js +29 -0
  8. package/dist/components/AgAlert.d.ts +971 -0
  9. package/dist/components/AgAlert.js +46 -0
  10. package/dist/components/AgAvatar.d.ts +511 -0
  11. package/dist/components/AgAvatar.js +44 -0
  12. package/dist/components/AgBadge.d.ts +793 -0
  13. package/dist/components/AgBadge.js +49 -0
  14. package/dist/components/AgButton.d.ts +1568 -0
  15. package/dist/components/AgButton.js +61 -0
  16. package/dist/components/AgCard.d.ts +565 -0
  17. package/dist/components/AgCard.js +45 -0
  18. package/dist/components/AgCheckbox.d.ts +1497 -0
  19. package/dist/components/AgCheckbox.js +63 -0
  20. package/dist/components/AgCombobox.d.ts +2733 -0
  21. package/dist/components/AgCombobox.js +91 -0
  22. package/dist/components/AgDivider.d.ts +169 -0
  23. package/dist/components/AgDivider.js +38 -0
  24. package/dist/components/AgEmptyState.d.ts +607 -0
  25. package/dist/components/AgEmptyState.js +42 -0
  26. package/dist/components/AgFieldset.d.ts +433 -0
  27. package/dist/components/AgFieldset.js +39 -0
  28. package/dist/components/AgHeader.d.ts +205 -0
  29. package/dist/components/AgHeader.js +35 -0
  30. package/dist/components/AgInput.d.ts +2988 -0
  31. package/dist/components/AgInput.js +91 -0
  32. package/dist/components/AgMessageBubble.d.ts +670 -0
  33. package/dist/components/AgMessageBubble.js +45 -0
  34. package/dist/components/AgProgress.d.ts +433 -0
  35. package/dist/components/AgProgress.js +39 -0
  36. package/dist/components/AgProgressRing.d.ts +274 -0
  37. package/dist/components/AgProgressRing.js +38 -0
  38. package/dist/components/AgRadio.d.ts +1848 -0
  39. package/dist/components/AgRadio.js +71 -0
  40. package/dist/components/AgRating.d.ts +1433 -0
  41. package/dist/components/AgRating.js +67 -0
  42. package/dist/components/AgSelect.d.ts +1839 -0
  43. package/dist/components/AgSelect.js +69 -0
  44. package/dist/components/AgSpinner.d.ts +151 -0
  45. package/dist/components/AgSpinner.js +34 -0
  46. package/dist/components/AgTabs.d.ts +328 -0
  47. package/dist/components/AgTabs.js +39 -0
  48. package/dist/components/AgTag.d.ts +752 -0
  49. package/dist/components/AgTag.js +44 -0
  50. package/dist/components/AgTimeline.d.ts +274 -0
  51. package/dist/components/AgTimeline.js +38 -0
  52. package/dist/components/AgToggle.d.ts +1848 -0
  53. package/dist/components/AgToggle.js +71 -0
  54. package/dist/functions/validate-surface.d.ts +27 -0
  55. package/dist/functions/validate-surface.js +56 -0
  56. package/dist/harness/mock-stream.d.ts +8 -0
  57. package/dist/harness/mock-stream.js +5 -0
  58. package/dist/index.d.ts +30 -0
  59. package/dist/index.js +31 -0
  60. package/dist/primitives/AgText.d.ts +150 -0
  61. package/dist/primitives/AgText.js +44 -0
  62. package/dist/test-setup.d.ts +1 -0
  63. package/dist/test-setup.js +83 -0
  64. package/package.json +59 -4
package/README.md CHANGED
@@ -1,3 +1,35 @@
1
- # Temporary Holding Version
1
+ # `@agnosticui/a2ui-lit`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
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
+ ```