@fragments-sdk/a2ui 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,47 @@
1
+ import { ComponentsMap, A2UIAdapterProps } from '@uiprotocol/a2ui/react';
2
+ import * as React from 'react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+
5
+ declare const fragmentsCatalog: ComponentsMap;
6
+
7
+ type IconComponent = React.ComponentType<Record<string, unknown>>;
8
+ declare function resolveA2UIcon(name: string): IconComponent | null;
9
+ declare const knownA2UIIcons: string[];
10
+
11
+ declare function A2UIText(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
12
+
13
+ declare function A2UIImage(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
14
+
15
+ declare function A2UIIcon(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
16
+
17
+ declare function A2UIVideo(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
18
+
19
+ declare function A2UIAudioPlayer(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
20
+
21
+ declare function A2UIRow(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
22
+
23
+ declare function A2UIColumn(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
24
+
25
+ declare function A2UIList(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
26
+
27
+ declare function A2UICard(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
28
+
29
+ declare function A2UITabs(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
30
+
31
+ declare function A2UIModal(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
32
+
33
+ declare function A2UIDivider(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
34
+
35
+ declare function A2UIButton(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
36
+
37
+ declare function A2UITextField(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
38
+
39
+ declare function A2UICheckBox(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
40
+
41
+ declare function A2UIChoicePicker(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
42
+
43
+ declare function A2UISlider(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
44
+
45
+ declare function A2UIDateTimeInput(props: A2UIAdapterProps): react_jsx_runtime.JSX.Element;
46
+
47
+ export { A2UIAudioPlayer, A2UIButton, A2UICard, A2UICheckBox, A2UIChoicePicker, A2UIColumn, A2UIDateTimeInput, A2UIDivider, A2UIIcon, A2UIImage, A2UIList, A2UIModal, A2UIRow, A2UISlider, A2UITabs, A2UIText, A2UITextField, A2UIVideo, fragmentsCatalog, knownA2UIIcons, resolveA2UIcon };
@@ -0,0 +1,47 @@
1
+ import "../chunk-QCZG5JX2.js";
2
+ import {
3
+ A2UIAudioPlayer,
4
+ A2UIButton,
5
+ A2UICard,
6
+ A2UICheckBox,
7
+ A2UIChoicePicker,
8
+ A2UIColumn,
9
+ A2UIDateTimeInput,
10
+ A2UIDivider,
11
+ A2UIIcon,
12
+ A2UIImage,
13
+ A2UIList,
14
+ A2UIModal,
15
+ A2UIRow,
16
+ A2UISlider,
17
+ A2UITabs,
18
+ A2UIText,
19
+ A2UITextField,
20
+ A2UIVideo,
21
+ fragmentsCatalog,
22
+ knownA2UIIcons,
23
+ resolveA2UIcon
24
+ } from "../chunk-C7JKECLH.js";
25
+ export {
26
+ A2UIAudioPlayer,
27
+ A2UIButton,
28
+ A2UICard,
29
+ A2UICheckBox,
30
+ A2UIChoicePicker,
31
+ A2UIColumn,
32
+ A2UIDateTimeInput,
33
+ A2UIDivider,
34
+ A2UIIcon,
35
+ A2UIImage,
36
+ A2UIList,
37
+ A2UIModal,
38
+ A2UIRow,
39
+ A2UISlider,
40
+ A2UITabs,
41
+ A2UIText,
42
+ A2UITextField,
43
+ A2UIVideo,
44
+ fragmentsCatalog,
45
+ knownA2UIIcons,
46
+ resolveA2UIcon
47
+ };
@@ -0,0 +1,917 @@
1
+ // src/catalog/adapters/_shared.ts
2
+ import { resolvePointerPath } from "@uiprotocol/a2ui/core";
3
+ function isRecord(value) {
4
+ return Boolean(value) && typeof value === "object" && !Array.isArray(value);
5
+ }
6
+ function isBoundValue(value) {
7
+ return isRecord(value) && typeof value.path === "string";
8
+ }
9
+ function getProp(component, keys) {
10
+ for (const key of keys) {
11
+ if (key in component) {
12
+ return component[key];
13
+ }
14
+ }
15
+ return void 0;
16
+ }
17
+ function resolveProp(props, keys, fallback) {
18
+ const raw = getProp(props.component, keys);
19
+ if (raw === void 0) {
20
+ return fallback;
21
+ }
22
+ return props.resolve(raw);
23
+ }
24
+ function resolveString(props, keys, fallback = "") {
25
+ const value = resolveProp(props, keys);
26
+ if (value === void 0 || value === null) {
27
+ return fallback;
28
+ }
29
+ if (typeof value === "object") {
30
+ return fallback;
31
+ }
32
+ return String(value);
33
+ }
34
+ function resolveNumber(props, keys, fallback = 0) {
35
+ const value = resolveProp(props, keys);
36
+ if (typeof value === "number" && Number.isFinite(value)) {
37
+ return value;
38
+ }
39
+ if (typeof value === "string") {
40
+ const parsed = Number(value);
41
+ if (!Number.isNaN(parsed) && Number.isFinite(parsed)) {
42
+ return parsed;
43
+ }
44
+ }
45
+ return fallback;
46
+ }
47
+ function resolveBoolean(props, keys, fallback = false) {
48
+ const value = resolveProp(props, keys);
49
+ if (typeof value === "boolean") {
50
+ return value;
51
+ }
52
+ return fallback;
53
+ }
54
+ function resolveArray(props, keys) {
55
+ const value = resolveProp(props, keys);
56
+ return Array.isArray(value) ? value : [];
57
+ }
58
+ function resolveBindingPath(props, keys = ["value", "path", "valuePath", "bindingPath", "bindPath"]) {
59
+ const isPathString = (value, key) => key.toLowerCase().includes("path") || value.startsWith("/") || value.startsWith("./") || value.startsWith("../");
60
+ for (const key of keys) {
61
+ const raw = props.component[key];
62
+ if (typeof raw === "string") {
63
+ if (isPathString(raw, key)) {
64
+ return resolvePointerPath(raw, props.scopePath);
65
+ }
66
+ continue;
67
+ }
68
+ if (isBoundValue(raw)) {
69
+ return resolvePointerPath(raw.path, props.scopePath);
70
+ }
71
+ }
72
+ return void 0;
73
+ }
74
+ function resolveAction(component, keys) {
75
+ for (const key of keys) {
76
+ const raw = component[key];
77
+ if (!raw) {
78
+ continue;
79
+ }
80
+ if (typeof raw === "string") {
81
+ return { event: raw };
82
+ }
83
+ if (isRecord(raw) && typeof raw.event === "string") {
84
+ return raw;
85
+ }
86
+ }
87
+ const actions = component.actions;
88
+ if (isRecord(actions)) {
89
+ for (const key of keys) {
90
+ const candidate = actions[key];
91
+ if (isRecord(candidate) && typeof candidate.event === "string") {
92
+ return candidate;
93
+ }
94
+ }
95
+ }
96
+ return void 0;
97
+ }
98
+ function dispatchAction(props, action, options) {
99
+ if (!action) {
100
+ return false;
101
+ }
102
+ return props.dispatchAction(action, {
103
+ componentId: props.component.id,
104
+ value: options?.value,
105
+ checks: options?.checks,
106
+ pattern: options?.pattern
107
+ });
108
+ }
109
+ function getChecks(component) {
110
+ return Array.isArray(component.checks) ? component.checks : void 0;
111
+ }
112
+ function getPattern(component) {
113
+ return typeof component.pattern === "string" ? component.pattern : void 0;
114
+ }
115
+ function getPrimaryText(props, fallback = "") {
116
+ const text = resolveString(props, ["text", "label", "title", "content", "value"], fallback);
117
+ return text;
118
+ }
119
+ function mapAlign(value) {
120
+ switch (value.toLowerCase()) {
121
+ case "start":
122
+ case "left":
123
+ case "top":
124
+ return "start";
125
+ case "center":
126
+ return "center";
127
+ case "end":
128
+ case "right":
129
+ case "bottom":
130
+ return "end";
131
+ case "stretch":
132
+ return "stretch";
133
+ case "baseline":
134
+ return "baseline";
135
+ default:
136
+ return void 0;
137
+ }
138
+ }
139
+ function mapJustify(value) {
140
+ switch (value.toLowerCase()) {
141
+ case "start":
142
+ case "left":
143
+ case "top":
144
+ return "start";
145
+ case "center":
146
+ return "center";
147
+ case "end":
148
+ case "right":
149
+ case "bottom":
150
+ return "end";
151
+ case "between":
152
+ case "spacebetween":
153
+ return "between";
154
+ default:
155
+ return void 0;
156
+ }
157
+ }
158
+ function toStringArray(value) {
159
+ if (!Array.isArray(value)) {
160
+ return [];
161
+ }
162
+ return value.map((entry) => entry === void 0 || entry === null ? "" : String(entry)).filter((entry) => entry.length > 0);
163
+ }
164
+
165
+ // src/catalog/adapters/audio-player.tsx
166
+ import { jsx } from "react/jsx-runtime";
167
+ function A2UIAudioPlayer(props) {
168
+ const src = resolveString(props, ["src", "url"]);
169
+ const controls = resolveBoolean(props, ["controls"], true);
170
+ const autoplay = resolveBoolean(props, ["autoplay"], false);
171
+ const loop = resolveBoolean(props, ["loop"], false);
172
+ return /* @__PURE__ */ jsx("audio", { src, controls, autoPlay: autoplay, loop, style: { width: "100%" } });
173
+ }
174
+
175
+ // src/catalog/adapters/button.tsx
176
+ import { Button } from "@fragments-sdk/ui";
177
+ import { jsx as jsx2 } from "react/jsx-runtime";
178
+ function mapButtonVariant(style) {
179
+ switch (style.toLowerCase()) {
180
+ case "borderless":
181
+ case "ghost":
182
+ return "ghost";
183
+ case "outlined":
184
+ case "outline":
185
+ return "outlined";
186
+ case "danger":
187
+ case "destructive":
188
+ return "danger";
189
+ case "secondary":
190
+ return "secondary";
191
+ default:
192
+ return "primary";
193
+ }
194
+ }
195
+ function A2UIButton(props) {
196
+ const variant = mapButtonVariant(resolveString(props, ["style", "variant"], "primary"));
197
+ const label = getPrimaryText(props, "Button");
198
+ const disabled = resolveBoolean(props, ["disabled", "enabled"], false);
199
+ const action = resolveAction(props.component, ["action", "onClickAction", "onPressAction", "submitAction"]);
200
+ const checks = getChecks(props.component);
201
+ const pattern = getPattern(props.component);
202
+ const children = props.childIds.length > 0 ? props.childIds.map((childId) => props.renderChild(childId, `${props.component.id}:${childId}`)) : null;
203
+ return /* @__PURE__ */ jsx2(
204
+ Button,
205
+ {
206
+ variant,
207
+ disabled,
208
+ onClick: () => {
209
+ dispatchAction(props, action, {
210
+ checks,
211
+ pattern,
212
+ value: props.resolve(props.component.value)
213
+ });
214
+ },
215
+ children: children ?? label
216
+ }
217
+ );
218
+ }
219
+
220
+ // src/catalog/adapters/card.tsx
221
+ import { Card } from "@fragments-sdk/ui";
222
+ import { jsx as jsx3, jsxs } from "react/jsx-runtime";
223
+ function A2UICard(props) {
224
+ const title = resolveString(props, ["title"], "");
225
+ const description = resolveString(props, ["description", "subtitle"], "");
226
+ return /* @__PURE__ */ jsxs(Card, { children: [
227
+ (title || description) && /* @__PURE__ */ jsxs(Card.Header, { children: [
228
+ title && /* @__PURE__ */ jsx3(Card.Title, { children: title }),
229
+ description && /* @__PURE__ */ jsx3(Card.Description, { children: description })
230
+ ] }),
231
+ /* @__PURE__ */ jsx3(Card.Body, { children: props.renderedChildren })
232
+ ] });
233
+ }
234
+
235
+ // src/catalog/adapters/checkbox.tsx
236
+ import { Checkbox } from "@fragments-sdk/ui";
237
+ import { jsx as jsx4 } from "react/jsx-runtime";
238
+ function A2UICheckBox(props) {
239
+ const path = resolveBindingPath(props, ["value", "path", "valuePath", "bindingPath"]);
240
+ const resolved = path ? props.resolve({ path }) : props.resolve(props.component.value);
241
+ const checked = Boolean(resolved);
242
+ const label = resolveString(props, ["label", "text"], "");
243
+ const description = resolveString(props, ["description"], "");
244
+ const disabled = resolveBoolean(props, ["disabled", "enabled"], false);
245
+ const action = resolveAction(props.component, ["onChangeAction", "action"]);
246
+ const checks = getChecks(props.component);
247
+ const pattern = getPattern(props.component);
248
+ return /* @__PURE__ */ jsx4(
249
+ Checkbox,
250
+ {
251
+ checked,
252
+ label: label || void 0,
253
+ description: description || void 0,
254
+ disabled,
255
+ onCheckedChange: (nextValue) => {
256
+ if (path) {
257
+ props.setData(path, nextValue);
258
+ }
259
+ dispatchAction(props, action, {
260
+ checks,
261
+ pattern,
262
+ value: nextValue
263
+ });
264
+ }
265
+ }
266
+ );
267
+ }
268
+
269
+ // src/catalog/adapters/choice-picker.tsx
270
+ import { Checkbox as Checkbox2, Chip, RadioGroup, Select, Stack } from "@fragments-sdk/ui";
271
+ import { jsx as jsx5, jsxs as jsxs2 } from "react/jsx-runtime";
272
+ function resolveOptions(props) {
273
+ const options = resolveArray(props, ["options", "items", "choices"]);
274
+ const resolved = [];
275
+ options.forEach((option, index) => {
276
+ if (!isRecord(option)) {
277
+ return;
278
+ }
279
+ const valueRaw = option.value ?? option.id ?? index;
280
+ const labelRaw = option.label ?? option.title ?? option.text ?? valueRaw;
281
+ resolved.push({
282
+ value: String(props.resolve(valueRaw) ?? valueRaw),
283
+ label: String(props.resolve(labelRaw) ?? labelRaw),
284
+ description: option.description ? String(props.resolve(option.description) ?? option.description) : void 0
285
+ });
286
+ });
287
+ return resolved;
288
+ }
289
+ function nextMultiValues(currentValues, value, checked) {
290
+ if (checked) {
291
+ return currentValues.includes(value) ? currentValues : [...currentValues, value];
292
+ }
293
+ return currentValues.filter((entry) => entry !== value);
294
+ }
295
+ function shouldUseSelect(displayStyle) {
296
+ const normalized = displayStyle.toLowerCase();
297
+ return normalized === "select" || normalized === "dropdown" || normalized === "menu";
298
+ }
299
+ function A2UIChoicePicker(props) {
300
+ const options = resolveOptions(props);
301
+ const path = resolveBindingPath(props, ["value", "path", "valuePath", "bindingPath"]);
302
+ const rawValue = path ? props.resolve({ path }) : props.resolve(props.component.value);
303
+ const maxAllowedSelections = resolveNumber(props, ["maxAllowedSelections"], 1);
304
+ const mutuallyExclusive = resolveBoolean(props, ["mutuallyExclusive"], maxAllowedSelections === 1);
305
+ const isSingleSelection = mutuallyExclusive || maxAllowedSelections <= 1;
306
+ const displayStyle = resolveString(props, ["displayStyle"], isSingleSelection ? "radio" : "checkbox");
307
+ const action = resolveAction(props.component, ["onChangeAction", "action"]);
308
+ const checks = getChecks(props.component);
309
+ const pattern = getPattern(props.component);
310
+ const commitValue = (nextValue) => {
311
+ if (path) {
312
+ props.setData(path, nextValue);
313
+ }
314
+ dispatchAction(props, action, {
315
+ checks,
316
+ pattern,
317
+ value: nextValue
318
+ });
319
+ };
320
+ if (isSingleSelection) {
321
+ const selectedValue = rawValue === void 0 || rawValue === null ? "" : String(rawValue);
322
+ if (shouldUseSelect(displayStyle)) {
323
+ return /* @__PURE__ */ jsxs2(Select, { value: selectedValue || null, onValueChange: (nextValue) => commitValue(nextValue ?? ""), children: [
324
+ /* @__PURE__ */ jsx5(Select.Trigger, { placeholder: "Choose an option" }),
325
+ /* @__PURE__ */ jsx5(Select.Content, { children: options.map((option) => /* @__PURE__ */ jsx5(Select.Item, { value: option.value, children: option.label }, option.value)) })
326
+ ] });
327
+ }
328
+ return /* @__PURE__ */ jsx5(RadioGroup, { value: selectedValue, onValueChange: (nextValue) => commitValue(nextValue), children: options.map((option) => /* @__PURE__ */ jsx5(
329
+ RadioGroup.Item,
330
+ {
331
+ value: option.value,
332
+ label: option.label,
333
+ description: option.description
334
+ },
335
+ option.value
336
+ )) });
337
+ }
338
+ const selectedValues = toStringArray(rawValue);
339
+ const normalizedStyle = displayStyle.toLowerCase();
340
+ if (normalizedStyle === "chips") {
341
+ return /* @__PURE__ */ jsx5(
342
+ Chip.Group,
343
+ {
344
+ value: selectedValues,
345
+ onChange: (nextValues) => {
346
+ commitValue(nextValues);
347
+ },
348
+ children: options.map((option) => /* @__PURE__ */ jsx5(Chip, { value: option.value, children: option.label }, option.value))
349
+ }
350
+ );
351
+ }
352
+ return /* @__PURE__ */ jsx5(Stack, { direction: "column", gap: "sm", children: options.map((option) => /* @__PURE__ */ jsx5(
353
+ Checkbox2,
354
+ {
355
+ label: option.label,
356
+ description: option.description,
357
+ checked: selectedValues.includes(option.value),
358
+ onCheckedChange: (checked) => {
359
+ const nextValues = nextMultiValues(selectedValues, option.value, checked);
360
+ commitValue(nextValues);
361
+ }
362
+ },
363
+ option.value
364
+ )) });
365
+ }
366
+
367
+ // src/catalog/adapters/column.tsx
368
+ import { Stack as Stack2 } from "@fragments-sdk/ui";
369
+ import { jsx as jsx6 } from "react/jsx-runtime";
370
+ function A2UIColumn(props) {
371
+ const align = mapAlign(resolveString(props, ["alignment", "alignItems"], ""));
372
+ const justify = mapJustify(resolveString(props, ["distribution", "justifyContent"], ""));
373
+ return /* @__PURE__ */ jsx6(Stack2, { direction: "column", align, justify, children: props.renderedChildren });
374
+ }
375
+
376
+ // src/catalog/adapters/date-time-input.tsx
377
+ import { DatePicker, Stack as Stack3, Text } from "@fragments-sdk/ui";
378
+ import { jsx as jsx7, jsxs as jsxs3 } from "react/jsx-runtime";
379
+ function normalizeMode(raw) {
380
+ const mode = raw.toLowerCase();
381
+ if (mode === "time" || mode === "timeonly" || mode === "time-only") {
382
+ return "time";
383
+ }
384
+ if (mode.includes("datetime") || mode.includes("date-time") || mode === "both") {
385
+ return "datetime";
386
+ }
387
+ return "date";
388
+ }
389
+ function toDateValue(raw) {
390
+ if (!raw) {
391
+ return null;
392
+ }
393
+ const parsed = new Date(raw);
394
+ if (Number.isNaN(parsed.getTime())) {
395
+ return null;
396
+ }
397
+ return parsed;
398
+ }
399
+ function toDateOnlyString(date) {
400
+ return date.toISOString().slice(0, 10);
401
+ }
402
+ function toDateTimeLocalValue(raw) {
403
+ if (!raw) {
404
+ return "";
405
+ }
406
+ if (/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}/.test(raw)) {
407
+ return raw.slice(0, 16);
408
+ }
409
+ const parsed = new Date(raw);
410
+ if (Number.isNaN(parsed.getTime())) {
411
+ return raw;
412
+ }
413
+ return parsed.toISOString().slice(0, 16);
414
+ }
415
+ function A2UIDateTimeInput(props) {
416
+ const mode = normalizeMode(resolveString(props, ["dateTimeType", "type", "inputType", "mode"], "date"));
417
+ const path = resolveBindingPath(props, ["value", "path", "valuePath", "bindingPath"]);
418
+ const resolvedValue = path ? props.resolve({ path }) : props.resolve(props.component.value);
419
+ const value = resolvedValue ?? "";
420
+ const label = resolveString(props, ["label", "title"], "");
421
+ const placeholder = resolveString(props, ["placeholder"], mode === "date" ? "Select date" : "");
422
+ const action = resolveAction(props.component, ["onChangeAction", "action"]);
423
+ const checks = getChecks(props.component);
424
+ const pattern = getPattern(props.component);
425
+ const commitValue = (nextValue) => {
426
+ if (path) {
427
+ props.setData(path, nextValue);
428
+ }
429
+ dispatchAction(props, action, {
430
+ checks,
431
+ pattern,
432
+ value: nextValue
433
+ });
434
+ };
435
+ if (mode === "date") {
436
+ const selectedDate = toDateValue(value);
437
+ return /* @__PURE__ */ jsxs3(Stack3, { direction: "column", gap: "xs", children: [
438
+ label && /* @__PURE__ */ jsx7(Text, { as: "label", children: label }),
439
+ /* @__PURE__ */ jsxs3(
440
+ DatePicker,
441
+ {
442
+ mode: "single",
443
+ selected: selectedDate,
444
+ onSelect: (nextDate) => {
445
+ if (!nextDate) {
446
+ commitValue("");
447
+ return;
448
+ }
449
+ commitValue(toDateOnlyString(nextDate));
450
+ },
451
+ placeholder,
452
+ children: [
453
+ /* @__PURE__ */ jsx7(DatePicker.Trigger, { placeholder }),
454
+ /* @__PURE__ */ jsx7(DatePicker.Content, { children: /* @__PURE__ */ jsx7(DatePicker.Calendar, {}) })
455
+ ]
456
+ }
457
+ )
458
+ ] });
459
+ }
460
+ if (mode === "time") {
461
+ return /* @__PURE__ */ jsxs3(Stack3, { direction: "column", gap: "xs", children: [
462
+ label && /* @__PURE__ */ jsx7(Text, { as: "label", children: label }),
463
+ /* @__PURE__ */ jsx7(
464
+ "input",
465
+ {
466
+ type: "time",
467
+ value,
468
+ onChange: (event) => {
469
+ const timeValue = event.currentTarget.value;
470
+ const normalized = timeValue && !timeValue.includes("T") ? `${timeValue}${timeValue.split(":").length < 3 ? ":00" : ""}` : timeValue;
471
+ commitValue(normalized);
472
+ }
473
+ }
474
+ )
475
+ ] });
476
+ }
477
+ return /* @__PURE__ */ jsxs3(Stack3, { direction: "column", gap: "xs", children: [
478
+ label && /* @__PURE__ */ jsx7(Text, { as: "label", children: label }),
479
+ /* @__PURE__ */ jsx7(
480
+ "input",
481
+ {
482
+ type: "datetime-local",
483
+ value: toDateTimeLocalValue(value),
484
+ onChange: (event) => commitValue(event.currentTarget.value)
485
+ }
486
+ )
487
+ ] });
488
+ }
489
+
490
+ // src/catalog/adapters/divider.tsx
491
+ import { Separator } from "@fragments-sdk/ui";
492
+ import { jsx as jsx8 } from "react/jsx-runtime";
493
+ function A2UIDivider(props) {
494
+ const orientation = resolveString(props, ["orientation"], "horizontal").toLowerCase() === "vertical" ? "vertical" : "horizontal";
495
+ return /* @__PURE__ */ jsx8(Separator, { orientation });
496
+ }
497
+
498
+ // src/catalog/icon-map.ts
499
+ import * as PhosphorIcons from "@phosphor-icons/react";
500
+ var manualMap = {
501
+ add: "Plus",
502
+ alert: "WarningCircle",
503
+ arrowdown: "ArrowDown",
504
+ arrowleft: "ArrowLeft",
505
+ arrowright: "ArrowRight",
506
+ arrowup: "ArrowUp",
507
+ attachment: "Paperclip",
508
+ bell: "Bell",
509
+ bookmark: "BookmarkSimple",
510
+ calendar: "Calendar",
511
+ camera: "Camera",
512
+ chat: "ChatCircle",
513
+ check: "Check",
514
+ checkcircle: "CheckCircle",
515
+ chevrondown: "CaretDown",
516
+ chevronleft: "CaretLeft",
517
+ chevronright: "CaretRight",
518
+ chevronup: "CaretUp",
519
+ close: "X",
520
+ copy: "Copy",
521
+ dashboard: "SquaresFour",
522
+ delete: "Trash",
523
+ download: "DownloadSimple",
524
+ edit: "PencilSimple",
525
+ error: "XCircle",
526
+ external: "ArrowSquareOut",
527
+ eye: "Eye",
528
+ filter: "FunnelSimple",
529
+ folder: "FolderSimple",
530
+ gear: "Gear",
531
+ globe: "GlobeHemisphereWest",
532
+ heart: "Heart",
533
+ help: "Question",
534
+ home: "House",
535
+ image: "ImageSquare",
536
+ info: "Info",
537
+ link: "LinkSimple",
538
+ lock: "LockSimple",
539
+ logout: "SignOut",
540
+ menu: "List",
541
+ message: "ChatText",
542
+ minus: "Minus",
543
+ moon: "Moon",
544
+ notification: "BellSimple",
545
+ phone: "Phone",
546
+ plus: "Plus",
547
+ refresh: "ArrowsClockwise",
548
+ search: "MagnifyingGlass",
549
+ send: "PaperPlaneTilt",
550
+ settings: "GearSix",
551
+ share: "ShareNetwork",
552
+ star: "Star",
553
+ sun: "Sun",
554
+ success: "CheckCircle",
555
+ time: "Clock",
556
+ upload: "UploadSimple",
557
+ user: "User",
558
+ users: "Users",
559
+ warning: "Warning"
560
+ };
561
+ function toLookupKey(name) {
562
+ return name.trim().toLowerCase().replace(/[^a-z0-9]/g, "");
563
+ }
564
+ function toPascalCase(name) {
565
+ return name.replace(/([a-z0-9])([A-Z])/g, "$1 $2").split(/[^a-zA-Z0-9]+/).filter(Boolean).map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1).toLowerCase()).join("");
566
+ }
567
+ function resolveA2UIcon(name) {
568
+ const normalized = toLookupKey(name);
569
+ const mapped = manualMap[normalized] ?? toPascalCase(name);
570
+ const icons = PhosphorIcons;
571
+ return icons[mapped] ?? null;
572
+ }
573
+ var knownA2UIIcons = Object.keys(manualMap);
574
+
575
+ // src/catalog/adapters/icon.tsx
576
+ import { Icon } from "@fragments-sdk/ui";
577
+ import { jsx as jsx9 } from "react/jsx-runtime";
578
+ function A2UIIcon(props) {
579
+ const iconName = resolveString(props, ["name", "icon", "iconName"]);
580
+ const iconComponent = resolveA2UIcon(iconName);
581
+ if (!iconComponent) {
582
+ if (iconName) {
583
+ console.warn(`[A2UI] Unknown icon "${iconName}" \u2014 no mapping found in icon-map`);
584
+ }
585
+ return /* @__PURE__ */ jsx9("span", { "data-a2ui-icon-fallback": iconName, "aria-hidden": "true" });
586
+ }
587
+ return /* @__PURE__ */ jsx9(Icon, { icon: iconComponent });
588
+ }
589
+
590
+ // src/catalog/adapters/image.tsx
591
+ import { Avatar, Image as FragmentsImage } from "@fragments-sdk/ui";
592
+ import { jsx as jsx10 } from "react/jsx-runtime";
593
+ var AVATAR_HINTS = /* @__PURE__ */ new Set(["avatar", "profile", "user", "person"]);
594
+ function A2UIImage(props) {
595
+ const src = resolveString(props, ["url", "src"]);
596
+ const alt = resolveString(props, ["alt", "label", "description"]);
597
+ const usageHint = resolveString(props, ["usageHint"], "").toLowerCase();
598
+ if (AVATAR_HINTS.has(usageHint)) {
599
+ const size = resolveNumber(props, ["size"], 40);
600
+ return /* @__PURE__ */ jsx10(Avatar, { src, alt, customSize: size, name: alt });
601
+ }
602
+ return /* @__PURE__ */ jsx10(FragmentsImage, { src, alt: alt || "image" });
603
+ }
604
+
605
+ // src/catalog/adapters/list.tsx
606
+ import { Stack as Stack4 } from "@fragments-sdk/ui";
607
+ import { resolvePointerPath as resolvePointerPath2 } from "@uiprotocol/a2ui/core";
608
+ import { jsx as jsx11 } from "react/jsx-runtime";
609
+ function resolveTemplateBasePath(props, template) {
610
+ const templatePath = template.path;
611
+ if (typeof templatePath === "string") {
612
+ return resolvePointerPath2(templatePath, props.scopePath);
613
+ }
614
+ const items = props.component.items;
615
+ if (isBoundValue(items)) {
616
+ return resolvePointerPath2(items.path, props.scopePath);
617
+ }
618
+ if (typeof props.component.path === "string") {
619
+ return resolvePointerPath2(props.component.path, props.scopePath);
620
+ }
621
+ return props.scopePath;
622
+ }
623
+ function A2UIList(props) {
624
+ const template = isRecord(props.component.template) ? props.component.template : void 0;
625
+ const templateChild = template && typeof template.child === "string" ? template.child : void 0;
626
+ if (template && templateChild) {
627
+ const items = resolveArray(props, ["items", "data", "source"]);
628
+ const basePath = resolveTemplateBasePath(props, template);
629
+ return /* @__PURE__ */ jsx11(Stack4, { direction: "column", gap: "sm", children: items.map(
630
+ (_, index) => props.renderChild(templateChild, `${props.component.id}:${templateChild}:${index}`, `${basePath}/${index}`)
631
+ ) });
632
+ }
633
+ const orientation = resolveString(props, ["orientation"], "vertical").toLowerCase();
634
+ return /* @__PURE__ */ jsx11(Stack4, { direction: orientation === "horizontal" ? "row" : "column", gap: "sm", children: props.renderedChildren });
635
+ }
636
+
637
+ // src/catalog/adapters/modal.tsx
638
+ import * as React from "react";
639
+ import { Button as Button2, Dialog } from "@fragments-sdk/ui";
640
+ import { jsx as jsx12, jsxs as jsxs4 } from "react/jsx-runtime";
641
+ function buildTriggerNode(props, childId) {
642
+ if (childId) {
643
+ const rendered = props.renderChild(childId, `${props.component.id}:trigger`);
644
+ if (React.isValidElement(rendered)) {
645
+ return rendered;
646
+ }
647
+ }
648
+ const triggerLabel = resolveString(props, ["triggerLabel", "entryPointLabel", "label"], "Open");
649
+ return /* @__PURE__ */ jsx12(Button2, { variant: "secondary", children: triggerLabel });
650
+ }
651
+ function A2UIModal(props) {
652
+ const entryPointChild = typeof props.component.entryPointChild === "string" ? props.component.entryPointChild : void 0;
653
+ const contentChild = typeof props.component.contentChild === "string" ? props.component.contentChild : void 0;
654
+ const openProp = resolveBoolean(props, ["open"], false);
655
+ const title = resolveString(props, ["title"], "");
656
+ const description = resolveString(props, ["description"], "");
657
+ const [open, setOpen] = React.useState(openProp);
658
+ React.useEffect(() => {
659
+ setOpen(openProp);
660
+ }, [openProp]);
661
+ return /* @__PURE__ */ jsxs4(Dialog, { open, onOpenChange: setOpen, children: [
662
+ /* @__PURE__ */ jsx12(Dialog.Trigger, { asChild: true, children: buildTriggerNode(props, entryPointChild) }),
663
+ /* @__PURE__ */ jsxs4(Dialog.Content, { children: [
664
+ (title || description) && /* @__PURE__ */ jsxs4(Dialog.Header, { children: [
665
+ title && /* @__PURE__ */ jsx12(Dialog.Title, { children: title }),
666
+ description && /* @__PURE__ */ jsx12(Dialog.Description, { children: description })
667
+ ] }),
668
+ /* @__PURE__ */ jsx12(Dialog.Body, { children: contentChild ? props.renderChild(contentChild, `${props.component.id}:${contentChild}`) : props.renderedChildren }),
669
+ /* @__PURE__ */ jsx12(Dialog.Close, {})
670
+ ] })
671
+ ] });
672
+ }
673
+
674
+ // src/catalog/adapters/row.tsx
675
+ import { Stack as Stack5 } from "@fragments-sdk/ui";
676
+ import { jsx as jsx13 } from "react/jsx-runtime";
677
+ function A2UIRow(props) {
678
+ const align = mapAlign(resolveString(props, ["alignment", "alignItems"], ""));
679
+ const justify = mapJustify(resolveString(props, ["distribution", "justifyContent"], ""));
680
+ return /* @__PURE__ */ jsx13(Stack5, { direction: "row", align, justify, children: props.renderedChildren });
681
+ }
682
+
683
+ // src/catalog/adapters/slider.tsx
684
+ import { Slider } from "@fragments-sdk/ui";
685
+ import { jsx as jsx14 } from "react/jsx-runtime";
686
+ function A2UISlider(props) {
687
+ const path = resolveBindingPath(props, ["value", "path", "valuePath", "bindingPath"]);
688
+ const resolvedValue = path ? props.resolve({ path }) : props.resolve(props.component.value);
689
+ const min = resolveNumber(props, ["minValue", "min"], 0);
690
+ const max = resolveNumber(props, ["maxValue", "max"], 100);
691
+ const step = resolveNumber(props, ["step"], 1);
692
+ const value = resolvedValue === null || resolvedValue === void 0 ? void 0 : typeof resolvedValue === "number" ? resolvedValue : min;
693
+ const label = resolveString(props, ["label", "title"], "");
694
+ const action = resolveAction(props.component, ["onChangeAction", "action"]);
695
+ const checks = getChecks(props.component);
696
+ const pattern = getPattern(props.component);
697
+ return /* @__PURE__ */ jsx14(
698
+ Slider,
699
+ {
700
+ label: label || void 0,
701
+ value,
702
+ min,
703
+ max,
704
+ step,
705
+ onChange: (nextValue) => {
706
+ if (path) {
707
+ props.setData(path, nextValue);
708
+ }
709
+ dispatchAction(props, action, {
710
+ checks,
711
+ pattern,
712
+ value: nextValue
713
+ });
714
+ }
715
+ }
716
+ );
717
+ }
718
+
719
+ // src/catalog/adapters/tabs.tsx
720
+ import { Tabs } from "@fragments-sdk/ui";
721
+ import { Fragment, jsx as jsx15, jsxs as jsxs5 } from "react/jsx-runtime";
722
+ function resolveTabItems(props) {
723
+ const items = resolveArray(props, ["tabItems", "items"]);
724
+ const resolved = [];
725
+ items.forEach((item, index) => {
726
+ if (!isRecord(item)) {
727
+ return;
728
+ }
729
+ const value = item.value;
730
+ const key = value !== void 0 ? String(value) : String(index);
731
+ const titleRaw = item.title ?? item.label ?? `Tab ${index + 1}`;
732
+ const title = String(props.resolve(titleRaw) ?? `Tab ${index + 1}`);
733
+ const childId = typeof item.child === "string" ? item.child : typeof item.panelChild === "string" ? item.panelChild : void 0;
734
+ resolved.push({
735
+ key,
736
+ title,
737
+ childId
738
+ });
739
+ });
740
+ return resolved;
741
+ }
742
+ function A2UITabs(props) {
743
+ const items = resolveTabItems(props);
744
+ if (items.length === 0) {
745
+ return /* @__PURE__ */ jsx15(Fragment, { children: props.renderedChildren });
746
+ }
747
+ return /* @__PURE__ */ jsxs5(Tabs, { defaultValue: items[0].key, children: [
748
+ /* @__PURE__ */ jsx15(Tabs.List, { children: items.map((item) => /* @__PURE__ */ jsx15(Tabs.Tab, { value: item.key, children: item.title }, `tab-${item.key}`)) }),
749
+ items.map((item) => /* @__PURE__ */ jsx15(Tabs.Panel, { value: item.key, children: item.childId ? props.renderChild(item.childId, `${props.component.id}:${item.childId}`) : null }, `panel-${item.key}`))
750
+ ] });
751
+ }
752
+
753
+ // src/catalog/adapters/text.tsx
754
+ import { Text as Text2 } from "@fragments-sdk/ui";
755
+ import { jsx as jsx16 } from "react/jsx-runtime";
756
+ var TEXT_VARIANT_MAP = {
757
+ h1: "h1",
758
+ h2: "h2",
759
+ h3: "h3",
760
+ h4: "h4",
761
+ h5: "h5",
762
+ h6: "h6",
763
+ heading1: "h1",
764
+ heading2: "h2",
765
+ heading3: "h3",
766
+ heading4: "h4",
767
+ heading5: "h5",
768
+ heading6: "h6",
769
+ body: "p",
770
+ paragraph: "p",
771
+ caption: "span"
772
+ };
773
+ function mapTextElement(variant) {
774
+ return TEXT_VARIANT_MAP[variant.toLowerCase()] ?? "span";
775
+ }
776
+ function A2UIText(props) {
777
+ const variant = resolveString(props, ["variant", "textVariant"], "body");
778
+ const as = mapTextElement(variant);
779
+ const text = getPrimaryText(props);
780
+ const content = text.length > 0 ? text : props.renderedChildren;
781
+ return /* @__PURE__ */ jsx16(Text2, { as, children: content });
782
+ }
783
+
784
+ // src/catalog/adapters/text-field.tsx
785
+ import { Input, Textarea } from "@fragments-sdk/ui";
786
+ import { jsx as jsx17 } from "react/jsx-runtime";
787
+ function mapInputType(raw) {
788
+ switch (raw.toLowerCase()) {
789
+ case "email":
790
+ return "email";
791
+ case "password":
792
+ return "password";
793
+ case "number":
794
+ return "number";
795
+ case "tel":
796
+ case "phone":
797
+ return "tel";
798
+ case "url":
799
+ return "url";
800
+ default:
801
+ return "text";
802
+ }
803
+ }
804
+ function A2UITextField(props) {
805
+ const textFieldType = resolveString(props, ["textFieldType", "type"], "shortText");
806
+ const isLongText = textFieldType.toLowerCase() === "longtext" || textFieldType.toLowerCase() === "textarea";
807
+ const bindingPath = resolveBindingPath(props, ["value", "path", "valuePath", "bindingPath"]);
808
+ const resolvedValue = bindingPath ? props.resolve({ path: bindingPath }) : props.resolve(props.component.value);
809
+ const value = resolvedValue ?? "";
810
+ const label = resolveString(props, ["label", "title"], "");
811
+ const placeholder = resolveString(props, ["placeholder"], "");
812
+ const disabled = resolveBoolean(props, ["disabled", "enabled"], false);
813
+ const action = resolveAction(props.component, ["onChangeAction", "action", "onSubmitAction"]);
814
+ const checks = getChecks(props.component);
815
+ const pattern = getPattern(props.component);
816
+ const onChange = (nextValue) => {
817
+ if (bindingPath) {
818
+ props.setData(bindingPath, nextValue);
819
+ }
820
+ dispatchAction(props, action, {
821
+ checks,
822
+ pattern,
823
+ value: nextValue
824
+ });
825
+ };
826
+ if (isLongText) {
827
+ return /* @__PURE__ */ jsx17(
828
+ Textarea,
829
+ {
830
+ value,
831
+ label: label || void 0,
832
+ placeholder: placeholder || void 0,
833
+ disabled,
834
+ onChange
835
+ }
836
+ );
837
+ }
838
+ const inputType = mapInputType(textFieldType);
839
+ return /* @__PURE__ */ jsx17(
840
+ Input,
841
+ {
842
+ type: inputType,
843
+ value,
844
+ label: label || void 0,
845
+ placeholder: placeholder || void 0,
846
+ disabled,
847
+ onChange
848
+ }
849
+ );
850
+ }
851
+
852
+ // src/catalog/adapters/video.tsx
853
+ import { jsx as jsx18 } from "react/jsx-runtime";
854
+ function A2UIVideo(props) {
855
+ const src = resolveString(props, ["src", "url"]);
856
+ const controls = resolveBoolean(props, ["controls"], true);
857
+ const autoplay = resolveBoolean(props, ["autoplay"], false);
858
+ const loop = resolveBoolean(props, ["loop"], false);
859
+ const muted = resolveBoolean(props, ["muted"], false);
860
+ return /* @__PURE__ */ jsx18(
861
+ "video",
862
+ {
863
+ src,
864
+ controls,
865
+ autoPlay: autoplay,
866
+ loop,
867
+ muted,
868
+ style: { width: "100%", maxWidth: "100%" }
869
+ }
870
+ );
871
+ }
872
+
873
+ // src/catalog/component-map.ts
874
+ var fragmentsCatalog = {
875
+ Text: A2UIText,
876
+ Image: A2UIImage,
877
+ Icon: A2UIIcon,
878
+ Video: A2UIVideo,
879
+ AudioPlayer: A2UIAudioPlayer,
880
+ Row: A2UIRow,
881
+ Column: A2UIColumn,
882
+ List: A2UIList,
883
+ Card: A2UICard,
884
+ Tabs: A2UITabs,
885
+ Modal: A2UIModal,
886
+ Divider: A2UIDivider,
887
+ Button: A2UIButton,
888
+ TextField: A2UITextField,
889
+ CheckBox: A2UICheckBox,
890
+ ChoicePicker: A2UIChoicePicker,
891
+ Slider: A2UISlider,
892
+ DateTimeInput: A2UIDateTimeInput
893
+ };
894
+
895
+ export {
896
+ A2UIAudioPlayer,
897
+ A2UIButton,
898
+ A2UICard,
899
+ A2UICheckBox,
900
+ A2UIChoicePicker,
901
+ A2UIColumn,
902
+ A2UIDateTimeInput,
903
+ A2UIDivider,
904
+ resolveA2UIcon,
905
+ knownA2UIIcons,
906
+ A2UIIcon,
907
+ A2UIImage,
908
+ A2UIList,
909
+ A2UIModal,
910
+ A2UIRow,
911
+ A2UISlider,
912
+ A2UITabs,
913
+ A2UIText,
914
+ A2UITextField,
915
+ A2UIVideo,
916
+ fragmentsCatalog
917
+ };
File without changes
@@ -0,0 +1,49 @@
1
+ import {
2
+ fragmentsCatalog
3
+ } from "./chunk-C7JKECLH.js";
4
+
5
+ // src/react/index.ts
6
+ import {
7
+ useA2UIMessages,
8
+ useA2UISurface,
9
+ useDataBinding,
10
+ useFormBinding,
11
+ useAction
12
+ } from "@uiprotocol/a2ui/react";
13
+
14
+ // src/react/FragmentsA2UIProvider.tsx
15
+ import * as React from "react";
16
+ import { A2UIProvider } from "@uiprotocol/a2ui/react";
17
+ import { jsx } from "react/jsx-runtime";
18
+ function FragmentsA2UIProvider({ catalog, ...props }) {
19
+ const componentsMap = React.useMemo(() => {
20
+ const merged = { ...fragmentsCatalog };
21
+ if (!catalog) {
22
+ return merged;
23
+ }
24
+ for (const [key, value] of Object.entries(catalog)) {
25
+ if (value) {
26
+ merged[key] = value;
27
+ }
28
+ }
29
+ return merged;
30
+ }, [catalog]);
31
+ return /* @__PURE__ */ jsx(A2UIProvider, { ...props, componentsMap });
32
+ }
33
+
34
+ // src/react/FragmentsA2UIRenderer.tsx
35
+ import { A2UIRenderer } from "@uiprotocol/a2ui/react";
36
+ import { jsx as jsx2 } from "react/jsx-runtime";
37
+ function FragmentsA2UIRenderer(props) {
38
+ return /* @__PURE__ */ jsx2(A2UIRenderer, { ...props });
39
+ }
40
+
41
+ export {
42
+ FragmentsA2UIProvider,
43
+ FragmentsA2UIRenderer,
44
+ useA2UIMessages,
45
+ useA2UISurface,
46
+ useDataBinding,
47
+ useFormBinding,
48
+ useAction
49
+ };
@@ -0,0 +1,5 @@
1
+ export { A2UIAudioPlayer, A2UIButton, A2UICard, A2UICheckBox, A2UIChoicePicker, A2UIColumn, A2UIDateTimeInput, A2UIDivider, A2UIIcon, A2UIImage, A2UIList, A2UIModal, A2UIRow, A2UISlider, A2UITabs, A2UIText, A2UITextField, A2UIVideo, fragmentsCatalog, knownA2UIIcons, resolveA2UIcon } from './catalog/index.js';
2
+ export { A2UIAdapterProps, A2UIProviderProps, ComponentsMap, ProcessMessageResult, UnknownComponentFallback, useA2UIMessages, useA2UISurface, useAction, useDataBinding, useFormBinding } from '@uiprotocol/a2ui/react';
3
+ export { FragmentsA2UIProvider, FragmentsA2UIProviderProps, FragmentsA2UIRenderer, FragmentsA2UIRendererProps } from './react/index.js';
4
+ import 'react';
5
+ import 'react/jsx-runtime';
package/dist/index.js ADDED
@@ -0,0 +1,63 @@
1
+ import {
2
+ FragmentsA2UIProvider,
3
+ FragmentsA2UIRenderer,
4
+ useA2UIMessages,
5
+ useA2UISurface,
6
+ useAction,
7
+ useDataBinding,
8
+ useFormBinding
9
+ } from "./chunk-QGG4K3SD.js";
10
+ import "./chunk-QCZG5JX2.js";
11
+ import {
12
+ A2UIAudioPlayer,
13
+ A2UIButton,
14
+ A2UICard,
15
+ A2UICheckBox,
16
+ A2UIChoicePicker,
17
+ A2UIColumn,
18
+ A2UIDateTimeInput,
19
+ A2UIDivider,
20
+ A2UIIcon,
21
+ A2UIImage,
22
+ A2UIList,
23
+ A2UIModal,
24
+ A2UIRow,
25
+ A2UISlider,
26
+ A2UITabs,
27
+ A2UIText,
28
+ A2UITextField,
29
+ A2UIVideo,
30
+ fragmentsCatalog,
31
+ knownA2UIIcons,
32
+ resolveA2UIcon
33
+ } from "./chunk-C7JKECLH.js";
34
+ export {
35
+ A2UIAudioPlayer,
36
+ A2UIButton,
37
+ A2UICard,
38
+ A2UICheckBox,
39
+ A2UIChoicePicker,
40
+ A2UIColumn,
41
+ A2UIDateTimeInput,
42
+ A2UIDivider,
43
+ A2UIIcon,
44
+ A2UIImage,
45
+ A2UIList,
46
+ A2UIModal,
47
+ A2UIRow,
48
+ A2UISlider,
49
+ A2UITabs,
50
+ A2UIText,
51
+ A2UITextField,
52
+ A2UIVideo,
53
+ FragmentsA2UIProvider,
54
+ FragmentsA2UIRenderer,
55
+ fragmentsCatalog,
56
+ knownA2UIIcons,
57
+ resolveA2UIcon,
58
+ useA2UIMessages,
59
+ useA2UISurface,
60
+ useAction,
61
+ useDataBinding,
62
+ useFormBinding
63
+ };
@@ -0,0 +1,14 @@
1
+ import { A2UIProviderProps, ComponentsMap, A2UIRenderer } from '@uiprotocol/a2ui/react';
2
+ export { A2UIAdapterProps, A2UIProviderProps, ComponentsMap, ProcessMessageResult, UnknownComponentFallback, useA2UIMessages, useA2UISurface, useAction, useDataBinding, useFormBinding } from '@uiprotocol/a2ui/react';
3
+ import * as react_jsx_runtime from 'react/jsx-runtime';
4
+ import * as React from 'react';
5
+
6
+ interface FragmentsA2UIProviderProps extends Omit<A2UIProviderProps, 'componentsMap'> {
7
+ catalog?: Partial<ComponentsMap>;
8
+ }
9
+ declare function FragmentsA2UIProvider({ catalog, ...props }: FragmentsA2UIProviderProps): react_jsx_runtime.JSX.Element;
10
+
11
+ type FragmentsA2UIRendererProps = React.ComponentProps<typeof A2UIRenderer>;
12
+ declare function FragmentsA2UIRenderer(props: FragmentsA2UIRendererProps): react_jsx_runtime.JSX.Element;
13
+
14
+ export { FragmentsA2UIProvider, type FragmentsA2UIProviderProps, FragmentsA2UIRenderer, type FragmentsA2UIRendererProps };
@@ -0,0 +1,19 @@
1
+ import {
2
+ FragmentsA2UIProvider,
3
+ FragmentsA2UIRenderer,
4
+ useA2UIMessages,
5
+ useA2UISurface,
6
+ useAction,
7
+ useDataBinding,
8
+ useFormBinding
9
+ } from "../chunk-QGG4K3SD.js";
10
+ import "../chunk-C7JKECLH.js";
11
+ export {
12
+ FragmentsA2UIProvider,
13
+ FragmentsA2UIRenderer,
14
+ useA2UIMessages,
15
+ useA2UISurface,
16
+ useAction,
17
+ useDataBinding,
18
+ useFormBinding
19
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fragments-sdk/a2ui",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "license": "FSL-1.1-MIT",
5
5
  "description": "Fragments adapter package for @uiprotocol/a2ui",
6
6
  "author": "Conan McNicholl",
@@ -39,12 +39,12 @@
39
39
  ],
40
40
  "dependencies": {
41
41
  "@phosphor-icons/react": "^2.1.10",
42
- "@uiprotocol/a2ui": "link:../../../uiprotocol-a2ui/packages/uiprotocol-a2ui"
42
+ "@uiprotocol/a2ui": "^0.1.0"
43
43
  },
44
44
  "peerDependencies": {
45
45
  "react": ">=18",
46
46
  "react-dom": ">=18",
47
- "@fragments-sdk/ui": ">=0.12.0"
47
+ "@fragments-sdk/ui": ">=0.13.0"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@axe-core/playwright": "^4.11.1",
@@ -61,7 +61,7 @@
61
61
  "typescript": "^5.7.2",
62
62
  "vite": "^6.0.0",
63
63
  "vitest": "^2.1.8",
64
- "@fragments-sdk/ui": "0.12.0"
64
+ "@fragments-sdk/ui": "0.13.0"
65
65
  },
66
66
  "scripts": {
67
67
  "build": "tsup",