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
@@ -0,0 +1,290 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Tag input field for adding and removing string tags (GLChat extension).
4
+ * Binds the selected tags to a string array in the data model via `value`.
5
+ */
6
+ export declare const TagInputApi: {
7
+ name: string;
8
+ schema: z.ZodObject<{
9
+ label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
10
+ path: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ path: string;
13
+ }, {
14
+ path: string;
15
+ }>, z.ZodObject<{
16
+ call: z.ZodString;
17
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
18
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ call: string;
21
+ args: Record<string, any>;
22
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
23
+ }, {
24
+ call: string;
25
+ args: Record<string, any>;
26
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
27
+ }>]>>;
28
+ value: z.ZodUnion<[z.ZodArray<z.ZodString, "many">, z.ZodObject<{
29
+ path: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ path: string;
32
+ }, {
33
+ path: string;
34
+ }>, z.ZodObject<{
35
+ call: z.ZodString;
36
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
37
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ call: string;
40
+ args: Record<string, any>;
41
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
42
+ }, {
43
+ call: string;
44
+ args: Record<string, any>;
45
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
46
+ }>]>;
47
+ placeholder: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
48
+ path: z.ZodString;
49
+ }, "strip", z.ZodTypeAny, {
50
+ path: string;
51
+ }, {
52
+ path: string;
53
+ }>, z.ZodObject<{
54
+ call: z.ZodString;
55
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
56
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ call: string;
59
+ args: Record<string, any>;
60
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
61
+ }, {
62
+ call: string;
63
+ args: Record<string, any>;
64
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
65
+ }>]>>;
66
+ disabled: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
67
+ path: z.ZodString;
68
+ }, "strip", z.ZodTypeAny, {
69
+ path: string;
70
+ }, {
71
+ path: string;
72
+ }>, z.ZodObject<{
73
+ call: z.ZodString;
74
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
75
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
76
+ }, "strip", z.ZodTypeAny, {
77
+ call: string;
78
+ args: Record<string, any>;
79
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
80
+ }, {
81
+ call: string;
82
+ args: Record<string, any>;
83
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
84
+ }>]>>;
85
+ disableTextInput: z.ZodOptional<z.ZodBoolean>;
86
+ validationRegexp: z.ZodOptional<z.ZodString>;
87
+ validationErrorMessage: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
88
+ path: z.ZodString;
89
+ }, "strip", z.ZodTypeAny, {
90
+ path: string;
91
+ }, {
92
+ path: string;
93
+ }>, z.ZodObject<{
94
+ call: z.ZodString;
95
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
96
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ call: string;
99
+ args: Record<string, any>;
100
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
101
+ }, {
102
+ call: string;
103
+ args: Record<string, any>;
104
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
105
+ }>]>>;
106
+ accessibility: z.ZodOptional<z.ZodObject<{
107
+ label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
108
+ path: z.ZodString;
109
+ }, "strip", z.ZodTypeAny, {
110
+ path: string;
111
+ }, {
112
+ path: string;
113
+ }>, z.ZodObject<{
114
+ call: z.ZodString;
115
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
116
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
117
+ }, "strip", z.ZodTypeAny, {
118
+ call: string;
119
+ args: Record<string, any>;
120
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
121
+ }, {
122
+ call: string;
123
+ args: Record<string, any>;
124
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
125
+ }>]>>;
126
+ description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
127
+ path: z.ZodString;
128
+ }, "strip", z.ZodTypeAny, {
129
+ path: string;
130
+ }, {
131
+ path: string;
132
+ }>, z.ZodObject<{
133
+ call: z.ZodString;
134
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
135
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
136
+ }, "strip", z.ZodTypeAny, {
137
+ call: string;
138
+ args: Record<string, any>;
139
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
140
+ }, {
141
+ call: string;
142
+ args: Record<string, any>;
143
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
144
+ }>]>>;
145
+ }, "strip", z.ZodTypeAny, {
146
+ description?: string | {
147
+ path: string;
148
+ } | {
149
+ call: string;
150
+ args: Record<string, any>;
151
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
152
+ } | undefined;
153
+ label?: string | {
154
+ path: string;
155
+ } | {
156
+ call: string;
157
+ args: Record<string, any>;
158
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
159
+ } | undefined;
160
+ }, {
161
+ description?: string | {
162
+ path: string;
163
+ } | {
164
+ call: string;
165
+ args: Record<string, any>;
166
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
167
+ } | undefined;
168
+ label?: string | {
169
+ path: string;
170
+ } | {
171
+ call: string;
172
+ args: Record<string, any>;
173
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
174
+ } | undefined;
175
+ }>>;
176
+ weight: z.ZodOptional<z.ZodNumber>;
177
+ }, "strict", z.ZodTypeAny, {
178
+ value: string[] | {
179
+ path: string;
180
+ } | {
181
+ call: string;
182
+ args: Record<string, any>;
183
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
184
+ };
185
+ disabled?: boolean | {
186
+ path: string;
187
+ } | {
188
+ call: string;
189
+ args: Record<string, any>;
190
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
191
+ } | undefined;
192
+ weight?: number | undefined;
193
+ accessibility?: {
194
+ description?: string | {
195
+ path: string;
196
+ } | {
197
+ call: string;
198
+ args: Record<string, any>;
199
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
200
+ } | undefined;
201
+ label?: string | {
202
+ path: string;
203
+ } | {
204
+ call: string;
205
+ args: Record<string, any>;
206
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
207
+ } | undefined;
208
+ } | undefined;
209
+ placeholder?: string | {
210
+ path: string;
211
+ } | {
212
+ call: string;
213
+ args: Record<string, any>;
214
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
215
+ } | undefined;
216
+ label?: string | {
217
+ path: string;
218
+ } | {
219
+ call: string;
220
+ args: Record<string, any>;
221
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
222
+ } | undefined;
223
+ disableTextInput?: boolean | undefined;
224
+ validationRegexp?: string | undefined;
225
+ validationErrorMessage?: string | {
226
+ path: string;
227
+ } | {
228
+ call: string;
229
+ args: Record<string, any>;
230
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
231
+ } | undefined;
232
+ }, {
233
+ value: string[] | {
234
+ path: string;
235
+ } | {
236
+ call: string;
237
+ args: Record<string, any>;
238
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
239
+ };
240
+ disabled?: boolean | {
241
+ path: string;
242
+ } | {
243
+ call: string;
244
+ args: Record<string, any>;
245
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
246
+ } | undefined;
247
+ weight?: number | undefined;
248
+ accessibility?: {
249
+ description?: string | {
250
+ path: string;
251
+ } | {
252
+ call: string;
253
+ args: Record<string, any>;
254
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
255
+ } | undefined;
256
+ label?: string | {
257
+ path: string;
258
+ } | {
259
+ call: string;
260
+ args: Record<string, any>;
261
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
262
+ } | undefined;
263
+ } | undefined;
264
+ placeholder?: string | {
265
+ path: string;
266
+ } | {
267
+ call: string;
268
+ args: Record<string, any>;
269
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
270
+ } | undefined;
271
+ label?: string | {
272
+ path: string;
273
+ } | {
274
+ call: string;
275
+ args: Record<string, any>;
276
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
277
+ } | undefined;
278
+ disableTextInput?: boolean | undefined;
279
+ validationRegexp?: string | undefined;
280
+ validationErrorMessage?: string | {
281
+ path: string;
282
+ } | {
283
+ call: string;
284
+ args: Record<string, any>;
285
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
286
+ } | undefined;
287
+ }>;
288
+ };
289
+ export declare const GlchatTagInputComponent: import("@a2ui/react/v0_9").ReactComponentImplementation;
290
+ //# sourceMappingURL=TagInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TagInput.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/TagInput/TagInput.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAqBxB;;;GAGG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BA4LssN,CAAC;;;;;;;;;;;;;;;;;;;0BAAivB,CAAC;;;;;;;;;;;;;;;;;;;;;;;0BAA2sB,CAAC;;;;;;;0BAA0O,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAA5O,CAAC;;;;;;;0BAA0O,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;CAvJv4Q,CAAC;AAWF,eAAO,MAAM,uBAAuB,yDA2IlC,CAAC"}
@@ -0,0 +1,110 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { createComponentImplementation } from '@a2ui/react/v0_9';
4
+ import { DynamicBooleanSchema, DynamicStringListSchema, DynamicStringSchema, } from '@a2ui/web_core/v0_9';
5
+ import { X } from 'lucide-react';
6
+ import { useCallback, useEffect, useId, useMemo, useState } from 'react';
7
+ import { z } from 'zod';
8
+ import { multiSelectBadgeStyles } from '../../ui/MultiSelect/theme.js';
9
+ import { CommonProps, describeDynamic, getWeightStyle } from '../common.js';
10
+ import { a2uiContainerStyles, containerStyles, errorStyles, fieldStyles, innerBorderlessStyles, innerInvalidStyles, innerStyles, inputStyles, labelStyles, removeIconStyles, tagTextStyles, } from './theme.js';
11
+ const TAG_INPUT_PLACEHOLDER = 'Enter a value';
12
+ const TAG_INPUT_VALIDATION_ERROR = 'Please enter a valid value.';
13
+ /**
14
+ * Tag input field for adding and removing string tags (GLChat extension).
15
+ * Binds the selected tags to a string array in the data model via `value`.
16
+ */
17
+ export const TagInputApi = {
18
+ name: 'TagInput',
19
+ schema: z
20
+ .object({
21
+ ...CommonProps,
22
+ label: describeDynamic(DynamicStringSchema, 'DynamicString', 'The text label for the field.').optional(),
23
+ value: describeDynamic(DynamicStringListSchema, 'DynamicStringList', 'The list of current tags. Should be bound to a string array in the data model.'),
24
+ placeholder: describeDynamic(DynamicStringSchema, 'DynamicString', 'Placeholder text shown when there are no tags.').optional(),
25
+ disabled: describeDynamic(DynamicBooleanSchema, 'DynamicBoolean', 'If true, the input is disabled.').optional(),
26
+ disableTextInput: z
27
+ .boolean()
28
+ .describe('If true, hides the text input and only displays existing tags.')
29
+ .optional(),
30
+ validationRegexp: z
31
+ .string()
32
+ .describe('A regular expression used to validate each tag before it is added.')
33
+ .optional(),
34
+ validationErrorMessage: describeDynamic(DynamicStringSchema, 'DynamicString', 'The error message shown when a tag fails validation.').optional(),
35
+ })
36
+ .strict()
37
+ .describe('A tag input field for adding and removing string tags.'),
38
+ };
39
+ function isValidTag(value, validationRegexp) {
40
+ if (!validationRegexp)
41
+ return true;
42
+ try {
43
+ return new RegExp(validationRegexp).test(value);
44
+ }
45
+ catch {
46
+ return false;
47
+ }
48
+ }
49
+ export const GlchatTagInputComponent = createComponentImplementation(TagInputApi, ({ props }) => {
50
+ const errorMessageId = useId();
51
+ const externalValues = useMemo(() => (Array.isArray(props.value) ? props.value : []), [props.value]);
52
+ const [tags, setTags] = useState(externalValues);
53
+ const [inputValue, setInputValue] = useState('');
54
+ const [validationError, setValidationError] = useState(false);
55
+ useEffect(() => {
56
+ setTags(externalValues);
57
+ }, [externalValues]);
58
+ const label = typeof props.label === 'string' ? props.label : '';
59
+ const placeholder = (typeof props.placeholder === 'string' ? props.placeholder : '') || TAG_INPUT_PLACEHOLDER;
60
+ const disabled = props.disabled === true;
61
+ const disableTextInput = props.disableTextInput === true;
62
+ const validationRegexp = typeof props.validationRegexp === 'string' ? props.validationRegexp : undefined;
63
+ const validationErrorMessage = (typeof props.validationErrorMessage === 'string' ? props.validationErrorMessage : '') ||
64
+ TAG_INPUT_VALIDATION_ERROR;
65
+ const updateTags = useCallback((nextTags) => {
66
+ setTags(nextTags);
67
+ props.setValue(nextTags);
68
+ }, [props]);
69
+ const addTag = useCallback(() => {
70
+ if (disabled || disableTextInput)
71
+ return;
72
+ const trimmed = inputValue.trim();
73
+ if (!trimmed || tags.includes(trimmed))
74
+ return;
75
+ if (!isValidTag(trimmed, validationRegexp)) {
76
+ setValidationError(true);
77
+ return;
78
+ }
79
+ updateTags([...tags, trimmed]);
80
+ setInputValue('');
81
+ setValidationError(false);
82
+ }, [disabled, disableTextInput, inputValue, tags, updateTags, validationRegexp]);
83
+ const handleInputKeyDown = useCallback((event) => {
84
+ if (disabled || disableTextInput)
85
+ return;
86
+ if (event.key === 'Enter') {
87
+ event.preventDefault();
88
+ addTag();
89
+ return;
90
+ }
91
+ if (event.key === 'Backspace' && !event.currentTarget.value) {
92
+ updateTags(tags.slice(0, -1));
93
+ }
94
+ }, [addTag, disabled, disableTextInput, tags, updateTags]);
95
+ const removeTag = useCallback((tagToRemove) => {
96
+ if (disabled)
97
+ return;
98
+ updateTags(tags.filter((tag) => tag !== tagToRemove));
99
+ setInputValue('');
100
+ }, [disabled, tags, updateTags]);
101
+ return (_jsx("div", { className: "a2ui-tag-input", style: getWeightStyle(props.weight), children: _jsxs("div", { style: a2uiContainerStyles, children: [label ? _jsx("label", { style: labelStyles, children: label }) : null, _jsxs("div", { className: "glchat-a2ui-tag-input", style: fieldStyles, children: [_jsx("div", { style: containerStyles, children: _jsxs("div", { style: {
102
+ ...innerStyles,
103
+ ...(disableTextInput ? innerBorderlessStyles : undefined),
104
+ ...(validationError ? innerInvalidStyles : undefined),
105
+ }, children: [tags.map((tag) => (_jsxs("div", { style: multiSelectBadgeStyles, children: [_jsx("p", { style: tagTextStyles, children: tag }), !disabled && (_jsx(X, { style: { ...removeIconStyles, cursor: 'pointer' }, strokeWidth: 1.5, onClick: () => removeTag(tag), "aria-hidden": true }))] }, tag))), !disableTextInput && (_jsx("input", { type: "text", className: "glchat-a2ui-tag-input-field", style: inputStyles, placeholder: tags.length === 0 ? placeholder : '', value: inputValue, onChange: (event) => {
106
+ setInputValue(event.target.value);
107
+ if (validationError)
108
+ setValidationError(false);
109
+ }, "aria-invalid": validationError || undefined, "aria-describedby": validationError && validationRegexp ? errorMessageId : undefined, onKeyDown: handleInputKeyDown, onBlur: addTag, disabled: disabled }))] }) }), validationError && validationRegexp ? (_jsx("p", { id: errorMessageId, className: "glchat-a2ui-tag-input-error", style: errorStyles, role: "alert", children: validationErrorMessage })) : null] })] }) }));
110
+ });
@@ -0,0 +1,13 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const a2uiContainerStyles: CSSProperties;
3
+ export declare const labelStyles: CSSProperties;
4
+ export declare const containerStyles: CSSProperties;
5
+ export declare const innerStyles: CSSProperties;
6
+ export declare const innerBorderlessStyles: CSSProperties;
7
+ export declare const innerInvalidStyles: CSSProperties;
8
+ export declare const tagTextStyles: CSSProperties;
9
+ export declare const inputStyles: CSSProperties;
10
+ export declare const removeIconStyles: CSSProperties;
11
+ export declare const fieldStyles: CSSProperties;
12
+ export declare const errorStyles: CSSProperties;
13
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/TagInput/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,mBAAmB,EAAE,aAKjC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAIzB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,aAG7B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAWzB,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,aAEnC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,aAEhC,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,aAS3B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAWzB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,aAM9B,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAKzB,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,aAKzB,CAAC"}
@@ -0,0 +1,74 @@
1
+ export const a2uiContainerStyles = {
2
+ display: 'flex',
3
+ flexDirection: 'column',
4
+ gap: '0.5rem',
5
+ width: '100%',
6
+ };
7
+ export const labelStyles = {
8
+ fontSize: '0.875rem',
9
+ fontWeight: 600,
10
+ color: 'hsl(var(--card-foreground))',
11
+ };
12
+ export const containerStyles = {
13
+ position: 'relative',
14
+ width: '100%',
15
+ };
16
+ export const innerStyles = {
17
+ display: 'flex',
18
+ flexWrap: 'wrap',
19
+ gap: '0.25rem',
20
+ borderRadius: 'var(--radius-md)',
21
+ borderWidth: '1px',
22
+ borderStyle: 'solid',
23
+ borderColor: 'hsl(var(--border))',
24
+ backgroundColor: 'hsl(var(--background))',
25
+ padding: '0.5rem',
26
+ boxSizing: 'border-box',
27
+ };
28
+ export const innerBorderlessStyles = {
29
+ borderWidth: 0,
30
+ };
31
+ export const innerInvalidStyles = {
32
+ borderColor: 'hsl(var(--destructive))',
33
+ };
34
+ export const tagTextStyles = {
35
+ flexGrow: 1,
36
+ overflow: 'hidden',
37
+ textOverflow: 'ellipsis',
38
+ whiteSpace: 'nowrap',
39
+ textAlign: 'left',
40
+ fontSize: '0.875rem',
41
+ fontWeight: 400,
42
+ margin: 0,
43
+ };
44
+ export const inputStyles = {
45
+ minWidth: '120px',
46
+ flex: 1,
47
+ backgroundColor: 'transparent',
48
+ fontSize: '0.875rem',
49
+ color: 'hsl(var(--foreground))',
50
+ border: 'none',
51
+ outline: 'none',
52
+ padding: 0,
53
+ fontFamily: 'inherit',
54
+ lineHeight: '1.5',
55
+ };
56
+ export const removeIconStyles = {
57
+ height: '0.75rem',
58
+ width: '0.75rem',
59
+ flexShrink: 0,
60
+ cursor: 'pointer',
61
+ marginLeft: '0.5rem',
62
+ };
63
+ export const fieldStyles = {
64
+ display: 'flex',
65
+ flexDirection: 'column',
66
+ gap: '0.25rem',
67
+ width: '100%',
68
+ };
69
+ export const errorStyles = {
70
+ margin: 0,
71
+ fontSize: '0.75rem',
72
+ lineHeight: '1.25rem',
73
+ color: 'hsl(var(--destructive))',
74
+ };
@@ -1,4 +1,155 @@
1
- import { type A2UIComponentProps } from '@a2ui/react';
2
- import type { CustomNode } from '@a2ui/web_core/types/types';
3
- export declare function CustomTimeoutComponent({ node, surfaceId, }: Readonly<A2UIComponentProps<CustomNode>>): import("react/jsx-runtime").JSX.Element;
1
+ import { z } from 'zod';
2
+ /**
3
+ * Countdown to a target UTC time (GLChat extension). Displays the remaining
4
+ * time as HH:MM:SS, updating every second.
5
+ */
6
+ export declare const TimeoutApi: {
7
+ name: string;
8
+ schema: z.ZodObject<{
9
+ targetTimeUtc: z.ZodUnion<[z.ZodString, z.ZodObject<{
10
+ path: z.ZodString;
11
+ }, "strip", z.ZodTypeAny, {
12
+ path: string;
13
+ }, {
14
+ path: string;
15
+ }>, z.ZodObject<{
16
+ call: z.ZodString;
17
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
18
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ call: string;
21
+ args: Record<string, any>;
22
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
23
+ }, {
24
+ call: string;
25
+ args: Record<string, any>;
26
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
27
+ }>]>;
28
+ variant: z.ZodOptional<z.ZodEnum<["body", "caption", "h3", "h4", "h5"]>>;
29
+ accessibility: z.ZodOptional<z.ZodObject<{
30
+ label: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
31
+ path: z.ZodString;
32
+ }, "strip", z.ZodTypeAny, {
33
+ path: string;
34
+ }, {
35
+ path: string;
36
+ }>, z.ZodObject<{
37
+ call: z.ZodString;
38
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
39
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ call: string;
42
+ args: Record<string, any>;
43
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
44
+ }, {
45
+ call: string;
46
+ args: Record<string, any>;
47
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
48
+ }>]>>;
49
+ description: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodObject<{
50
+ path: z.ZodString;
51
+ }, "strip", z.ZodTypeAny, {
52
+ path: string;
53
+ }, {
54
+ path: string;
55
+ }>, z.ZodObject<{
56
+ call: z.ZodString;
57
+ args: z.ZodRecord<z.ZodString, z.ZodAny>;
58
+ returnType: z.ZodDefault<z.ZodEnum<["string", "number", "boolean", "array", "object", "any", "void"]>>;
59
+ }, "strip", z.ZodTypeAny, {
60
+ call: string;
61
+ args: Record<string, any>;
62
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
63
+ }, {
64
+ call: string;
65
+ args: Record<string, any>;
66
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
67
+ }>]>>;
68
+ }, "strip", z.ZodTypeAny, {
69
+ description?: string | {
70
+ path: string;
71
+ } | {
72
+ call: string;
73
+ args: Record<string, any>;
74
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
75
+ } | undefined;
76
+ label?: string | {
77
+ path: string;
78
+ } | {
79
+ call: string;
80
+ args: Record<string, any>;
81
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
82
+ } | undefined;
83
+ }, {
84
+ description?: string | {
85
+ path: string;
86
+ } | {
87
+ call: string;
88
+ args: Record<string, any>;
89
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
90
+ } | undefined;
91
+ label?: string | {
92
+ path: string;
93
+ } | {
94
+ call: string;
95
+ args: Record<string, any>;
96
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
97
+ } | undefined;
98
+ }>>;
99
+ weight: z.ZodOptional<z.ZodNumber>;
100
+ }, "strict", z.ZodTypeAny, {
101
+ targetTimeUtc: string | {
102
+ path: string;
103
+ } | {
104
+ call: string;
105
+ args: Record<string, any>;
106
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
107
+ };
108
+ weight?: number | undefined;
109
+ variant?: "caption" | "h3" | "body" | "h4" | "h5" | undefined;
110
+ accessibility?: {
111
+ description?: string | {
112
+ path: string;
113
+ } | {
114
+ call: string;
115
+ args: Record<string, any>;
116
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
117
+ } | undefined;
118
+ label?: string | {
119
+ path: string;
120
+ } | {
121
+ call: string;
122
+ args: Record<string, any>;
123
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
124
+ } | undefined;
125
+ } | undefined;
126
+ }, {
127
+ targetTimeUtc: string | {
128
+ path: string;
129
+ } | {
130
+ call: string;
131
+ args: Record<string, any>;
132
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
133
+ };
134
+ weight?: number | undefined;
135
+ variant?: "caption" | "h3" | "body" | "h4" | "h5" | undefined;
136
+ accessibility?: {
137
+ description?: string | {
138
+ path: string;
139
+ } | {
140
+ call: string;
141
+ args: Record<string, any>;
142
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
143
+ } | undefined;
144
+ label?: string | {
145
+ path: string;
146
+ } | {
147
+ call: string;
148
+ args: Record<string, any>;
149
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
150
+ } | undefined;
151
+ } | undefined;
152
+ }>;
153
+ };
154
+ export declare const GlchatTimeoutComponent: import("@a2ui/react/v0_9").ReactComponentImplementation;
4
155
  //# sourceMappingURL=Timeout.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Timeout.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/Timeout/Timeout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,kBAAkB,EAExB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAM7D,wBAAgB,sBAAsB,CAAC,EACrC,IAAI,EACJ,SAAS,GACV,EAAE,QAAQ,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,2CAwC1C"}
1
+ {"version":3,"file":"Timeout.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/Timeout/Timeout.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAgDy1X,CAAC;;;;;;;;;;;;;;;;;;;0BAAivB,CAAC;;;;;;;;;;;;;;;;;;;;;;;0BAA2sB,CAAC;;;;;;;0BAA0O,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;0BAA5O,CAAC;;;;;;;0BAA0O,CAAC;;;;CA/Bzhb,CAAC;AAQF,eAAO,MAAM,sBAAsB,yDAsBjC,CAAC"}