glchat-a2ui-react-renderer 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +88 -6
- package/dist/src/Provider.d.ts +4 -3
- package/dist/src/Provider.d.ts.map +1 -1
- package/dist/src/Provider.js +1 -6
- package/dist/src/components/a2ui/Button/Button.d.ts.map +1 -1
- package/dist/src/components/a2ui/Button/Button.js +6 -14
- package/dist/src/components/a2ui/Button/theme.d.ts +3 -12
- package/dist/src/components/a2ui/Button/theme.d.ts.map +1 -1
- package/dist/src/components/a2ui/Button/theme.js +4 -58
- package/dist/src/components/a2ui/ButtonAsLink/ButtonAsLink.d.ts +4 -0
- package/dist/src/components/a2ui/ButtonAsLink/ButtonAsLink.d.ts.map +1 -0
- package/dist/src/components/a2ui/ButtonAsLink/ButtonAsLink.js +42 -0
- package/dist/src/components/a2ui/ButtonAsLink/theme.d.ts +8 -0
- package/dist/src/components/a2ui/ButtonAsLink/theme.d.ts.map +1 -0
- package/dist/src/components/a2ui/ButtonAsLink/theme.js +8 -0
- package/dist/src/components/a2ui/Card/theme.d.ts +2 -8
- package/dist/src/components/a2ui/Card/theme.d.ts.map +1 -1
- package/dist/src/components/a2ui/Card/theme.js +2 -8
- package/dist/src/components/a2ui/CheckBox/theme.d.ts +2 -9
- package/dist/src/components/a2ui/CheckBox/theme.d.ts.map +1 -1
- package/dist/src/components/a2ui/CheckBox/theme.js +2 -8
- package/dist/src/components/a2ui/DateTimeInput/theme.d.ts +2 -2
- package/dist/src/components/a2ui/DateTimeInput/theme.d.ts.map +1 -1
- package/dist/src/components/a2ui/DateTimeInput/theme.js +3 -3
- package/dist/src/components/a2ui/DestructiveButton/DestructiveButton.d.ts +4 -0
- package/dist/src/components/a2ui/DestructiveButton/DestructiveButton.d.ts.map +1 -0
- package/dist/src/components/a2ui/DestructiveButton/DestructiveButton.js +22 -0
- package/dist/src/components/a2ui/DestructiveButton/theme.d.ts +8 -0
- package/dist/src/components/a2ui/DestructiveButton/theme.d.ts.map +1 -0
- package/dist/src/components/a2ui/DestructiveButton/theme.js +8 -0
- package/dist/src/components/a2ui/MultipleChoice/CheckboxList.js +5 -5
- package/dist/src/components/a2ui/MultipleChoice/MultipleChoice.js +5 -5
- package/dist/src/components/a2ui/MultipleChoice/theme.d.ts +4 -4
- package/dist/src/components/a2ui/MultipleChoice/theme.d.ts.map +1 -1
- package/dist/src/components/a2ui/MultipleChoice/theme.js +4 -4
- package/dist/src/components/a2ui/TagInput/TagInput.d.ts +4 -0
- package/dist/src/components/a2ui/TagInput/TagInput.d.ts.map +1 -0
- package/dist/src/components/a2ui/TagInput/TagInput.js +120 -0
- package/dist/src/components/a2ui/TagInput/theme.d.ts +22 -0
- package/dist/src/components/a2ui/TagInput/theme.d.ts.map +1 -0
- package/dist/src/components/a2ui/TagInput/theme.js +82 -0
- package/dist/src/components/a2ui/TextField/theme.d.ts +2 -26
- package/dist/src/components/a2ui/TextField/theme.d.ts.map +1 -1
- package/dist/src/components/a2ui/TextField/theme.js +6 -79
- package/dist/src/components/a2ui/types.d.ts +12 -0
- package/dist/src/components/a2ui/types.d.ts.map +1 -0
- package/dist/src/components/a2ui/types.js +1 -0
- package/dist/src/components/ui/Button/Button.d.ts +15 -0
- package/dist/src/components/ui/Button/Button.d.ts.map +1 -0
- package/dist/src/components/ui/Button/Button.js +16 -0
- package/dist/src/components/ui/Button/ButtonAsLink.d.ts +15 -0
- package/dist/src/components/ui/Button/ButtonAsLink.d.ts.map +1 -0
- package/dist/src/components/ui/Button/ButtonAsLink.js +17 -0
- package/dist/src/components/ui/Button/theme.d.ts +5 -0
- package/dist/src/components/ui/Button/theme.d.ts.map +1 -0
- package/dist/src/components/ui/Button/theme.js +51 -0
- package/dist/src/components/ui/Checkbox/Checkbox.js +2 -2
- package/dist/src/components/ui/Checkbox/theme.d.ts +3 -3
- package/dist/src/components/ui/Checkbox/theme.d.ts.map +1 -1
- package/dist/src/components/ui/Checkbox/theme.js +3 -3
- package/dist/src/components/ui/MultiSelect/MultiSelect.js +12 -12
- package/dist/src/components/ui/MultiSelect/theme.d.ts +12 -12
- package/dist/src/components/ui/MultiSelect/theme.d.ts.map +1 -1
- package/dist/src/components/ui/MultiSelect/theme.js +13 -13
- package/dist/src/components/ui/Select/Select.js +8 -8
- package/dist/src/components/ui/Select/theme.d.ts +8 -8
- package/dist/src/components/ui/Select/theme.d.ts.map +1 -1
- package/dist/src/components/ui/Select/theme.js +8 -8
- package/dist/src/components/ui/TextField/theme.d.ts +4 -0
- package/dist/src/components/ui/TextField/theme.d.ts.map +1 -0
- package/dist/src/components/ui/TextField/theme.js +22 -0
- package/dist/src/utils/catalog.d.ts +1 -1
- package/dist/src/utils/catalog.d.ts.map +1 -1
- package/dist/src/utils/catalog.js +7 -11
- package/dist/src/utils/href.d.ts +11 -0
- package/dist/src/utils/href.d.ts.map +1 -0
- package/dist/src/utils/href.js +34 -0
- package/dist/src/utils/theme.d.ts +11 -0
- package/dist/src/utils/theme.d.ts.map +1 -1
- package/dist/src/utils/theme.js +80 -79
- package/json/README.md +74 -0
- package/json/a2ui-sample-messages.json +338 -0
- package/json/glchat_server_to_client_with_catalog.json +1000 -0
- package/json/glchat_standard_catalog_definition.json +844 -0
- package/package.json +6 -3
- package/styles/globals.css +135 -17
- package/dist/src/components/a2ui/Card/Card.d.ts +0 -4
- package/dist/src/components/a2ui/Card/Card.d.ts.map +0 -1
- package/dist/src/components/a2ui/Card/Card.js +0 -16
- package/dist/src/components/a2ui/CheckBox/CheckBox.d.ts +0 -4
- package/dist/src/components/a2ui/CheckBox/CheckBox.d.ts.map +0 -1
- package/dist/src/components/a2ui/CheckBox/CheckBox.js +0 -26
- package/dist/src/components/a2ui/TextField/TextField.d.ts +0 -4
- package/dist/src/components/a2ui/TextField/TextField.d.ts.map +0 -1
- package/dist/src/components/a2ui/TextField/TextField.js +0 -54
- 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.
|
|
3
|
+
"version": "0.2.7",
|
|
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,10 @@
|
|
|
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/glchat_server_to_client_with_catalog.json": "./json/glchat_server_to_client_with_catalog.json",
|
|
30
|
+
"./json/a2ui-sample-messages.json": "./json/a2ui-sample-messages.json"
|
|
28
31
|
},
|
|
29
32
|
"sideEffects": [
|
|
30
33
|
"**/*.css"
|
|
@@ -35,7 +38,7 @@
|
|
|
35
38
|
"LICENSE",
|
|
36
39
|
"tailwind.config.cjs",
|
|
37
40
|
"styles",
|
|
38
|
-
"
|
|
41
|
+
"json"
|
|
39
42
|
],
|
|
40
43
|
"scripts": {
|
|
41
44
|
"build": "npm run build:ts",
|
package/styles/globals.css
CHANGED
|
@@ -105,66 +105,155 @@
|
|
|
105
105
|
}
|
|
106
106
|
|
|
107
107
|
/* Button */
|
|
108
|
-
.a2ui-surface .a2ui-button > button.glchat-a2ui-button
|
|
108
|
+
.a2ui-surface .a2ui-button > button.glchat-a2ui-button,
|
|
109
|
+
.a2ui-surface .a2ui-button > button {
|
|
109
110
|
font-weight: 600 !important;
|
|
110
111
|
}
|
|
111
112
|
|
|
112
113
|
.a2ui-surface .a2ui-button > button.glchat-a2ui-button .a2ui-text p,
|
|
113
|
-
.a2ui-surface .a2ui-button > button.glchat-a2ui-button p
|
|
114
|
+
.a2ui-surface .a2ui-button > button.glchat-a2ui-button p,
|
|
115
|
+
.a2ui-surface .a2ui-button > button .a2ui-text p,
|
|
116
|
+
.a2ui-surface .a2ui-button > button p {
|
|
114
117
|
font-weight: 600 !important;
|
|
115
118
|
}
|
|
116
119
|
|
|
117
|
-
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:hover
|
|
120
|
+
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:hover,
|
|
121
|
+
.a2ui-surface .a2ui-button > button:hover {
|
|
118
122
|
background-image: var(--glchat-button-bg-hover) !important;
|
|
119
123
|
border-color: var(--glchat-button-border-hover) !important;
|
|
120
124
|
}
|
|
121
125
|
|
|
122
126
|
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:focus,
|
|
123
|
-
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:focus-visible
|
|
127
|
+
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:focus-visible,
|
|
128
|
+
.a2ui-surface .a2ui-button > button:focus,
|
|
129
|
+
.a2ui-surface .a2ui-button > button:focus-visible {
|
|
124
130
|
outline: none !important;
|
|
125
131
|
background-image: var(--glchat-button-bg-hover) !important;
|
|
126
132
|
box-shadow: 0 0 0 2px var(--glchat-button-ring-color) !important;
|
|
127
133
|
}
|
|
128
134
|
|
|
129
|
-
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:active
|
|
135
|
+
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:active,
|
|
136
|
+
.a2ui-surface .a2ui-button > button:active {
|
|
130
137
|
background-image: var(--glchat-button-bg-active) !important;
|
|
131
138
|
border-color: var(--glchat-button-border-active) !important;
|
|
132
139
|
outline: none !important;
|
|
133
140
|
box-shadow: 0 0 0 2px var(--glchat-button-ring-color) !important;
|
|
134
141
|
}
|
|
135
142
|
|
|
136
|
-
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:disabled
|
|
143
|
+
.a2ui-surface .a2ui-button > button.glchat-a2ui-button:disabled,
|
|
144
|
+
.a2ui-surface .a2ui-button > button:disabled {
|
|
137
145
|
opacity: 0.5 !important;
|
|
138
146
|
cursor: default !important;
|
|
139
147
|
pointer-events: none !important;
|
|
140
148
|
}
|
|
141
149
|
|
|
150
|
+
/* ButtonAsLink */
|
|
151
|
+
.a2ui-surface .a2ui-button-as-link > a.glchat-a2ui-button,
|
|
152
|
+
.a2ui-surface .a2ui-button-as-link > a {
|
|
153
|
+
font-weight: 600 !important;
|
|
154
|
+
text-decoration: none !important;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
.a2ui-surface .a2ui-button-as-link > a.glchat-a2ui-button .a2ui-text p,
|
|
158
|
+
.a2ui-surface .a2ui-button-as-link > a.glchat-a2ui-button p,
|
|
159
|
+
.a2ui-surface .a2ui-button-as-link > a .a2ui-text p,
|
|
160
|
+
.a2ui-surface .a2ui-button-as-link > a p {
|
|
161
|
+
font-weight: 600 !important;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.a2ui-surface .a2ui-button-as-link > a.glchat-a2ui-button:hover,
|
|
165
|
+
.a2ui-surface .a2ui-button-as-link > a:hover {
|
|
166
|
+
background-image: var(--glchat-button-bg-hover) !important;
|
|
167
|
+
border-color: var(--glchat-button-border-hover) !important;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
.a2ui-surface .a2ui-button-as-link > a.glchat-a2ui-button:focus,
|
|
171
|
+
.a2ui-surface .a2ui-button-as-link > a.glchat-a2ui-button:focus-visible,
|
|
172
|
+
.a2ui-surface .a2ui-button-as-link > a:focus,
|
|
173
|
+
.a2ui-surface .a2ui-button-as-link > a:focus-visible {
|
|
174
|
+
outline: none !important;
|
|
175
|
+
background-image: var(--glchat-button-bg-hover) !important;
|
|
176
|
+
box-shadow: 0 0 0 2px var(--glchat-button-ring-color) !important;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
.a2ui-surface .a2ui-button-as-link > a.glchat-a2ui-button:active,
|
|
180
|
+
.a2ui-surface .a2ui-button-as-link > a:active {
|
|
181
|
+
background-image: var(--glchat-button-bg-active) !important;
|
|
182
|
+
border-color: var(--glchat-button-border-active) !important;
|
|
183
|
+
outline: none !important;
|
|
184
|
+
box-shadow: 0 0 0 2px var(--glchat-button-ring-color) !important;
|
|
185
|
+
}
|
|
186
|
+
|
|
142
187
|
/* TextField */
|
|
143
|
-
.a2ui-surface .a2ui-
|
|
144
|
-
|
|
188
|
+
.a2ui-surface .a2ui-textfield > section {
|
|
189
|
+
display: flex;
|
|
190
|
+
flex-direction: column;
|
|
191
|
+
gap: 0.5rem;
|
|
192
|
+
width: 100%;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
.a2ui-surface .a2ui-textfield label {
|
|
196
|
+
font-size: 0.875rem;
|
|
197
|
+
font-weight: 600;
|
|
198
|
+
color: hsl(var(--card-foreground));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.a2ui-surface .a2ui-textfield textarea.glchat-a2ui-text-field {
|
|
202
|
+
min-height: 80px;
|
|
203
|
+
height: auto;
|
|
204
|
+
overflow-y: auto;
|
|
205
|
+
white-space: pre-wrap;
|
|
206
|
+
overflow-wrap: break-word;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
.a2ui-surface .a2ui-textfield input.glchat-a2ui-text-field,
|
|
210
|
+
.a2ui-surface .a2ui-textfield textarea.glchat-a2ui-text-field {
|
|
145
211
|
font-family: inherit !important;
|
|
146
212
|
line-height: 1.5 !important;
|
|
147
213
|
}
|
|
148
214
|
|
|
149
|
-
.a2ui-surface .a2ui-
|
|
150
|
-
.a2ui-surface .a2ui-
|
|
151
|
-
.a2ui-surface .a2ui-
|
|
152
|
-
.a2ui-surface .a2ui-
|
|
215
|
+
.a2ui-surface .a2ui-textfield input.glchat-a2ui-text-field:focus,
|
|
216
|
+
.a2ui-surface .a2ui-textfield input.glchat-a2ui-text-field:focus-visible,
|
|
217
|
+
.a2ui-surface .a2ui-textfield textarea.glchat-a2ui-text-field:focus,
|
|
218
|
+
.a2ui-surface .a2ui-textfield textarea.glchat-a2ui-text-field:focus-visible {
|
|
153
219
|
border-color: hsl(var(--primary)) !important;
|
|
154
220
|
outline: none !important;
|
|
155
221
|
}
|
|
156
222
|
|
|
157
|
-
.a2ui-surface .a2ui-
|
|
158
|
-
.a2ui-surface .a2ui-
|
|
223
|
+
.a2ui-surface .a2ui-textfield input.glchat-a2ui-text-field:disabled,
|
|
224
|
+
.a2ui-surface .a2ui-textfield textarea.glchat-a2ui-text-field:disabled {
|
|
159
225
|
cursor: not-allowed !important;
|
|
160
226
|
opacity: 0.5 !important;
|
|
161
227
|
}
|
|
162
228
|
|
|
163
|
-
.a2ui-surface .a2ui-
|
|
164
|
-
.a2ui-surface .a2ui-
|
|
229
|
+
.a2ui-surface .a2ui-textfield input.glchat-a2ui-text-field::placeholder,
|
|
230
|
+
.a2ui-surface .a2ui-textfield textarea.glchat-a2ui-text-field::placeholder {
|
|
165
231
|
color: hsl(var(--foreground) / 0.5);
|
|
166
232
|
}
|
|
167
233
|
|
|
234
|
+
/* TagInput */
|
|
235
|
+
.a2ui-surface .a2ui-tag-input input.glchat-a2ui-tag-input-field {
|
|
236
|
+
font-family: inherit !important;
|
|
237
|
+
line-height: 1.5 !important;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
.a2ui-surface .a2ui-tag-input .glchat-a2ui-tag-input:focus-within > div {
|
|
241
|
+
border-color: hsl(var(--primary)) !important;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.a2ui-surface .a2ui-tag-input input.glchat-a2ui-tag-input-field:disabled {
|
|
245
|
+
cursor: not-allowed !important;
|
|
246
|
+
opacity: 0.5 !important;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.a2ui-surface .a2ui-tag-input input.glchat-a2ui-tag-input-field::placeholder {
|
|
250
|
+
color: hsl(var(--foreground) / 0.5);
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
.a2ui-surface .a2ui-tag-input .glchat-a2ui-tag-input-error {
|
|
254
|
+
color: hsl(var(--destructive)) !important;
|
|
255
|
+
}
|
|
256
|
+
|
|
168
257
|
/* DateTimeInput (stock @a2ui/react — theme additionalStyles + globals) */
|
|
169
258
|
.a2ui-surface .a2ui-datetime-input > section {
|
|
170
259
|
display: flex;
|
|
@@ -240,7 +329,36 @@
|
|
|
240
329
|
outline: none !important;
|
|
241
330
|
}
|
|
242
331
|
|
|
243
|
-
/*
|
|
332
|
+
/* CheckBox — stock A2UI CheckBox (native input) */
|
|
333
|
+
.a2ui-surface .a2ui-checkbox input[type='checkbox'] {
|
|
334
|
+
height: 1rem;
|
|
335
|
+
width: 1rem;
|
|
336
|
+
flex-shrink: 0;
|
|
337
|
+
margin: 0;
|
|
338
|
+
border-radius: var(--radius-sm);
|
|
339
|
+
border: 1px solid hsl(var(--primary));
|
|
340
|
+
background-color: hsl(var(--background));
|
|
341
|
+
accent-color: hsl(var(--primary));
|
|
342
|
+
cursor: pointer;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
.a2ui-surface .a2ui-checkbox input[type='checkbox']:focus-visible {
|
|
346
|
+
outline: none !important;
|
|
347
|
+
box-shadow: 0 0 0 2px hsl(var(--ring)) !important;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
.a2ui-surface .a2ui-checkbox input[type='checkbox']:disabled {
|
|
351
|
+
cursor: not-allowed !important;
|
|
352
|
+
opacity: 0.5 !important;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
.a2ui-surface .a2ui-checkbox label {
|
|
356
|
+
font-size: 0.875rem;
|
|
357
|
+
color: hsl(var(--foreground));
|
|
358
|
+
line-height: 1.25rem;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/* Checkbox (Radix) — MultipleChoice checkbox variant */
|
|
244
362
|
.a2ui-surface .a2ui-checkbox .glchat-a2ui-checkbox[data-state='checked'],
|
|
245
363
|
.a2ui-surface .glchat-a2ui-checkbox[data-state='checked'] {
|
|
246
364
|
background-color: hsl(var(--primary)) !important;
|
|
@@ -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,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,4 +0,0 @@
|
|
|
1
|
-
import { type A2UIComponentProps } from '@a2ui/react';
|
|
2
|
-
import type { TextFieldNode } from '@a2ui/web_core/types/types';
|
|
3
|
-
export declare function CustomTextFieldComponent({ node, surfaceId, }: Readonly<A2UIComponentProps<TextFieldNode>>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
-
//# sourceMappingURL=TextField.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../../../src/components/a2ui/TextField/TextField.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsC,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC1F,OAAO,KAAK,EAAe,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAgD7E,wBAAgB,wBAAwB,CAAC,EACvC,IAAI,EACJ,SAAS,GACV,EAAE,QAAQ,CAAC,kBAAkB,CAAC,aAAa,CAAC,CAAC,2CAuD7C"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { classMapToString, useA2UIComponent } from '@a2ui/react';
|
|
3
|
-
import { glchatTextFieldComponents, glchatTextFieldContainerStyles, glchatTextFieldInputStyles, glchatTextFieldLabelStyles, glchatTextFieldTextareaStyles, glchatTextFieldTextareaWrapperStyles, } from './theme.js';
|
|
4
|
-
const TEXT_FIELD_PLACEHOLDER = 'Please enter a value';
|
|
5
|
-
function dataModelValueToString(data) {
|
|
6
|
-
if (data == null)
|
|
7
|
-
return '';
|
|
8
|
-
if (typeof data === 'string')
|
|
9
|
-
return data;
|
|
10
|
-
if (typeof data === 'number' || typeof data === 'boolean')
|
|
11
|
-
return String(data);
|
|
12
|
-
return '';
|
|
13
|
-
}
|
|
14
|
-
function resolveStringBinding(value, resolveString, getValue) {
|
|
15
|
-
if (!value)
|
|
16
|
-
return '';
|
|
17
|
-
if (value.path) {
|
|
18
|
-
return dataModelValueToString(getValue(value.path));
|
|
19
|
-
}
|
|
20
|
-
return resolveString(value) ?? '';
|
|
21
|
-
}
|
|
22
|
-
function getInputType(textFieldType) {
|
|
23
|
-
switch (textFieldType) {
|
|
24
|
-
case 'number':
|
|
25
|
-
return 'number';
|
|
26
|
-
case 'date':
|
|
27
|
-
return 'date';
|
|
28
|
-
case 'obscured':
|
|
29
|
-
return 'password';
|
|
30
|
-
default:
|
|
31
|
-
return 'text';
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export function CustomTextFieldComponent({ node, surfaceId, }) {
|
|
35
|
-
const { theme, resolveString, setValue, getValue } = useA2UIComponent(node, surfaceId);
|
|
36
|
-
const { label, text, textFieldType } = node.properties;
|
|
37
|
-
const resolvedLabel = resolveStringBinding(label, resolveString, getValue);
|
|
38
|
-
const resolvedValue = resolveStringBinding(text, resolveString, getValue);
|
|
39
|
-
const hostStyle = node.weight === void 0 ? undefined : { '--weight': node.weight };
|
|
40
|
-
const textFieldTheme = theme.components.TextField ?? glchatTextFieldComponents;
|
|
41
|
-
const containerClass = classMapToString(textFieldTheme.container);
|
|
42
|
-
const labelClass = classMapToString(textFieldTheme.label);
|
|
43
|
-
const elementClass = classMapToString(textFieldTheme.element);
|
|
44
|
-
const isLongText = textFieldType === 'longText';
|
|
45
|
-
return (_jsx("div", { className: "a2ui-text-field", style: hostStyle, children: _jsxs("div", { className: containerClass, style: glchatTextFieldContainerStyles, children: [_jsx("label", { className: labelClass, style: glchatTextFieldLabelStyles, children: resolvedLabel }), isLongText ? (_jsx("div", { style: glchatTextFieldTextareaWrapperStyles, children: _jsx("textarea", { className: `glchat-a2ui-text-field ${elementClass}`.trim(), value: resolvedValue, placeholder: TEXT_FIELD_PLACEHOLDER, style: glchatTextFieldTextareaStyles, onChange: (e) => {
|
|
46
|
-
if (text?.path) {
|
|
47
|
-
setValue(text.path, e.target.value);
|
|
48
|
-
}
|
|
49
|
-
} }) })) : (_jsx("input", { className: `glchat-a2ui-text-field ${elementClass}`.trim(), type: getInputType(textFieldType), value: resolvedValue, placeholder: TEXT_FIELD_PLACEHOLDER, style: glchatTextFieldInputStyles, onChange: (e) => {
|
|
50
|
-
if (text?.path) {
|
|
51
|
-
setValue(text.path, e.target.value);
|
|
52
|
-
}
|
|
53
|
-
} }))] }) }));
|
|
54
|
-
}
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
diff --git a/node_modules/@a2ui/web_core/src/v0_8/schema/common-types.d.ts b/node_modules/@a2ui/web_core/src/v0_8/schema/common-types.d.ts
|
|
2
|
-
index 9c7381f..bdc89a0 100644
|
|
3
|
-
--- a/node_modules/@a2ui/web_core/src/v0_8/schema/common-types.d.ts
|
|
4
|
-
+++ b/node_modules/@a2ui/web_core/src/v0_8/schema/common-types.d.ts
|
|
5
|
-
@@ -596,6 +596,7 @@ export declare const ButtonSchema: z.ZodObject<{
|
|
6
|
-
}[] | undefined;
|
|
7
|
-
}>;
|
|
8
|
-
primary: z.ZodOptional<z.ZodBoolean>;
|
|
9
|
-
+ destructive: z.ZodOptional<z.ZodBoolean>;
|
|
10
|
-
}, "strip", z.ZodTypeAny, {
|
|
11
|
-
child: string;
|
|
12
|
-
action: {
|
|
13
|
-
@@ -611,6 +612,7 @@ export declare const ButtonSchema: z.ZodObject<{
|
|
14
|
-
}[] | undefined;
|
|
15
|
-
};
|
|
16
|
-
primary?: boolean | undefined;
|
|
17
|
-
+ destructive?: boolean | undefined;
|
|
18
|
-
}, {
|
|
19
|
-
child: string;
|
|
20
|
-
action: {
|
|
21
|
-
@@ -626,6 +628,7 @@ export declare const ButtonSchema: z.ZodObject<{
|
|
22
|
-
}[] | undefined;
|
|
23
|
-
};
|
|
24
|
-
primary?: boolean | undefined;
|
|
25
|
-
+ destructive?: boolean | undefined;
|
|
26
|
-
}>;
|
|
27
|
-
export declare const CheckboxSchema: z.ZodObject<{
|
|
28
|
-
label: z.ZodEffects<z.ZodObject<{
|
|
29
|
-
diff --git a/node_modules/@a2ui/web_core/src/v0_8/schema/common-types.js b/node_modules/@a2ui/web_core/src/v0_8/schema/common-types.js
|
|
30
|
-
index 2dd98d4..54ebcef 100644
|
|
31
|
-
--- a/node_modules/@a2ui/web_core/src/v0_8/schema/common-types.js
|
|
32
|
-
+++ b/node_modules/@a2ui/web_core/src/v0_8/schema/common-types.js
|
|
33
|
-
@@ -223,6 +223,10 @@ export const ButtonSchema = z.object({
|
|
34
|
-
.boolean()
|
|
35
|
-
.optional()
|
|
36
|
-
.describe('Indicates if this button should be styled as the primary action.'),
|
|
37
|
-
+ destructive: z
|
|
38
|
-
+ .boolean()
|
|
39
|
-
+ .optional()
|
|
40
|
-
+ .describe('Indicates if this button should be styled as a destructive action.'),
|
|
41
|
-
});
|
|
42
|
-
export const CheckboxSchema = z.object({
|
|
43
|
-
label: StringValueSchema,
|
|
44
|
-
diff --git a/node_modules/@a2ui/web_core/src/v0_8/types/types.d.ts b/node_modules/@a2ui/web_core/src/v0_8/types/types.d.ts
|
|
45
|
-
index d5df150..ca74153 100644
|
|
46
|
-
--- a/node_modules/@a2ui/web_core/src/v0_8/types/types.d.ts
|
|
47
|
-
+++ b/node_modules/@a2ui/web_core/src/v0_8/types/types.d.ts
|
|
48
|
-
@@ -376,6 +376,7 @@ export declare interface ResolvedButton {
|
|
49
|
-
child: AnyComponentNode;
|
|
50
|
-
action: Button['action'];
|
|
51
|
-
primary?: boolean;
|
|
52
|
-
+ destructive?: boolean;
|
|
53
|
-
}
|
|
54
|
-
export declare interface ResolvedList {
|
|
55
|
-
children: AnyComponentNode[];
|