glchat-a2ui-react-renderer 0.2.6 → 0.2.8

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 (108) hide show
  1. package/README.md +251 -124
  2. package/dist/index.d.ts +10 -4
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +13 -5
  5. package/dist/src/Provider.d.ts +21 -14
  6. package/dist/src/Provider.d.ts.map +1 -1
  7. package/dist/src/Provider.js +56 -42
  8. package/dist/src/SurfaceRenderer.d.ts +17 -0
  9. package/dist/src/SurfaceRenderer.d.ts.map +1 -0
  10. package/dist/src/SurfaceRenderer.js +28 -0
  11. package/dist/src/components/a2ui/Button/Button.d.ts +313 -3
  12. package/dist/src/components/a2ui/Button/Button.d.ts.map +1 -1
  13. package/dist/src/components/a2ui/Button/Button.js +31 -24
  14. package/dist/src/components/a2ui/{MultipleChoice → ChoicePicker}/CheckboxList.d.ts +1 -2
  15. package/dist/src/components/a2ui/ChoicePicker/CheckboxList.d.ts.map +1 -0
  16. package/dist/src/components/a2ui/ChoicePicker/CheckboxList.js +34 -0
  17. package/dist/src/components/a2ui/ChoicePicker/ChoicePicker.d.ts +9 -0
  18. package/dist/src/components/a2ui/ChoicePicker/ChoicePicker.d.ts.map +1 -0
  19. package/dist/src/components/a2ui/ChoicePicker/ChoicePicker.js +54 -0
  20. package/dist/src/components/a2ui/ChoicePicker/theme.d.ts +10 -0
  21. package/dist/src/components/a2ui/ChoicePicker/theme.d.ts.map +1 -0
  22. package/dist/src/components/a2ui/{MultipleChoice → ChoicePicker}/theme.js +15 -12
  23. package/dist/src/components/a2ui/TagInput/TagInput.d.ts +290 -0
  24. package/dist/src/components/a2ui/TagInput/TagInput.d.ts.map +1 -0
  25. package/dist/src/components/a2ui/TagInput/TagInput.js +110 -0
  26. package/dist/src/components/a2ui/TagInput/theme.d.ts +13 -0
  27. package/dist/src/components/a2ui/TagInput/theme.d.ts.map +1 -0
  28. package/dist/src/components/a2ui/TagInput/theme.js +74 -0
  29. package/dist/src/components/a2ui/Timeout/Timeout.d.ts +154 -3
  30. package/dist/src/components/a2ui/Timeout/Timeout.d.ts.map +1 -1
  31. package/dist/src/components/a2ui/Timeout/Timeout.js +40 -25
  32. package/dist/src/components/a2ui/common.d.ts +87 -0
  33. package/dist/src/components/a2ui/common.d.ts.map +1 -0
  34. package/dist/src/components/a2ui/common.js +23 -0
  35. package/dist/src/components/ui/Button/Button.d.ts +15 -0
  36. package/dist/src/components/ui/Button/Button.d.ts.map +1 -0
  37. package/dist/src/components/ui/Button/Button.js +16 -0
  38. package/dist/src/components/ui/Button/theme.d.ts +5 -0
  39. package/dist/src/components/ui/Button/theme.d.ts.map +1 -0
  40. package/dist/src/components/{a2ui → ui}/Button/theme.js +13 -10
  41. package/dist/src/components/ui/Checkbox/Checkbox.js +2 -2
  42. package/dist/src/components/ui/Checkbox/theme.d.ts +3 -3
  43. package/dist/src/components/ui/Checkbox/theme.d.ts.map +1 -1
  44. package/dist/src/components/ui/Checkbox/theme.js +3 -3
  45. package/dist/src/components/ui/MultiSelect/MultiSelect.d.ts +1 -1
  46. package/dist/src/components/ui/MultiSelect/MultiSelect.d.ts.map +1 -1
  47. package/dist/src/components/ui/MultiSelect/MultiSelect.js +12 -12
  48. package/dist/src/components/ui/MultiSelect/theme.d.ts +12 -12
  49. package/dist/src/components/ui/MultiSelect/theme.d.ts.map +1 -1
  50. package/dist/src/components/ui/MultiSelect/theme.js +13 -13
  51. package/dist/src/components/ui/Select/Select.js +8 -8
  52. package/dist/src/components/ui/Select/theme.d.ts +8 -8
  53. package/dist/src/components/ui/Select/theme.d.ts.map +1 -1
  54. package/dist/src/components/ui/Select/theme.js +8 -9
  55. package/dist/src/utils/catalog.d.ts +16 -4
  56. package/dist/src/utils/catalog.d.ts.map +1 -1
  57. package/dist/src/utils/catalog.js +32 -27
  58. package/dist/src/utils/useSurfaces.d.ts +9 -0
  59. package/dist/src/utils/useSurfaces.d.ts.map +1 -0
  60. package/dist/src/utils/useSurfaces.js +28 -0
  61. package/json/README.md +61 -0
  62. package/json/a2ui-sample-messages.json +193 -0
  63. package/json/glchat_standard_catalog_definition.json +1470 -0
  64. package/package.json +15 -6
  65. package/styles/globals.css +232 -38
  66. package/dist/src/AllSurfacesRenderer.d.ts +0 -14
  67. package/dist/src/AllSurfacesRenderer.d.ts.map +0 -1
  68. package/dist/src/AllSurfacesRenderer.js +0 -18
  69. package/dist/src/SingleSurfaceRenderer.d.ts +0 -15
  70. package/dist/src/SingleSurfaceRenderer.d.ts.map +0 -1
  71. package/dist/src/SingleSurfaceRenderer.js +0 -9
  72. package/dist/src/components/a2ui/Button/theme.d.ts +0 -14
  73. package/dist/src/components/a2ui/Button/theme.d.ts.map +0 -1
  74. package/dist/src/components/a2ui/Card/Card.d.ts +0 -4
  75. package/dist/src/components/a2ui/Card/Card.d.ts.map +0 -1
  76. package/dist/src/components/a2ui/Card/Card.js +0 -16
  77. package/dist/src/components/a2ui/Card/theme.d.ts +0 -10
  78. package/dist/src/components/a2ui/Card/theme.d.ts.map +0 -1
  79. package/dist/src/components/a2ui/Card/theme.js +0 -21
  80. package/dist/src/components/a2ui/CheckBox/CheckBox.d.ts +0 -4
  81. package/dist/src/components/a2ui/CheckBox/CheckBox.d.ts.map +0 -1
  82. package/dist/src/components/a2ui/CheckBox/CheckBox.js +0 -26
  83. package/dist/src/components/a2ui/CheckBox/theme.d.ts +0 -11
  84. package/dist/src/components/a2ui/CheckBox/theme.d.ts.map +0 -1
  85. package/dist/src/components/a2ui/CheckBox/theme.js +0 -17
  86. package/dist/src/components/a2ui/DateTimeInput/theme.d.ts +0 -8
  87. package/dist/src/components/a2ui/DateTimeInput/theme.d.ts.map +0 -1
  88. package/dist/src/components/a2ui/DateTimeInput/theme.js +0 -11
  89. package/dist/src/components/a2ui/MultipleChoice/CheckboxList.d.ts.map +0 -1
  90. package/dist/src/components/a2ui/MultipleChoice/CheckboxList.js +0 -45
  91. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.d.ts +0 -4
  92. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.d.ts.map +0 -1
  93. package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.js +0 -72
  94. package/dist/src/components/a2ui/MultipleChoice/theme.d.ts +0 -13
  95. package/dist/src/components/a2ui/MultipleChoice/theme.d.ts.map +0 -1
  96. package/dist/src/components/a2ui/TextField/TextField.d.ts +0 -4
  97. package/dist/src/components/a2ui/TextField/TextField.d.ts.map +0 -1
  98. package/dist/src/components/a2ui/TextField/TextField.js +0 -54
  99. package/dist/src/components/a2ui/TextField/theme.d.ts +0 -28
  100. package/dist/src/components/a2ui/TextField/theme.d.ts.map +0 -1
  101. package/dist/src/components/a2ui/TextField/theme.js +0 -82
  102. package/dist/src/components/a2ui/Timeout/theme.d.ts +0 -8
  103. package/dist/src/components/a2ui/Timeout/theme.d.ts.map +0 -1
  104. package/dist/src/components/a2ui/Timeout/theme.js +0 -12
  105. package/dist/src/utils/theme.d.ts +0 -4
  106. package/dist/src/utils/theme.d.ts.map +0 -1
  107. package/dist/src/utils/theme.js +0 -92
  108. package/patches/@a2ui+web_core+0.10.0.patch +0 -55
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glchat-a2ui-react-renderer",
3
- "version": "0.2.6",
3
+ "version": "0.2.8",
4
4
  "description": "A2UI (Agent-to-UI) React renderer for GLChat — render declarative UI from AI agent messages",
5
5
  "author": {
6
6
  "name": "GDP Labs",
@@ -24,7 +24,9 @@
24
24
  },
25
25
  "./tailwind-config.cjs": "./tailwind.config.cjs",
26
26
  "./styles/globals.css": "./styles/globals.css",
27
- "./styles/theme-v4.css": "./styles/theme-v4.css"
27
+ "./styles/theme-v4.css": "./styles/theme-v4.css",
28
+ "./json/glchat_standard_catalog_definition.json": "./json/glchat_standard_catalog_definition.json",
29
+ "./json/a2ui-sample-messages.json": "./json/a2ui-sample-messages.json"
28
30
  },
29
31
  "sideEffects": [
30
32
  "**/*.css"
@@ -35,13 +37,13 @@
35
37
  "LICENSE",
36
38
  "tailwind.config.cjs",
37
39
  "styles",
38
- "patches"
40
+ "json"
39
41
  ],
40
42
  "scripts": {
41
43
  "build": "npm run build:ts",
42
44
  "build:ts": "tsc -p tsconfig.build.json",
45
+ "generate:json": "npm run build:ts && node scripts/generate-json.mjs",
43
46
  "prepare": "npm run build",
44
- "postinstall": "patch-package",
45
47
  "lint": "eslint . && npx publint",
46
48
  "lint:pub": "npx publint",
47
49
  "format": "prettier --write .",
@@ -54,6 +56,7 @@
54
56
  "react": ">=18.0.0"
55
57
  },
56
58
  "dependencies": {
59
+ "@a2ui/markdown-it": "^0.0.4",
57
60
  "@a2ui/react": "^0.10.0",
58
61
  "@a2ui/web_core": "^0.10.0",
59
62
  "@radix-ui/react-checkbox": "^1.3.3",
@@ -65,7 +68,8 @@
65
68
  "class-variance-authority": "^0.7.1",
66
69
  "clsx": "^2.1.1",
67
70
  "lucide-react": "^0.563.0",
68
- "patch-package": "^8.0.1"
71
+ "patch-package": "^8.0.1",
72
+ "zod": "^3.25.76"
69
73
  },
70
74
  "devDependencies": {
71
75
  "@testing-library/react": "^16.0.1",
@@ -80,11 +84,16 @@
80
84
  "typescript": "^5.7.2",
81
85
  "typescript-eslint": "^8.57.2",
82
86
  "vitest": "^3.2.4",
83
- "vitest-sonar-reporter": "^2.0.4"
87
+ "vitest-sonar-reporter": "^3.0.0"
84
88
  },
85
89
  "publishConfig": {
86
90
  "access": "public"
87
91
  },
92
+ "overrides": {
93
+ "@a2ui/markdown-it": {
94
+ "@a2ui/web_core": "$@a2ui/web_core"
95
+ }
96
+ },
88
97
  "keywords": [
89
98
  "a2ui",
90
99
  "agent-to-ui",
@@ -50,6 +50,9 @@
50
50
 
51
51
  --hover: 0 0% 0% / 5%;
52
52
 
53
+ --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
54
+ sans-serif;
55
+
53
56
  /* Spacing tokens */
54
57
  --radius: 0.5rem;
55
58
  --radius-md: calc(var(--radius) - 2px);
@@ -104,6 +107,70 @@
104
107
  --hover: 0 0% 100% / 5%;
105
108
  }
106
109
 
110
+ /*
111
+ * Map A2UI basic-catalog tokens to GLChat design tokens inside rendered surfaces.
112
+ * Card, TextField, DateTimeInput, and CheckBox read these via inline styles / --a2ui-*
113
+ * variables; other GLChat overrides use glchat-a2ui-* classes.
114
+ */
115
+ .a2ui-surface {
116
+ font-family: var(--font-sans);
117
+ --a2ui-font-family-title: var(--font-sans);
118
+ --a2ui-font-family-monospace: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
119
+ 'Liberation Mono', 'Courier New', monospace;
120
+
121
+ /** Card */
122
+ --a2ui-card-background: hsl(var(--card));
123
+ --a2ui-color-surface: hsl(var(--card));
124
+ --a2ui-color-on-surface: hsl(var(--card-foreground));
125
+ --a2ui-card-border: 1px solid hsl(var(--border));
126
+ --a2ui-card-border-radius: var(--radius);
127
+ --a2ui-card-padding: 1rem;
128
+ --a2ui-card-box-shadow: none;
129
+ --a2ui-card-margin: 0;
130
+
131
+ /** TextField */
132
+ --a2ui-color-input: hsl(var(--background));
133
+ --a2ui-color-on-input: hsl(var(--foreground));
134
+ --a2ui-color-border: hsl(var(--border));
135
+ --a2ui-color-primary: hsl(var(--primary));
136
+ --a2ui-border: 1px solid hsl(var(--border));
137
+ --a2ui-label-font-size: 0.875rem;
138
+ --a2ui-label-font-weight: 600;
139
+ --a2ui-textfield-label-font-size: 0.875rem;
140
+ --a2ui-textfield-label-font-weight: 600;
141
+ --a2ui-textfield-border-radius: var(--radius-md);
142
+ --a2ui-textfield-padding: 0.5rem 0.75rem;
143
+ --a2ui-textfield-color-border-focus: hsl(var(--primary));
144
+ --a2ui-textfield-color-border-hover: hsl(var(--border));
145
+ --a2ui-textfield-color-error: hsl(var(--destructive));
146
+ --a2ui-font-size-xs: 0.75rem;
147
+
148
+ /** DateTimeInput */
149
+ --a2ui-datetimeinput-background: hsl(var(--background));
150
+ --a2ui-datetimeinput-color: hsl(var(--foreground));
151
+ --a2ui-datetimeinput-border: 1px solid hsl(var(--border));
152
+ --a2ui-datetimeinput-border-radius: var(--radius-md);
153
+ --a2ui-datetimeinput-padding: 0.5rem 0.75rem;
154
+ --a2ui-datetimeinput-label-font-size: 0.875rem;
155
+ --a2ui-datetimeinput-label-font-weight: 600;
156
+
157
+ /* Checkbox */
158
+ --a2ui-checkbox-size: 1rem;
159
+ --a2ui-checkbox-background: hsl(var(--background));
160
+ --a2ui-checkbox-border: 1px solid hsl(var(--primary));
161
+ --a2ui-checkbox-border-radius: var(--radius-sm);
162
+ --a2ui-checkbox-gap: 0.5rem;
163
+ --a2ui-checkbox-margin: 0;
164
+ --a2ui-checkbox-label-font-size: 0.875rem;
165
+ --a2ui-checkbox-label-font-weight: 400;
166
+ --a2ui-checkbox-color-error: hsl(var(--destructive));
167
+ }
168
+
169
+ /* Card */
170
+ .a2ui-surface .a2ui-card {
171
+ width: 100%;
172
+ }
173
+
107
174
  /* Button */
108
175
  .a2ui-surface .a2ui-button > button.glchat-a2ui-button {
109
176
  font-weight: 600 !important;
@@ -139,79 +206,177 @@
139
206
  pointer-events: none !important;
140
207
  }
141
208
 
142
- /* TextField */
143
- .a2ui-surface .a2ui-text-field input.glchat-a2ui-text-field,
144
- .a2ui-surface .a2ui-text-field textarea.glchat-a2ui-text-field {
209
+ /* Input - Container */
210
+ .a2ui-surface div:has(> input[type='text']:not(.glchat-a2ui-tag-input-field)),
211
+ .a2ui-surface div:has(> input[type='number']),
212
+ .a2ui-surface div:has(> input[type='password']),
213
+ .a2ui-surface div:has(> textarea),
214
+ .a2ui-surface div:has(> input[type='date']),
215
+ .a2ui-surface div:has(> input[type='time']),
216
+ .a2ui-surface div:has(> input[type='datetime-local']),
217
+ .a2ui-surface div:has(> input[type='range']) {
218
+ display: flex;
219
+ flex-direction: column;
220
+ gap: 0.5rem;
221
+ width: 100%;
222
+ box-sizing: border-box;
223
+ }
224
+
225
+ /* TextField - Label */
226
+ .a2ui-surface div:has(> input[type='text']) > label,
227
+ .a2ui-surface div:has(> input[type='number']) > label,
228
+ .a2ui-surface div:has(> input[type='password']) > label,
229
+ .a2ui-surface div:has(> textarea) > label {
230
+ font-size: 0.875rem;
231
+ font-weight: 600;
232
+ color: hsl(var(--card-foreground));
233
+ }
234
+
235
+ .a2ui-surface div:has(> input[type='text']:not(.glchat-a2ui-tag-input-field)) > input,
236
+ .a2ui-surface div:has(> input[type='number']) > input,
237
+ .a2ui-surface div:has(> input[type='password']) > input,
238
+ .a2ui-surface div:has(> textarea) > textarea {
239
+ box-sizing: border-box;
240
+ width: 100%;
241
+ border-radius: var(--radius-md);
242
+ border: 1px solid hsl(var(--border));
243
+ background-color: hsl(var(--background));
244
+ padding: 0.5rem 0.75rem;
245
+ font-family: inherit;
246
+ font-size: 0.875rem;
247
+ line-height: 1.5;
248
+ color: hsl(var(--foreground));
249
+ caret-color: currentColor;
250
+ }
251
+
252
+ .a2ui-surface div:has(> textarea) > textarea {
253
+ min-height: 80px;
254
+ height: auto;
255
+ overflow-y: auto;
256
+ white-space: pre-wrap;
257
+ overflow-wrap: break-word;
258
+ }
259
+
260
+ .a2ui-surface div:has(> input[type='text']:not(.glchat-a2ui-tag-input-field)) > input:focus,
261
+ .a2ui-surface div:has(> input[type='text']:not(.glchat-a2ui-tag-input-field)) > input:focus-visible,
262
+ .a2ui-surface div:has(> input[type='number']) > input:focus,
263
+ .a2ui-surface div:has(> input[type='number']) > input:focus-visible,
264
+ .a2ui-surface div:has(> input[type='password']) > input:focus,
265
+ .a2ui-surface div:has(> input[type='password']) > input:focus-visible,
266
+ .a2ui-surface div:has(> textarea) > textarea:focus,
267
+ .a2ui-surface div:has(> textarea) > textarea:focus-visible {
268
+ border-color: hsl(var(--primary)) !important;
269
+ outline: none !important;
270
+ }
271
+
272
+ .a2ui-surface div:has(> input[type='text']:not(.glchat-a2ui-tag-input-field)) > input:disabled,
273
+ .a2ui-surface div:has(> input[type='number']) > input:disabled,
274
+ .a2ui-surface div:has(> input[type='password']) > input:disabled,
275
+ .a2ui-surface div:has(> textarea) > textarea:disabled {
276
+ cursor: not-allowed !important;
277
+ opacity: 0.5 !important;
278
+ }
279
+
280
+ .a2ui-surface div:has(> input[type='text']:not(.glchat-a2ui-tag-input-field)) > input::placeholder,
281
+ .a2ui-surface div:has(> input[type='number']) > input::placeholder,
282
+ .a2ui-surface div:has(> input[type='password']) > input::placeholder,
283
+ .a2ui-surface div:has(> textarea) > textarea::placeholder {
284
+ color: hsl(var(--foreground) / 0.5);
285
+ }
286
+
287
+ .a2ui-surface div:has(> input[type='text']:not(.glchat-a2ui-tag-input-field)) > input:has(+ span),
288
+ .a2ui-surface div:has(> input[type='number']) > input:has(+ span),
289
+ .a2ui-surface div:has(> input[type='password']) > input:has(+ span),
290
+ .a2ui-surface div:has(> textarea) > textarea:has(+ span) {
291
+ border-color: hsl(var(--destructive)) !important;
292
+ }
293
+
294
+ .a2ui-surface div:has(> input[type='text']:not(.glchat-a2ui-tag-input-field)) > span,
295
+ .a2ui-surface div:has(> input[type='number']) > span,
296
+ .a2ui-surface div:has(> input[type='password']) > span,
297
+ .a2ui-surface div:has(> textarea) > span {
298
+ font-size: 0.75rem;
299
+ line-height: 1.25rem;
300
+ color: hsl(var(--destructive));
301
+ }
302
+
303
+ /* TagInput */
304
+ .a2ui-surface .a2ui-tag-input input.glchat-a2ui-tag-input-field {
145
305
  font-family: inherit !important;
146
306
  line-height: 1.5 !important;
147
307
  }
148
308
 
149
- .a2ui-surface .a2ui-text-field input.glchat-a2ui-text-field:focus,
150
- .a2ui-surface .a2ui-text-field input.glchat-a2ui-text-field:focus-visible,
151
- .a2ui-surface .a2ui-text-field textarea.glchat-a2ui-text-field:focus,
152
- .a2ui-surface .a2ui-text-field textarea.glchat-a2ui-text-field:focus-visible {
309
+ .a2ui-surface .a2ui-tag-input .glchat-a2ui-tag-input:focus-within > div {
153
310
  border-color: hsl(var(--primary)) !important;
154
- outline: none !important;
155
311
  }
156
312
 
157
- .a2ui-surface .a2ui-text-field input.glchat-a2ui-text-field:disabled,
158
- .a2ui-surface .a2ui-text-field textarea.glchat-a2ui-text-field:disabled {
313
+ .a2ui-surface .a2ui-tag-input input.glchat-a2ui-tag-input-field:disabled {
159
314
  cursor: not-allowed !important;
160
315
  opacity: 0.5 !important;
161
316
  }
162
317
 
163
- .a2ui-surface .a2ui-text-field input.glchat-a2ui-text-field::placeholder,
164
- .a2ui-surface .a2ui-text-field textarea.glchat-a2ui-text-field::placeholder {
318
+ .a2ui-surface .a2ui-tag-input input.glchat-a2ui-tag-input-field::placeholder {
165
319
  color: hsl(var(--foreground) / 0.5);
166
320
  }
167
321
 
168
- /* DateTimeInput (stock @a2ui/react — theme additionalStyles + globals) */
169
- .a2ui-surface .a2ui-datetime-input > section {
170
- display: flex;
171
- flex-direction: column;
172
- gap: 0.5rem;
173
- width: 100%;
322
+ .a2ui-surface .a2ui-tag-input .glchat-a2ui-tag-input-error {
323
+ color: hsl(var(--destructive)) !important;
174
324
  }
175
325
 
176
- .a2ui-surface .a2ui-datetime-input label {
326
+ /* DateTimeInput */
327
+ .a2ui-surface div:has(> input[type='date']) > label,
328
+ .a2ui-surface div:has(> input[type='time']) > label,
329
+ .a2ui-surface div:has(> input[type='datetime-local']) > label {
177
330
  font-size: 0.875rem;
178
331
  font-weight: 600;
179
332
  color: hsl(var(--card-foreground));
180
333
  }
181
334
 
182
- .a2ui-surface .a2ui-datetime-input input.glchat-a2ui-datetime-input {
183
- font-family: inherit !important;
184
- line-height: 1.5 !important;
335
+ .a2ui-surface div:has(> input[type='date']) > input,
336
+ .a2ui-surface div:has(> input[type='time']) > input,
337
+ .a2ui-surface div:has(> input[type='datetime-local']) > input {
338
+ box-sizing: border-box;
339
+ width: 100%;
340
+ height: 2.5rem;
341
+ font-family: inherit;
342
+ line-height: 1.5;
343
+ font-size: 0.875rem;
185
344
  }
186
345
 
187
- .a2ui-surface .a2ui-datetime-input input.glchat-a2ui-datetime-input:focus,
188
- .a2ui-surface .a2ui-datetime-input input.glchat-a2ui-datetime-input:focus-visible {
346
+ .a2ui-surface div:has(> input[type='date']) > input:focus,
347
+ .a2ui-surface div:has(> input[type='date']) > input:focus-visible,
348
+ .a2ui-surface div:has(> input[type='time']) > input:focus,
349
+ .a2ui-surface div:has(> input[type='time']) > input:focus-visible,
350
+ .a2ui-surface div:has(> input[type='datetime-local']) > input:focus,
351
+ .a2ui-surface div:has(> input[type='datetime-local']) > input:focus-visible {
189
352
  border-color: hsl(var(--primary)) !important;
190
353
  outline: none !important;
191
354
  }
192
355
 
193
- .a2ui-surface .a2ui-datetime-input input.glchat-a2ui-datetime-input:disabled {
356
+ .a2ui-surface div:has(> input[type='date']) > input:disabled,
357
+ .a2ui-surface div:has(> input[type='time']) > input:disabled,
358
+ .a2ui-surface div:has(> input[type='datetime-local']) > input:disabled {
194
359
  cursor: not-allowed !important;
195
360
  opacity: 0.5 !important;
196
361
  }
197
362
 
198
- /* MultipleChoice */
199
- .a2ui-surface .a2ui-multiplechoice button.glchat-a2ui-select-trigger:focus,
200
- .a2ui-surface .a2ui-multiplechoice button.glchat-a2ui-select-trigger:focus-visible {
363
+ /* ChoicePicker - Single-select dropdown */
364
+ .a2ui-surface .a2ui-choicepicker button.glchat-a2ui-select-trigger:focus,
365
+ .a2ui-surface .a2ui-choicepicker button.glchat-a2ui-select-trigger:focus-visible {
201
366
  border-color: hsl(var(--primary)) !important;
202
367
  outline: none !important;
203
368
  }
204
369
 
205
- .a2ui-surface .a2ui-multiplechoice button.glchat-a2ui-select-trigger:disabled {
370
+ .a2ui-surface .a2ui-choicepicker button.glchat-a2ui-select-trigger:disabled {
206
371
  cursor: not-allowed !important;
207
372
  opacity: 0.5 !important;
208
373
  }
209
374
 
210
- .a2ui-surface .a2ui-multiplechoice button.glchat-a2ui-select-trigger [data-placeholder] {
375
+ .a2ui-surface .a2ui-choicepicker button.glchat-a2ui-select-trigger [data-placeholder] {
211
376
  color: hsl(var(--foreground) / 0.5);
212
377
  }
213
378
 
214
- /* Single-select dropdown */
379
+ /* ChoicePicker - Select dropdown content (portaled) */
215
380
  .glchat-a2ui-select-content .glchat-a2ui-select-item[data-highlighted],
216
381
  .glchat-a2ui-select-content .glchat-a2ui-select-item:hover {
217
382
  background-color: hsl(var(--foreground) / 0.1) !important;
@@ -223,13 +388,13 @@
223
388
  outline: none !important;
224
389
  }
225
390
 
226
- .a2ui-surface .a2ui-multiplechoice button.glchat-a2ui-multiselect-trigger:focus,
227
- .a2ui-surface .a2ui-multiplechoice button.glchat-a2ui-multiselect-trigger:focus-visible {
391
+ .a2ui-surface .a2ui-choicepicker button.glchat-a2ui-multiselect-trigger:focus,
392
+ .a2ui-surface .a2ui-choicepicker button.glchat-a2ui-multiselect-trigger:focus-visible {
228
393
  border-color: hsl(var(--primary)) !important;
229
394
  outline: none !important;
230
395
  }
231
396
 
232
- .a2ui-surface .a2ui-multiplechoice button.glchat-a2ui-multiselect-trigger:disabled {
397
+ .a2ui-surface .a2ui-choicepicker button.glchat-a2ui-multiselect-trigger:disabled {
233
398
  cursor: not-allowed !important;
234
399
  opacity: 0.5 !important;
235
400
  }
@@ -240,21 +405,50 @@
240
405
  outline: none !important;
241
406
  }
242
407
 
243
- /* Checkbox (Radix) — A2UI CheckBox + MultipleChoice checkbox variant */
244
- .a2ui-surface .a2ui-checkbox .glchat-a2ui-checkbox[data-state='checked'],
408
+ /* ChoicePicker - checkbox variant */
245
409
  .a2ui-surface .glchat-a2ui-checkbox[data-state='checked'] {
246
410
  background-color: hsl(var(--primary)) !important;
247
411
  color: hsl(var(--primary-foreground)) !important;
248
412
  }
249
413
 
250
- .a2ui-surface .a2ui-checkbox .glchat-a2ui-checkbox:focus-visible,
251
414
  .a2ui-surface .glchat-a2ui-checkbox:focus-visible {
252
415
  outline: none !important;
253
416
  box-shadow: 0 0 0 2px hsl(var(--background)), 0 0 0 4px hsl(var(--ring)) !important;
254
417
  }
255
418
 
256
- .a2ui-surface .a2ui-checkbox .glchat-a2ui-checkbox:disabled,
257
419
  .a2ui-surface .glchat-a2ui-checkbox:disabled {
258
420
  cursor: not-allowed !important;
259
421
  opacity: 0.5 !important;
260
422
  }
423
+
424
+ /* CheckBox */
425
+ .a2ui-surface input[type='checkbox'] {
426
+ appearance: none !important;
427
+ -webkit-appearance: none !important;
428
+ box-sizing: border-box;
429
+ flex-shrink: 0;
430
+ margin: 0;
431
+ display: inline-grid;
432
+ place-content: center;
433
+ vertical-align: middle;
434
+ }
435
+
436
+ .a2ui-surface input[type='checkbox']:checked {
437
+ background-color: hsl(var(--primary)) !important;
438
+ border-color: hsl(var(--primary)) !important;
439
+ border-radius: var(--a2ui-checkbox-border-radius, var(--radius-sm)) !important;
440
+ background-image: url("data:image/svg+xml,%3csvg viewBox='0 0 16 16' fill='white' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M12.207 4.793a1 1 0 010 1.414l-5 5a1 1 0 01-1.414 0l-2-2a1 1 0 011.414-1.414L6.5 9.086l4.293-4.293a1 1 0 011.414 0z'/%3e%3c/svg%3e") !important;
441
+ background-size: 100% 100% !important;
442
+ background-repeat: no-repeat !important;
443
+ background-position: center !important;
444
+ }
445
+
446
+ .a2ui-surface input[type='checkbox']:focus-visible {
447
+ outline: none !important;
448
+ box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
449
+ }
450
+
451
+ .a2ui-surface input[type='checkbox']:disabled {
452
+ cursor: not-allowed !important;
453
+ opacity: 0.5 !important;
454
+ }
@@ -1,14 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- export type AllSurfacesRendererProps = {
3
- className?: string;
4
- fallback?: ReactNode;
5
- loadingFallback?: ReactNode;
6
- };
7
- /**
8
- * Convenience renderer that mounts an `A2UIRenderer` for every known surface.
9
- *
10
- * This lets the consumer avoid thinking about `surfaceId` in the simplest case,
11
- * while still keeping the main provider/renderer separation (provider owns state + onAction).
12
- */
13
- export declare function AllSurfacesRenderer(props: Readonly<AllSurfacesRendererProps>): import("react/jsx-runtime").JSX.Element | null;
14
- //# sourceMappingURL=AllSurfacesRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AllSurfacesRenderer.d.ts","sourceRoot":"","sources":["../../src/AllSurfacesRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,eAAe,CAAC,EAAE,SAAS,CAAC;CAC7B,CAAC;AAEF;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,QAAQ,CAAC,wBAAwB,CAAC,kDAsB5E"}
@@ -1,18 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
3
- import { A2UIRenderer, useA2UI } from '@a2ui/react';
4
- import { useA2UIRegistry } from './Provider.js';
5
- /**
6
- * Convenience renderer that mounts an `A2UIRenderer` for every known surface.
7
- *
8
- * This lets the consumer avoid thinking about `surfaceId` in the simplest case,
9
- * while still keeping the main provider/renderer separation (provider owns state + onAction).
10
- */
11
- export function AllSurfacesRenderer(props) {
12
- const registry = useA2UIRegistry();
13
- const { getSurfaces } = useA2UI();
14
- const surfaceIds = Array.from(getSurfaces().keys());
15
- if (surfaceIds.length === 0)
16
- return null;
17
- return (_jsx(_Fragment, { children: surfaceIds.map((surfaceId) => (_jsx(A2UIRenderer, { surfaceId: surfaceId, registry: registry, className: props.className, fallback: props.fallback, loadingFallback: props.loadingFallback }, surfaceId))) }));
18
- }
@@ -1,15 +0,0 @@
1
- import type { ReactNode } from 'react';
2
- import { type ComponentRegistry } from '@a2ui/react';
3
- export type SingleSurfaceRendererProps = {
4
- /**
5
- * Surface ID to render.
6
- * `@a2ui/react` requires this; we default to `main` for compatibility.
7
- */
8
- surfaceId?: string;
9
- className?: string;
10
- fallback?: ReactNode;
11
- loadingFallback?: ReactNode;
12
- registry?: ComponentRegistry;
13
- };
14
- export declare function SingleSurfaceRenderer(props: Readonly<SingleSurfaceRendererProps>): import("react/jsx-runtime").JSX.Element;
15
- //# sourceMappingURL=SingleSurfaceRenderer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SingleSurfaceRenderer.d.ts","sourceRoot":"","sources":["../../src/SingleSurfaceRenderer.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,EAAgB,KAAK,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAInE,MAAM,MAAM,0BAA0B,GAAG;IACvC;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;CAC9B,CAAC;AAEF,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,QAAQ,CAAC,0BAA0B,CAAC,2CAahF"}
@@ -1,9 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
3
- import { A2UIRenderer } from '@a2ui/react';
4
- import { useA2UIRegistry } from './Provider.js';
5
- export function SingleSurfaceRenderer(props) {
6
- const registryFromCtx = useA2UIRegistry();
7
- const registry = props.registry ?? registryFromCtx;
8
- return (_jsx(A2UIRenderer, { surfaceId: props.surfaceId ?? 'main', registry: registry, className: props.className, fallback: props.fallback, loadingFallback: props.loadingFallback }));
9
- }
@@ -1,14 +0,0 @@
1
- import type { CSSProperties } from 'react';
2
- import type { Theme } from '@a2ui/web_core/types/types';
3
- export type GlchatButtonVariant = 'primary' | 'destructive' | 'outline';
4
- /**
5
- * Button structural class map.
6
- */
7
- export declare const glchatButtonComponents: Theme['components']['Button'];
8
- /**
9
- * Button inline styles aligned with package CSS tokens.
10
- * Variant colors are layered in runtime via `getGlchatButtonVariantStyles`.
11
- */
12
- export declare const glchatButtonAdditionalStyles: NonNullable<Theme['additionalStyles']>['Button'];
13
- export declare function getGlchatButtonVariantStyles(variant: GlchatButtonVariant): CSSProperties;
14
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/Button/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,aAAa,GAAG,SAAS,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,sBAAsB,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAM,CAAC;AAExE;;;GAGG;AACH,eAAO,MAAM,4BAA4B,EAAE,WAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,QAAQ,CAiB/D,CAAC;AAE5B,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,mBAAmB,GAAG,aAAa,CAwCxF"}
@@ -1,4 +0,0 @@
1
- import { type A2UIComponentProps } from '@a2ui/react';
2
- import type { CardNode } from '@a2ui/web_core/types/types';
3
- export declare function CustomCardComponent({ node, surfaceId }: Readonly<A2UIComponentProps<CardNode>>): import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=Card.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAG3D,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,EAAE,QAAQ,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC,2CA2B9F"}
@@ -1,16 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { ComponentNode, classMapToString, stylesToObject, useA2UIComponent, } from '@a2ui/react';
3
- export function CustomCardComponent({ node, surfaceId }) {
4
- const { theme } = useA2UIComponent(node, surfaceId);
5
- const props = node.properties;
6
- const rawChildren = props.children ?? (props.child ? [props.child] : []);
7
- const children = Array.isArray(rawChildren) ? rawChildren : [];
8
- const hostStyle = node.weight === void 0 ? undefined : { '--weight': node.weight };
9
- return (_jsx("div", { className: "a2ui-card", style: hostStyle, children: _jsx("section", { className: classMapToString(theme.components.Card), style: stylesToObject(theme.additionalStyles?.Card), children: children.map((child, index) => {
10
- const childId = typeof child === 'object' && child !== null && 'id' in child
11
- ? child.id
12
- : `child-${index}`;
13
- const childNode = typeof child === 'object' && child !== null && 'type' in child ? child : null;
14
- return _jsx(ComponentNode, { node: childNode, surfaceId: surfaceId }, childId);
15
- }) }) }));
16
- }
@@ -1,10 +0,0 @@
1
- import type { Theme } from '@a2ui/web_core/types/types';
2
- /**
3
- * Card structural layout classes.
4
- */
5
- export declare const glchatCardComponents: Theme['components']['Card'];
6
- /**
7
- * Card inline styles aligned with package CSS tokens.
8
- */
9
- export declare const glchatCardAdditionalStyles: NonNullable<Theme['additionalStyles']>['Card'];
10
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/Card/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,CAE5D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,WAAW,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC,CAAC,MAAM,CAWrF,CAAC"}
@@ -1,21 +0,0 @@
1
- /**
2
- * Card structural layout classes.
3
- */
4
- export const glchatCardComponents = {
5
- 'layout-p-4': true,
6
- };
7
- /**
8
- * Card inline styles aligned with package CSS tokens.
9
- */
10
- export const glchatCardAdditionalStyles = {
11
- backgroundColor: 'hsl(var(--card))',
12
- color: 'hsl(var(--card-foreground))',
13
- borderColor: 'hsl(var(--border))',
14
- borderWidth: '1px',
15
- borderStyle: 'solid',
16
- borderRadius: 'var(--radius)',
17
- boxShadow: '0 1px 2px 0 rgb(0 0 0 / 0.05)',
18
- transitionProperty: 'color, background-color, border-color, box-shadow',
19
- transitionTimingFunction: 'cubic-bezier(0.4, 0, 0.2, 1)',
20
- transitionDuration: '300ms',
21
- };
@@ -1,4 +0,0 @@
1
- import { type A2UIComponentProps } from '@a2ui/react';
2
- import type { CheckboxNode } from '@a2ui/web_core/types/types';
3
- export declare function CustomCheckBoxComponent({ node, surfaceId, }: Readonly<A2UIComponentProps<CheckboxNode>>): import("react/jsx-runtime").JSX.Element;
4
- //# sourceMappingURL=CheckBox.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CheckBox.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/CheckBox/CheckBox.tsx"],"names":[],"mappings":"AAEA,OAAO,EAGL,KAAK,kBAAkB,EACxB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAW/D,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,EACJ,SAAS,GACV,EAAE,QAAQ,CAAC,kBAAkB,CAAC,YAAY,CAAC,CAAC,2CAkD5C"}
@@ -1,26 +0,0 @@
1
- 'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
- import { classMapToString, useA2UIComponent, } from '@a2ui/react';
4
- import { useCallback, useId } from 'react';
5
- import { Checkbox } from '../../ui/Checkbox/Checkbox.js';
6
- import { glchatCheckboxLabelStyles } from '../../ui/Checkbox/theme.js';
7
- import { glchatCheckBoxComponents, glchatCheckBoxContainerStyles, } from './theme.js';
8
- export function CustomCheckBoxComponent({ node, surfaceId, }) {
9
- const { theme, resolveString, resolveBoolean, setValue } = useA2UIComponent(node, surfaceId);
10
- const props = node.properties;
11
- const inputId = useId();
12
- const label = resolveString(props.label);
13
- const valuePath = props.value?.path;
14
- const checked = resolveBoolean(props.value) ?? false;
15
- const handleCheckedChange = useCallback((nextChecked) => {
16
- if (valuePath) {
17
- setValue(valuePath, nextChecked);
18
- }
19
- }, [valuePath, setValue]);
20
- const hostStyle = node.weight === void 0 ? undefined : { '--weight': node.weight };
21
- const checkBoxTheme = theme.components.CheckBox ?? glchatCheckBoxComponents;
22
- const containerClass = classMapToString(checkBoxTheme.container);
23
- const elementClass = classMapToString(checkBoxTheme.element);
24
- const labelClass = classMapToString(checkBoxTheme.label);
25
- return (_jsx("div", { className: "a2ui-checkbox", style: hostStyle, children: _jsxs("section", { className: containerClass, style: glchatCheckBoxContainerStyles, children: [_jsx(Checkbox, { id: inputId, className: elementClass, checked: checked, onCheckedChange: (state) => handleCheckedChange(state === true) }), label ? (_jsx("label", { htmlFor: inputId, className: labelClass, style: glchatCheckboxLabelStyles, children: label })) : null] }) }));
26
- }
@@ -1,11 +0,0 @@
1
- import type { CSSProperties } from 'react';
2
- import type { Theme } from '@a2ui/web_core/types/types';
3
- /**
4
- * A2UI CheckBox structural class map.
5
- */
6
- export declare const glchatCheckBoxComponents: Theme['components']['CheckBox'];
7
- /**
8
- * A2UI CheckBox row layout — checkbox + label side by side.
9
- */
10
- export declare const glchatCheckBoxContainerStyles: CSSProperties;
11
- //# sourceMappingURL=theme.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/CheckBox/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AAExD;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,YAAY,CAAC,CAAC,UAAU,CAIpE,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,6BAA6B,EAAE,aAK3C,CAAC"}
@@ -1,17 +0,0 @@
1
- /**
2
- * A2UI CheckBox structural class map.
3
- */
4
- export const glchatCheckBoxComponents = {
5
- container: {},
6
- element: {},
7
- label: {},
8
- };
9
- /**
10
- * A2UI CheckBox row layout — checkbox + label side by side.
11
- */
12
- export const glchatCheckBoxContainerStyles = {
13
- display: 'flex',
14
- alignItems: 'center',
15
- gap: '0.5rem',
16
- width: '100%',
17
- };