@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
@@ -0,0 +1,71 @@
1
+ // AUTO-GENERATED by v2/a2ui/catalog/scripts/generate-catalog.ts — do not edit by hand
2
+ import { html } from 'lit';
3
+ import { ifDefined } from 'lit/directives/if-defined.js';
4
+ import { z } from 'zod';
5
+ import { A2uiLitElement, ActionSchema, DynamicBooleanSchema, DynamicStringSchema } from '@a2ui/web_core/v1_0';
6
+ import 'agnosticui-core/toggle';
7
+ export const AgToggleSchema = z
8
+ .object({
9
+ label: DynamicStringSchema.describe('REF:#/$defs/DynamicString|String property label.').optional(),
10
+ labelPosition: z.enum(['top', 'bottom', 'end', 'start']).optional(),
11
+ labelHidden: DynamicBooleanSchema.describe('REF:#/$defs/DynamicBoolean|Boolean property labelHidden.').optional(),
12
+ noLabel: DynamicBooleanSchema.describe('REF:#/$defs/DynamicBoolean|Boolean property noLabel.').optional(),
13
+ checked: DynamicBooleanSchema.describe('REF:#/$defs/DynamicBoolean|Boolean property checked.').optional(),
14
+ size: z.enum(['xs', 'sm', 'md', 'lg', 'xl']).optional(),
15
+ variant: z.enum(['warning', 'success', 'danger', 'default', 'monochrome']).optional(),
16
+ disabled: DynamicBooleanSchema.describe('REF:#/$defs/DynamicBoolean|Boolean property disabled.').optional(),
17
+ readonly: DynamicBooleanSchema.describe('REF:#/$defs/DynamicBoolean|Boolean property readonly.').optional(),
18
+ required: DynamicBooleanSchema.describe('REF:#/$defs/DynamicBoolean|Boolean property required.').optional(),
19
+ invalid: DynamicBooleanSchema.describe('REF:#/$defs/DynamicBoolean|Boolean property invalid.').optional(),
20
+ errorMessage: DynamicStringSchema.describe('REF:#/$defs/DynamicString|String property errorMessage.').optional(),
21
+ helpText: DynamicStringSchema.describe('REF:#/$defs/DynamicString|String property helpText.').optional(),
22
+ name: DynamicStringSchema.describe('REF:#/$defs/DynamicString|String property name.').optional(),
23
+ value: DynamicStringSchema.describe('REF:#/$defs/DynamicString|String property value.').optional(),
24
+ action: ActionSchema.describe('REF:#/$defs/Action|Action dispatched on user interaction.').optional(),
25
+ })
26
+ .strict();
27
+ export const AgToggleApi = {
28
+ name: 'AgToggle',
29
+ schema: AgToggleSchema,
30
+ };
31
+ export class AgA2uiToggleElement extends A2uiLitElement {
32
+ static { this.tagName = 'ag-a2ui-toggle'; }
33
+ createRenderRoot() {
34
+ return this;
35
+ }
36
+ handleAction() {
37
+ void this.controller.props.action?.();
38
+ }
39
+ handleTwoWay(e) {
40
+ const next = Boolean(e.detail?.checked);
41
+ this.controller.props.setChecked?.(next);
42
+ void this.controller.props.action?.();
43
+ }
44
+ render() {
45
+ const p = this.controller.props;
46
+ return html `<ag-toggle
47
+ .label=${ifDefined(p.label)}
48
+ .labelPosition=${ifDefined(p.labelPosition)}
49
+ .labelHidden=${Boolean(p.labelHidden)}
50
+ .noLabel=${Boolean(p.noLabel)}
51
+ .checked=${Boolean(p.checked)}
52
+ .size=${ifDefined(p.size)}
53
+ .variant=${ifDefined(p.variant)}
54
+ .disabled=${Boolean(p.disabled)}
55
+ .readonly=${Boolean(p.readonly)}
56
+ .required=${Boolean(p.required)}
57
+ .invalid=${Boolean(p.invalid)}
58
+ .errorMessage=${ifDefined(p.errorMessage)}
59
+ .helpText=${ifDefined(p.helpText)}
60
+ .name=${ifDefined(p.name)}
61
+ .value=${ifDefined(p.value)}
62
+ @click=${this.handleAction}
63
+ @toggle-change=${this.handleTwoWay}
64
+ ></ag-toggle>`;
65
+ }
66
+ }
67
+ export const AgToggle = {
68
+ ...AgToggleApi,
69
+ element: AgA2uiToggleElement,
70
+ tagName: AgA2uiToggleElement.tagName,
71
+ };
@@ -0,0 +1,27 @@
1
+ import { z } from 'zod';
2
+ import type { FunctionImplementation } from '@a2ui/web_core/v1_0';
3
+ /**
4
+ * CSS selector matching all AgnosticUI Form-Associated Custom Elements (FACE)
5
+ * that expose standard `reportValidity()` / `checkValidity()` methods.
6
+ */
7
+ export declare const AG_FACE_SELECTOR = "ag-input, ag-select, ag-checkbox, ag-radio";
8
+ export interface FaceValidatableElement extends HTMLElement {
9
+ reportValidity?: () => boolean;
10
+ checkValidity?: () => boolean;
11
+ }
12
+ export declare const ValidateSurfaceSchema: z.ZodObject<{
13
+ surfaceId: z.ZodOptional<z.ZodString>;
14
+ report: z.ZodOptional<z.ZodBoolean>;
15
+ }, "strict", z.ZodTypeAny, {
16
+ surfaceId?: string | undefined;
17
+ report?: boolean | undefined;
18
+ }, {
19
+ surfaceId?: string | undefined;
20
+ report?: boolean | undefined;
21
+ }>;
22
+ /**
23
+ * Evaluates native HTML5 / FACE form validity across all AgnosticUI form controls
24
+ * inside the active `<a2ui-surface>` Light DOM root.
25
+ */
26
+ export declare function runSurfaceValidation(root?: ParentNode, report?: boolean): boolean;
27
+ export declare const ValidateSurfaceImplementation: FunctionImplementation;
@@ -0,0 +1,56 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * CSS selector matching all AgnosticUI Form-Associated Custom Elements (FACE)
4
+ * that expose standard `reportValidity()` / `checkValidity()` methods.
5
+ */
6
+ export const AG_FACE_SELECTOR = 'ag-input, ag-select, ag-checkbox, ag-radio';
7
+ export const ValidateSurfaceSchema = z
8
+ .object({
9
+ surfaceId: z
10
+ .string()
11
+ .optional()
12
+ .describe('Optional target surface ID. Defaults to the current surface from DataContext.'),
13
+ report: z
14
+ .boolean()
15
+ .optional()
16
+ .describe('When true (default), calls reportValidity() to display validation messages; when false, calls checkValidity().'),
17
+ })
18
+ .strict();
19
+ /**
20
+ * Evaluates native HTML5 / FACE form validity across all AgnosticUI form controls
21
+ * inside the active `<a2ui-surface>` Light DOM root.
22
+ */
23
+ export function runSurfaceValidation(root = document, report = true) {
24
+ const controls = Array.from(root.querySelectorAll(AG_FACE_SELECTOR));
25
+ let allValid = true;
26
+ for (const control of controls) {
27
+ const isValid = report
28
+ ? (control.reportValidity?.() ?? true)
29
+ : (control.checkValidity?.() ?? true);
30
+ if (!isValid) {
31
+ allValid = false;
32
+ }
33
+ }
34
+ return allValid;
35
+ }
36
+ export const ValidateSurfaceImplementation = {
37
+ name: 'validateSurface',
38
+ returnType: 'boolean',
39
+ description: 'Validates all AgnosticUI Form-Associated Custom Elements (ag-input, ag-select, ag-checkbox, ag-radio) within the surface and returns true if all fields are valid.',
40
+ schema: ValidateSurfaceSchema,
41
+ execute(args, context) {
42
+ const surfaceId = typeof args.surfaceId === 'string' && args.surfaceId.length > 0
43
+ ? args.surfaceId
44
+ : context.surface?.id;
45
+ const report = typeof args.report === 'boolean' ? args.report : true;
46
+ const surfaceRoot = typeof document !== 'undefined' && surfaceId
47
+ ? (document.querySelector(`a2ui-surface[data-surface-id="${surfaceId}"]`) ?? document)
48
+ : typeof document !== 'undefined'
49
+ ? document
50
+ : null;
51
+ if (!surfaceRoot) {
52
+ return true;
53
+ }
54
+ return runSurfaceValidation(surfaceRoot, report);
55
+ },
56
+ };
@@ -0,0 +1,8 @@
1
+ export interface A2uiWireMessage {
2
+ version: "1.0";
3
+ createSurface?: Record<string, unknown>;
4
+ updateComponents?: Record<string, unknown>;
5
+ updateDataModel?: Record<string, unknown>;
6
+ deleteSurface?: Record<string, unknown>;
7
+ }
8
+ export declare function createMockA2uiStream(fixture: A2uiWireMessage[], delayMs?: number): AsyncGenerator<A2uiWireMessage>;
@@ -0,0 +1,5 @@
1
+ export async function* createMockA2uiStream(fixture, delayMs = 0) { for (const message of fixture) {
2
+ if (delayMs > 0)
3
+ await new Promise((r) => setTimeout(r, delayMs));
4
+ yield message;
5
+ } }
@@ -0,0 +1,30 @@
1
+ export { AGNOSTICUI_CATALOG_ID, AgnosticUICatalog, registerAgnosticUICatalog } from './catalog.js';
2
+ export { A2uiSurface, type LitComponentApi } from '@a2ui/lit';
3
+ export { MessageProcessor, type SurfaceModel } from '@a2ui/web_core/v1_0';
4
+ export { AgText, AgTextApi, AgTextSchema, AgA2uiTextElement } from './primitives/AgText.js';
5
+ export { AG_FACE_SELECTOR, ValidateSurfaceSchema, ValidateSurfaceImplementation, runSurfaceValidation, type FaceValidatableElement } from './functions/validate-surface.js';
6
+ export { AgAccordion, AgAccordionApi, AgAccordionSchema, AgA2uiAccordionElement } from './components/AgAccordion.js';
7
+ export { AgAlert, AgAlertApi, AgAlertSchema, AgA2uiAlertElement } from './components/AgAlert.js';
8
+ export { AgAvatar, AgAvatarApi, AgAvatarSchema, AgA2uiAvatarElement } from './components/AgAvatar.js';
9
+ export { AgBadge, AgBadgeApi, AgBadgeSchema, AgA2uiBadgeElement } from './components/AgBadge.js';
10
+ export { AgButton, AgButtonApi, AgButtonSchema, AgA2uiButtonElement } from './components/AgButton.js';
11
+ export { AgCard, AgCardApi, AgCardSchema, AgA2uiCardElement } from './components/AgCard.js';
12
+ export { AgCheckbox, AgCheckboxApi, AgCheckboxSchema, AgA2uiCheckboxElement } from './components/AgCheckbox.js';
13
+ export { AgCombobox, AgComboboxApi, AgComboboxSchema, AgA2uiComboboxElement } from './components/AgCombobox.js';
14
+ export { AgDivider, AgDividerApi, AgDividerSchema, AgA2uiDividerElement } from './components/AgDivider.js';
15
+ export { AgEmptyState, AgEmptyStateApi, AgEmptyStateSchema, AgA2uiEmptyStateElement } from './components/AgEmptyState.js';
16
+ export { AgFieldset, AgFieldsetApi, AgFieldsetSchema, AgA2uiFieldsetElement } from './components/AgFieldset.js';
17
+ export { AgHeader, AgHeaderApi, AgHeaderSchema, AgA2uiHeaderElement } from './components/AgHeader.js';
18
+ export { AgInput, AgInputApi, AgInputSchema, AgA2uiInputElement } from './components/AgInput.js';
19
+ export { AgMessageBubble, AgMessageBubbleApi, AgMessageBubbleSchema, AgA2uiMessageBubbleElement } from './components/AgMessageBubble.js';
20
+ export { AgProgress, AgProgressApi, AgProgressSchema, AgA2uiProgressElement } from './components/AgProgress.js';
21
+ export { AgProgressRing, AgProgressRingApi, AgProgressRingSchema, AgA2uiProgressRingElement } from './components/AgProgressRing.js';
22
+ export { AgRadio, AgRadioApi, AgRadioSchema, AgA2uiRadioElement } from './components/AgRadio.js';
23
+ export { AgRating, AgRatingApi, AgRatingSchema, AgA2uiRatingElement } from './components/AgRating.js';
24
+ export { AgSelect, AgSelectApi, AgSelectSchema, AgA2uiSelectElement } from './components/AgSelect.js';
25
+ export { AgSpinner, AgSpinnerApi, AgSpinnerSchema, AgA2uiSpinnerElement } from './components/AgSpinner.js';
26
+ export { AgTabs, AgTabsApi, AgTabsSchema, AgA2uiTabsElement } from './components/AgTabs.js';
27
+ export { AgTag, AgTagApi, AgTagSchema, AgA2uiTagElement } from './components/AgTag.js';
28
+ export { AgTimeline, AgTimelineApi, AgTimelineSchema, AgA2uiTimelineElement } from './components/AgTimeline.js';
29
+ export { AgToggle, AgToggleApi, AgToggleSchema, AgA2uiToggleElement } from './components/AgToggle.js';
30
+ export { createMockA2uiStream, type A2uiWireMessage } from './harness/mock-stream.js';
package/dist/index.js ADDED
@@ -0,0 +1,31 @@
1
+ // AUTO-GENERATED by v2/a2ui/catalog/scripts/generate-catalog.ts — do not edit by hand
2
+ export { AGNOSTICUI_CATALOG_ID, AgnosticUICatalog, registerAgnosticUICatalog } from './catalog.js';
3
+ export { A2uiSurface } from '@a2ui/lit';
4
+ export { MessageProcessor } from '@a2ui/web_core/v1_0';
5
+ export { AgText, AgTextApi, AgTextSchema, AgA2uiTextElement } from './primitives/AgText.js';
6
+ export { AG_FACE_SELECTOR, ValidateSurfaceSchema, ValidateSurfaceImplementation, runSurfaceValidation } from './functions/validate-surface.js';
7
+ export { AgAccordion, AgAccordionApi, AgAccordionSchema, AgA2uiAccordionElement } from './components/AgAccordion.js';
8
+ export { AgAlert, AgAlertApi, AgAlertSchema, AgA2uiAlertElement } from './components/AgAlert.js';
9
+ export { AgAvatar, AgAvatarApi, AgAvatarSchema, AgA2uiAvatarElement } from './components/AgAvatar.js';
10
+ export { AgBadge, AgBadgeApi, AgBadgeSchema, AgA2uiBadgeElement } from './components/AgBadge.js';
11
+ export { AgButton, AgButtonApi, AgButtonSchema, AgA2uiButtonElement } from './components/AgButton.js';
12
+ export { AgCard, AgCardApi, AgCardSchema, AgA2uiCardElement } from './components/AgCard.js';
13
+ export { AgCheckbox, AgCheckboxApi, AgCheckboxSchema, AgA2uiCheckboxElement } from './components/AgCheckbox.js';
14
+ export { AgCombobox, AgComboboxApi, AgComboboxSchema, AgA2uiComboboxElement } from './components/AgCombobox.js';
15
+ export { AgDivider, AgDividerApi, AgDividerSchema, AgA2uiDividerElement } from './components/AgDivider.js';
16
+ export { AgEmptyState, AgEmptyStateApi, AgEmptyStateSchema, AgA2uiEmptyStateElement } from './components/AgEmptyState.js';
17
+ export { AgFieldset, AgFieldsetApi, AgFieldsetSchema, AgA2uiFieldsetElement } from './components/AgFieldset.js';
18
+ export { AgHeader, AgHeaderApi, AgHeaderSchema, AgA2uiHeaderElement } from './components/AgHeader.js';
19
+ export { AgInput, AgInputApi, AgInputSchema, AgA2uiInputElement } from './components/AgInput.js';
20
+ export { AgMessageBubble, AgMessageBubbleApi, AgMessageBubbleSchema, AgA2uiMessageBubbleElement } from './components/AgMessageBubble.js';
21
+ export { AgProgress, AgProgressApi, AgProgressSchema, AgA2uiProgressElement } from './components/AgProgress.js';
22
+ export { AgProgressRing, AgProgressRingApi, AgProgressRingSchema, AgA2uiProgressRingElement } from './components/AgProgressRing.js';
23
+ export { AgRadio, AgRadioApi, AgRadioSchema, AgA2uiRadioElement } from './components/AgRadio.js';
24
+ export { AgRating, AgRatingApi, AgRatingSchema, AgA2uiRatingElement } from './components/AgRating.js';
25
+ export { AgSelect, AgSelectApi, AgSelectSchema, AgA2uiSelectElement } from './components/AgSelect.js';
26
+ export { AgSpinner, AgSpinnerApi, AgSpinnerSchema, AgA2uiSpinnerElement } from './components/AgSpinner.js';
27
+ export { AgTabs, AgTabsApi, AgTabsSchema, AgA2uiTabsElement } from './components/AgTabs.js';
28
+ export { AgTag, AgTagApi, AgTagSchema, AgA2uiTagElement } from './components/AgTag.js';
29
+ export { AgTimeline, AgTimelineApi, AgTimelineSchema, AgA2uiTimelineElement } from './components/AgTimeline.js';
30
+ export { AgToggle, AgToggleApi, AgToggleSchema, AgA2uiToggleElement } from './components/AgToggle.js';
31
+ export { createMockA2uiStream } from './harness/mock-stream.js';
@@ -0,0 +1,150 @@
1
+ import { z } from 'zod';
2
+ import { A2uiLitElement } from '@a2ui/web_core/v1_0';
3
+ export declare const AgTextSchema: z.ZodObject<{
4
+ text: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodObject<{
5
+ '@path': z.ZodOptional<z.ZodString>;
6
+ path: z.ZodOptional<z.ZodString>;
7
+ }, "strip", z.ZodTypeAny, {
8
+ path?: string | undefined;
9
+ '@path'?: string | undefined;
10
+ }, {
11
+ path?: string | undefined;
12
+ '@path'?: string | undefined;
13
+ }>, {
14
+ path?: string | undefined;
15
+ '@path'?: string | undefined;
16
+ }, {
17
+ path?: string | undefined;
18
+ '@path'?: string | undefined;
19
+ }>, z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodIntersection<z.ZodEffects<z.ZodObject<{
20
+ '@call': z.ZodOptional<z.ZodString>;
21
+ call: z.ZodOptional<z.ZodString>;
22
+ catalogId: z.ZodOptional<z.ZodString>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ call?: string | undefined;
25
+ '@call'?: string | undefined;
26
+ catalogId?: string | undefined;
27
+ }, {
28
+ call?: string | undefined;
29
+ '@call'?: string | undefined;
30
+ catalogId?: string | undefined;
31
+ }>, {
32
+ call?: string | undefined;
33
+ '@call'?: string | undefined;
34
+ catalogId?: string | undefined;
35
+ }, {
36
+ call?: string | undefined;
37
+ '@call'?: string | undefined;
38
+ catalogId?: string | undefined;
39
+ }>, z.ZodAny>>]>;
40
+ el: z.ZodOptional<z.ZodEnum<["p", "span", "div", "h1", "h2", "h3", "h4", "h5", "h6", "label"]>>;
41
+ }, "strict", z.ZodTypeAny, {
42
+ text?: any;
43
+ el?: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "span" | undefined;
44
+ }, {
45
+ text?: any;
46
+ el?: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "span" | undefined;
47
+ }>;
48
+ export declare const AgTextApi: {
49
+ name: 'AgText';
50
+ schema: z.ZodObject<{
51
+ text: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodObject<{
52
+ '@path': z.ZodOptional<z.ZodString>;
53
+ path: z.ZodOptional<z.ZodString>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ path?: string | undefined;
56
+ '@path'?: string | undefined;
57
+ }, {
58
+ path?: string | undefined;
59
+ '@path'?: string | undefined;
60
+ }>, {
61
+ path?: string | undefined;
62
+ '@path'?: string | undefined;
63
+ }, {
64
+ path?: string | undefined;
65
+ '@path'?: string | undefined;
66
+ }>, z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodIntersection<z.ZodEffects<z.ZodObject<{
67
+ '@call': z.ZodOptional<z.ZodString>;
68
+ call: z.ZodOptional<z.ZodString>;
69
+ catalogId: z.ZodOptional<z.ZodString>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ call?: string | undefined;
72
+ '@call'?: string | undefined;
73
+ catalogId?: string | undefined;
74
+ }, {
75
+ call?: string | undefined;
76
+ '@call'?: string | undefined;
77
+ catalogId?: string | undefined;
78
+ }>, {
79
+ call?: string | undefined;
80
+ '@call'?: string | undefined;
81
+ catalogId?: string | undefined;
82
+ }, {
83
+ call?: string | undefined;
84
+ '@call'?: string | undefined;
85
+ catalogId?: string | undefined;
86
+ }>, z.ZodAny>>]>;
87
+ el: z.ZodOptional<z.ZodEnum<["p", "span", "div", "h1", "h2", "h3", "h4", "h5", "h6", "label"]>>;
88
+ }, "strict", z.ZodTypeAny, {
89
+ text?: any;
90
+ el?: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "span" | undefined;
91
+ }, {
92
+ text?: any;
93
+ el?: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "span" | undefined;
94
+ }>;
95
+ };
96
+ export declare class AgA2uiTextElement extends A2uiLitElement<typeof AgTextApi> {
97
+ static readonly tagName = "ag-a2ui-text";
98
+ createRenderRoot(): this;
99
+ render(): import("lit-html").TemplateResult<1>;
100
+ }
101
+ export declare const AgText: {
102
+ name: 'AgText';
103
+ schema: z.ZodObject<{
104
+ text: z.ZodUnion<[z.ZodString, z.ZodEffects<z.ZodObject<{
105
+ '@path': z.ZodOptional<z.ZodString>;
106
+ path: z.ZodOptional<z.ZodString>;
107
+ }, "strip", z.ZodTypeAny, {
108
+ path?: string | undefined;
109
+ '@path'?: string | undefined;
110
+ }, {
111
+ path?: string | undefined;
112
+ '@path'?: string | undefined;
113
+ }>, {
114
+ path?: string | undefined;
115
+ '@path'?: string | undefined;
116
+ }, {
117
+ path?: string | undefined;
118
+ '@path'?: string | undefined;
119
+ }>, z.ZodIntersection<z.ZodRecord<z.ZodString, z.ZodAny>, z.ZodIntersection<z.ZodEffects<z.ZodObject<{
120
+ '@call': z.ZodOptional<z.ZodString>;
121
+ call: z.ZodOptional<z.ZodString>;
122
+ catalogId: z.ZodOptional<z.ZodString>;
123
+ }, "strip", z.ZodTypeAny, {
124
+ call?: string | undefined;
125
+ '@call'?: string | undefined;
126
+ catalogId?: string | undefined;
127
+ }, {
128
+ call?: string | undefined;
129
+ '@call'?: string | undefined;
130
+ catalogId?: string | undefined;
131
+ }>, {
132
+ call?: string | undefined;
133
+ '@call'?: string | undefined;
134
+ catalogId?: string | undefined;
135
+ }, {
136
+ call?: string | undefined;
137
+ '@call'?: string | undefined;
138
+ catalogId?: string | undefined;
139
+ }>, z.ZodAny>>]>;
140
+ el: z.ZodOptional<z.ZodEnum<["p", "span", "div", "h1", "h2", "h3", "h4", "h5", "h6", "label"]>>;
141
+ }, "strict", z.ZodTypeAny, {
142
+ text?: any;
143
+ el?: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "span" | undefined;
144
+ }, {
145
+ text?: any;
146
+ el?: "div" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "label" | "p" | "span" | undefined;
147
+ }>;
148
+ element: typeof AgA2uiTextElement;
149
+ tagName: string;
150
+ };
@@ -0,0 +1,44 @@
1
+ // AUTO-GENERATED by v2/a2ui/catalog/scripts/generate-catalog.ts — do not edit by hand
2
+ import { html } from 'lit';
3
+ import { z } from 'zod';
4
+ import { DynamicStringSchema, A2uiLitElement } from '@a2ui/web_core/v1_0';
5
+ export const AgTextSchema = z
6
+ .object({
7
+ text: DynamicStringSchema.describe('REF:#/$defs/DynamicString|Text content rendered inside the element.'),
8
+ el: z
9
+ .enum(['p', 'span', 'div', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'label'])
10
+ .describe('Semantic HTML tag to render.')
11
+ .optional(),
12
+ })
13
+ .strict();
14
+ export const AgTextApi = {
15
+ name: 'AgText',
16
+ schema: AgTextSchema,
17
+ };
18
+ export class AgA2uiTextElement extends A2uiLitElement {
19
+ static { this.tagName = 'ag-a2ui-text'; }
20
+ createRenderRoot() {
21
+ return this;
22
+ }
23
+ render() {
24
+ const p = this.controller.props;
25
+ const text = p.text ?? '';
26
+ switch (p.el) {
27
+ case 'h1': return html `<h1>${text}</h1>`;
28
+ case 'h2': return html `<h2>${text}</h2>`;
29
+ case 'h3': return html `<h3>${text}</h3>`;
30
+ case 'h4': return html `<h4>${text}</h4>`;
31
+ case 'h5': return html `<h5>${text}</h5>`;
32
+ case 'h6': return html `<h6>${text}</h6>`;
33
+ case 'span': return html `<span>${text}</span>`;
34
+ case 'div': return html `<div>${text}</div>`;
35
+ case 'label': return html `<label>${text}</label>`;
36
+ default: return html `<p>${text}</p>`;
37
+ }
38
+ }
39
+ }
40
+ export const AgText = {
41
+ ...AgTextApi,
42
+ element: AgA2uiTextElement,
43
+ tagName: AgA2uiTextElement.tagName,
44
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,83 @@
1
+ // Shim ElementInternals / attachInternals for FACE components in JSDOM.
2
+ if (typeof HTMLElement !== 'undefined') {
3
+ HTMLElement.prototype.attachInternals = function () {
4
+ const validityFlags = [
5
+ 'valueMissing', 'typeMismatch', 'patternMismatch', 'tooLong', 'tooShort',
6
+ 'rangeUnderflow', 'rangeOverflow', 'stepMismatch', 'badInput', 'customError',
7
+ ];
8
+ const validity = {
9
+ valid: true,
10
+ valueMissing: false,
11
+ typeMismatch: false,
12
+ patternMismatch: false,
13
+ tooLong: false,
14
+ tooShort: false,
15
+ rangeUnderflow: false,
16
+ rangeOverflow: false,
17
+ stepMismatch: false,
18
+ badInput: false,
19
+ customError: false,
20
+ };
21
+ let validationMsg = '';
22
+ return {
23
+ setFormValue: () => { },
24
+ setValidity: (flags, message) => {
25
+ for (const key of validityFlags) {
26
+ validity[key] = Boolean(flags[key]);
27
+ }
28
+ validity.valid = validityFlags.every((k) => !validity[k]);
29
+ validationMsg = message ?? '';
30
+ },
31
+ checkValidity: () => validity.valid,
32
+ reportValidity: () => validity.valid,
33
+ form: null,
34
+ validity,
35
+ get validationMessage() {
36
+ return validationMsg;
37
+ },
38
+ willValidate: false,
39
+ labels: null,
40
+ states: new Set(),
41
+ shadowRoot: null,
42
+ role: '',
43
+ ariaAtomic: null,
44
+ ariaAutoComplete: null,
45
+ ariaBusy: null,
46
+ ariaChecked: null,
47
+ ariaColCount: null,
48
+ ariaColIndex: null,
49
+ ariaColSpan: null,
50
+ ariaCurrent: null,
51
+ ariaDisabled: null,
52
+ ariaExpanded: null,
53
+ ariaHasPopup: null,
54
+ ariaHidden: null,
55
+ ariaInvalid: null,
56
+ ariaKeyShortcuts: null,
57
+ ariaLabel: null,
58
+ ariaLevel: null,
59
+ ariaLive: null,
60
+ ariaModal: null,
61
+ ariaMultiLine: null,
62
+ ariaMultiSelectable: null,
63
+ ariaOrientation: null,
64
+ ariaPlaceholder: null,
65
+ ariaPosInSet: null,
66
+ ariaPressed: null,
67
+ ariaReadOnly: null,
68
+ ariaRequired: null,
69
+ ariaRoleDescription: null,
70
+ ariaRowCount: null,
71
+ ariaRowIndex: null,
72
+ ariaRowSpan: null,
73
+ ariaSelected: null,
74
+ ariaSetSize: null,
75
+ ariaSort: null,
76
+ ariaValueMax: null,
77
+ ariaValueMin: null,
78
+ ariaValueNow: null,
79
+ ariaValueText: null,
80
+ };
81
+ };
82
+ }
83
+ export {};
package/package.json CHANGED
@@ -1,6 +1,61 @@
1
1
  {
2
2
  "name": "@agnosticui/a2ui-lit",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "2.0.0-alpha.1",
4
+ "description": "A2UI v1.0 component catalog and Lit renderer for AgnosticUI",
5
+ "author": "AgnosticUI",
6
+ "license": "Apache-2.0",
7
+ "homepage": "https://agnosticui.com",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com",
11
+ "directory": "v2/a2ui/renderers/lit"
12
+ },
13
+ "keywords": [
14
+ "a2ui",
15
+ "a2ui-v1",
16
+ "agnosticui",
17
+ "generative-ui",
18
+ "lit",
19
+ "web-components",
20
+ "face"
21
+ ],
22
+ "type": "module",
23
+ "main": "dist/index.js",
24
+ "types": "dist/index.d.ts",
25
+ "files": [
26
+ "dist",
27
+ "agnosticui-catalog.json",
28
+ "SKILL.md",
29
+ "README.md"
30
+ ],
31
+ "exports": {
32
+ ".": {
33
+ "types": "./dist/index.d.ts",
34
+ "import": "./dist/index.js"
35
+ },
36
+ "./catalog.json": "./agnosticui-catalog.json",
37
+ "./SKILL.md": "./SKILL.md"
38
+ },
39
+ "scripts": {
40
+ "test": "vitest run",
41
+ "typecheck": "tsc --noEmit",
42
+ "build": "tsc"
43
+ },
44
+ "peerDependencies": {
45
+ "agnosticui-core": ">=2.0.0-alpha.31",
46
+ "lit": "^3.0.0"
47
+ },
48
+ "devDependencies": {
49
+ "@types/node": "^26.6.6",
50
+ "agnosticui-core": "^2.0.0-alpha.31",
51
+ "jsdom": "^26.1.0",
52
+ "lit": "^3.3.3",
53
+ "typescript": "^7.0.2",
54
+ "vitest": "^5.1.0"
55
+ },
56
+ "dependencies": {
57
+ "@a2ui/lit": "^0.15.0",
58
+ "@a2ui/web_core": "^0.15.0",
59
+ "zod": "^3.25.76"
60
+ }
61
+ }