glchat-a2ui-react-renderer 0.3.2 → 0.3.3

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/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ export { SurfaceRenderer, type SurfaceRendererProps } from './src/SurfaceRendere
3
3
  export { useSurfaces } from './src/v0_9/useSurfaces.js';
4
4
  export { createGlchatCatalog, GLCHAT_CATALOG_ID } from './src/v0_9/catalog.js';
5
5
  export { createGlchatRegistry, GLCHAT_CATALOG_ID_V08, ensureGlchatComponentsRegistered } from './src/v0_8/registry.js';
6
+ export { GlchatAudioPlayerComponent } from './src/components/a2ui/v0_9/AudioPlayer/AudioPlayer.js';
6
7
  export { GlchatButtonComponent, GlchatButtonApi } from './src/components/a2ui/v0_9/Button/Button.js';
7
8
  export { GlchatChoicePickerComponent } from './src/components/a2ui/v0_9/ChoicePicker/ChoicePicker.js';
8
9
  export { GlchatTagInputComponent, TagInputApi } from './src/components/a2ui/v0_9/TagInput/TagInput.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,eAAe,EACf,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAGvH,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGnG,OAAO,EACL,WAAW,EACX,6BAA6B,EAC7B,uCAAuC,EACvC,eAAe,EACf,mBAAmB,EACnB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,eAAe,EACf,6BAA6B,EAC7B,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,QAAQ,EACR,eAAe,EACf,eAAe,EACf,cAAc,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,mBAAmB,GACzB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EAAE,eAAe,EAAE,KAAK,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEtF,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,gCAAgC,EAAE,MAAM,wBAAwB,CAAC;AAGvH,OAAO,EAAE,0BAA0B,EAAE,MAAM,uDAAuD,CAAC;AACnG,OAAO,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACrG,OAAO,EAAE,2BAA2B,EAAE,MAAM,yDAAyD,CAAC;AACtG,OAAO,EAAE,uBAAuB,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAC;AACvG,OAAO,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAGnG,OAAO,EACL,WAAW,EACX,6BAA6B,EAC7B,uCAAuC,EACvC,eAAe,EACf,mBAAmB,EACnB,KAAK,4BAA4B,EACjC,KAAK,uBAAuB,GAC7B,MAAM,kBAAkB,CAAC;AAG1B,OAAO,EACL,OAAO,EACP,gBAAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,mBAAmB,EACnB,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,kBAAkB,EAClB,eAAe,EACf,6BAA6B,EAC7B,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,gBAAgB,GACtB,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -4,6 +4,7 @@ export { useSurfaces } from './src/v0_9/useSurfaces.js';
4
4
  export { createGlchatCatalog, GLCHAT_CATALOG_ID } from './src/v0_9/catalog.js';
5
5
  export { createGlchatRegistry, GLCHAT_CATALOG_ID_V08, ensureGlchatComponentsRegistered } from './src/v0_8/registry.js';
6
6
  // GLChat custom component implementations and their schemas (v0.9)
7
+ export { GlchatAudioPlayerComponent } from './src/components/a2ui/v0_9/AudioPlayer/AudioPlayer.js';
7
8
  export { GlchatButtonComponent, GlchatButtonApi } from './src/components/a2ui/v0_9/Button/Button.js';
8
9
  export { GlchatChoicePickerComponent } from './src/components/a2ui/v0_9/ChoicePicker/ChoicePicker.js';
9
10
  export { GlchatTagInputComponent, TagInputApi } from './src/components/a2ui/v0_9/TagInput/TagInput.js';
@@ -0,0 +1,6 @@
1
+ /**
2
+ * GLChat-styled AudioPlayer. Overrides the basic catalog native `<audio controls>`
3
+ * with the custom player UI (play/pause, scrubber, download).
4
+ */
5
+ export declare const GlchatAudioPlayerComponent: import("@a2ui/react/v0_9").ReactComponentImplementation;
6
+ //# sourceMappingURL=AudioPlayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../../../../../../src/components/a2ui/v0_9/AudioPlayer/AudioPlayer.tsx"],"names":[],"mappings":"AAQA;;;GAGG;AACH,eAAO,MAAM,0BAA0B,yDAWtC,CAAC"}
@@ -0,0 +1,15 @@
1
+ 'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { createComponentImplementation } from '@a2ui/react/v0_9';
4
+ import { AudioPlayerApi } from '@a2ui/web_core/v0_9/basic_catalog';
5
+ import { AudioPlayer } from '../../../../components/ui/AudioPlayer/AudioPlayer.js';
6
+ import { getWeightStyle } from '../common.js';
7
+ /**
8
+ * GLChat-styled AudioPlayer. Overrides the basic catalog native `<audio controls>`
9
+ * with the custom player UI (play/pause, scrubber, download).
10
+ */
11
+ export const GlchatAudioPlayerComponent = createComponentImplementation(AudioPlayerApi, ({ props }) => {
12
+ if (!props.url)
13
+ return null;
14
+ return (_jsx("div", { className: "a2ui-audioplayer", style: getWeightStyle(props.weight), children: _jsx(AudioPlayer, { src: props.url, title: props.description }) }));
15
+ });
@@ -231,16 +231,6 @@ export declare const GlchatButtonApi: {
231
231
  };
232
232
  weight?: number | undefined;
233
233
  variant?: "primary" | "destructive" | "borderless" | "default" | undefined;
234
- checks?: {
235
- message: string;
236
- condition: boolean | {
237
- path: string;
238
- } | {
239
- call: string;
240
- args: Record<string, any>;
241
- returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
242
- };
243
- }[] | undefined;
244
234
  accessibility?: {
245
235
  description?: string | {
246
236
  path: string;
@@ -257,6 +247,16 @@ export declare const GlchatButtonApi: {
257
247
  returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
258
248
  } | undefined;
259
249
  } | undefined;
250
+ checks?: {
251
+ message: string;
252
+ condition: boolean | {
253
+ path: string;
254
+ } | {
255
+ call: string;
256
+ args: Record<string, any>;
257
+ returnType: "string" | "number" | "boolean" | "object" | "array" | "void" | "any";
258
+ };
259
+ }[] | undefined;
260
260
  }, {
261
261
  child: string;
262
262
  action: {
@@ -279,16 +279,6 @@ export declare const GlchatButtonApi: {
279
279
  };
280
280
  weight?: number | undefined;
281
281
  variant?: "primary" | "destructive" | "borderless" | "default" | undefined;
282
- checks?: {
283
- message: string;
284
- condition: boolean | {
285
- path: string;
286
- } | {
287
- call: string;
288
- args: Record<string, any>;
289
- returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
290
- };
291
- }[] | undefined;
292
282
  accessibility?: {
293
283
  description?: string | {
294
284
  path: string;
@@ -305,6 +295,16 @@ export declare const GlchatButtonApi: {
305
295
  returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
306
296
  } | undefined;
307
297
  } | undefined;
298
+ checks?: {
299
+ message: string;
300
+ condition: boolean | {
301
+ path: string;
302
+ } | {
303
+ call: string;
304
+ args: Record<string, any>;
305
+ returnType?: "string" | "number" | "boolean" | "object" | "array" | "void" | "any" | undefined;
306
+ };
307
+ }[] | undefined;
308
308
  }>;
309
309
  };
310
310
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/a2ui/v0_9/Button/Button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;8BAqC4vsE,CAAC;;;;uBAA0M,CAAC;;;;;;;;;uBAA6Y,CAAC;;;;;8BAA8N,CAAC;;;;;;uBAAmP,CAAC;;;;;;;;;;;uBAA6a,CAAC;;;;;8BAA8N,CAAC;;;;;;;;;;;;;;;0BAAmuB,CAAC;;;;;;;;;;;;0BAA4e,CAAC;;;;;;;;;;;;;;;;;;;;;0BAA27B,CAAC;;;;;;;;;;;;;;;;;;;0BAAwrB,CAAC;;;;;;;;;;;;;;;;;;;;;0BAAw8B,CAAC;;;;;;;;;;;;;;;;;;;0BAAy4B,CAAC;;;uBAAmK,CAAC;;;;;;;iBAAqR,CAAC;;;;;;;;uBAAwS,CAAC;;;;;0BAAgK,CAAC;;iBAAiI,CAAC;;;;;0BAAgK,CAAC;;;;;;;;;;;uBAA98M,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAA6a,CAAC;;;;;8BAA8N,CAAC;;;;;;;0BAAgtC,CAAC;;;;;;;;;;;;0BAAonD,CAAC;;;;;;;;;0BAAstF,CAAC;;;;;;;0BAAkS,CAAC;;;;CA1Bjx7E,CAAC;AASF;;GAEG;AACH,eAAO,MAAM,qBAAqB,yDAajC,CAAC"}
1
+ {"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../../../../src/components/a2ui/v0_9/Button/Button.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;8BAqC4vsE,CAAC;;;;uBAA0M,CAAC;;;;;;;;;uBAA6Y,CAAC;;;;;8BAA8N,CAAC;;;;;;uBAAmP,CAAC;;;;;;;;;;;uBAA6a,CAAC;;;;;8BAA8N,CAAC;;;;;;;;;;;;;;;0BAAmuB,CAAC;;;;;;;;;;;;0BAA4e,CAAC;;;;;;;;;;;;;;;;;;;;;0BAA27B,CAAC;;;;;;;;;;;;;;;;;;;0BAAwrB,CAAC;;;;;;;;;;;;;;;;;;;;;0BAAw8B,CAAC;;;;;;;;;;;;;;;;;;;0BAAy4B,CAAC;;;uBAAmK,CAAC;;;;;;;iBAAqR,CAAC;;;;;;;;uBAAwS,CAAC;;;;;0BAAgK,CAAC;;iBAAiI,CAAC;;;;;0BAAgK,CAAC;;;;;;;;;;;uBAA98M,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uBAA6a,CAAC;;;;;8BAA8N,CAAC;;;;;;;0BAAgtC,CAAC;;;;;;;;;;;0BAA20I,CAAC;;;;;;;0BAAkS,CAAC;;;;;;;;;;0BAA3/F,CAAC;;;;CA1Bvx1E,CAAC;AASF;;GAEG;AACH,eAAO,MAAM,qBAAqB,yDAajC,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { type CSSProperties } from 'react';
2
+ export type AudioPlayerProps = {
3
+ src: string;
4
+ title?: string;
5
+ className?: string;
6
+ style?: CSSProperties;
7
+ };
8
+ export declare function AudioPlayer({ src, title, className, style }: Readonly<AudioPlayerProps>): import("react").JSX.Element;
9
+ //# sourceMappingURL=AudioPlayer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AudioPlayer.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/AudioPlayer/AudioPlayer.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA+B,KAAK,aAAa,EAAE,MAAM,OAAO,CAAC;AAmBxE,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAoEF,wBAAgB,WAAW,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,QAAQ,CAAC,gBAAgB,CAAC,+BAiKvF"}
@@ -0,0 +1,156 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { Download, Pause, Play } from 'lucide-react';
4
+ import { useEffect, useRef, useState } from 'react';
5
+ import { Button } from '../../../components/ui/Button/Button.js';
6
+ import { ButtonAsLink } from '../../../components/ui/Button/ButtonAsLink.js';
7
+ import { cn } from '../../../utils/css.js';
8
+ import { audioPlayerCardStyles, audioPlayerControlsStyles, audioPlayerHeaderStyles, audioPlayerHiddenAudioStyles, audioPlayerIconButtonStyles, audioPlayerMetaStyles, audioPlayerProgressStyles, audioPlayerRootStyles, audioPlayerTimeStyles, audioPlayerTitleStyles, } from './theme.js';
9
+ function formatAudioDuration(seconds) {
10
+ if (!Number.isFinite(seconds) || seconds < 0) {
11
+ return '0:00';
12
+ }
13
+ const minutes = Math.floor(seconds / 60);
14
+ const secs = Math.floor(seconds % 60);
15
+ return `${minutes}:${secs.toString().padStart(2, '0')}`;
16
+ }
17
+ function formatBytes(bytes, decimals = 1) {
18
+ if (!Number.isFinite(bytes) || bytes < 0)
19
+ return '0 B';
20
+ if (bytes === 0)
21
+ return '0 B';
22
+ const units = ['B', 'KB', 'MB', 'GB', 'TB'];
23
+ const unitIndex = Math.min(Math.floor(Math.log(bytes) / Math.log(1024)), units.length - 1);
24
+ const value = bytes / 1024 ** unitIndex;
25
+ return `${value.toFixed(decimals)} ${units[unitIndex]}`;
26
+ }
27
+ function getFilenameFromUrl(url) {
28
+ try {
29
+ const pathname = new URL(url).pathname;
30
+ const parts = pathname.split('/').filter(Boolean);
31
+ const segment = parts.at(-1);
32
+ return segment ? decodeURIComponent(segment) : 'audio';
33
+ }
34
+ catch {
35
+ return 'audio';
36
+ }
37
+ }
38
+ function getFileExtension(filename) {
39
+ const match = /\.([^.]+)$/.exec(filename);
40
+ return match?.[1] ?? '';
41
+ }
42
+ const AUDIO_MIME_LABELS = {
43
+ 'audio/mpeg': 'MP3',
44
+ 'audio/mp3': 'MP3',
45
+ 'audio/wav': 'WAV',
46
+ 'audio/x-wav': 'WAV',
47
+ 'audio/wave': 'WAV',
48
+ 'audio/ogg': 'OGG',
49
+ 'audio/flac': 'FLAC',
50
+ 'audio/mp4': 'M4A',
51
+ 'audio/x-m4a': 'M4A',
52
+ 'audio/m4a': 'M4A',
53
+ 'audio/aac': 'AAC',
54
+ 'audio/webm': 'WEBM',
55
+ };
56
+ function getAudioLabelFromContentType(contentType) {
57
+ if (!contentType)
58
+ return null;
59
+ const mime = contentType.split(';', 1)[0]?.trim().toLowerCase() ?? '';
60
+ const knownLabel = AUDIO_MIME_LABELS[mime];
61
+ if (knownLabel)
62
+ return knownLabel;
63
+ if (mime.startsWith('audio/')) {
64
+ const subtype = mime.slice('audio/'.length);
65
+ if (subtype && subtype !== '*')
66
+ return subtype.toUpperCase();
67
+ }
68
+ return null;
69
+ }
70
+ export function AudioPlayer({ src, title, className, style }) {
71
+ const audioRef = useRef(null);
72
+ const [isPlaying, setIsPlaying] = useState(false);
73
+ const [currentTime, setCurrentTime] = useState(0);
74
+ const [duration, setDuration] = useState(0);
75
+ const [fileSize, setFileSize] = useState(null);
76
+ const [audioType, setAudioType] = useState(null);
77
+ const fileNameFromUrl = getFilenameFromUrl(src);
78
+ const fileName = title?.trim() || fileNameFromUrl;
79
+ const extension = audioType ?? (getFileExtension(fileNameFromUrl).toUpperCase() || 'AUDIO');
80
+ const metadata = fileSize ? `${extension} · ${formatBytes(fileSize, 1)}` : extension;
81
+ const progress = duration > 0 ? (currentTime / duration) * 100 : 0;
82
+ useEffect(() => {
83
+ let cancelled = false;
84
+ fetch(src, { method: 'HEAD' })
85
+ .then((response) => {
86
+ if (cancelled)
87
+ return;
88
+ const length = response.headers.get('Content-Length');
89
+ if (length) {
90
+ const parsed = Number.parseInt(length, 10);
91
+ if (!Number.isNaN(parsed))
92
+ setFileSize(parsed);
93
+ }
94
+ const label = getAudioLabelFromContentType(response.headers.get('Content-Type'));
95
+ if (label)
96
+ setAudioType(label);
97
+ })
98
+ .catch(() => undefined);
99
+ return () => {
100
+ cancelled = true;
101
+ };
102
+ }, [src]);
103
+ useEffect(() => {
104
+ if (!isPlaying)
105
+ return;
106
+ let frameId = 0;
107
+ function updateProgress() {
108
+ const audio = audioRef.current;
109
+ if (audio)
110
+ setCurrentTime(audio.currentTime);
111
+ frameId = requestAnimationFrame(updateProgress);
112
+ }
113
+ frameId = requestAnimationFrame(updateProgress);
114
+ return () => cancelAnimationFrame(frameId);
115
+ }, [isPlaying]);
116
+ async function togglePlayback() {
117
+ const audio = audioRef.current;
118
+ if (!audio)
119
+ return;
120
+ if (isPlaying) {
121
+ audio.pause();
122
+ setIsPlaying(false);
123
+ return;
124
+ }
125
+ try {
126
+ await audio.play();
127
+ setIsPlaying(true);
128
+ }
129
+ catch {
130
+ // Browser cannot play the audio format; leave state unchanged.
131
+ }
132
+ }
133
+ return (_jsxs("figure", { className: cn('glchat-a2ui-audio-player', className), style: { ...audioPlayerRootStyles, ...style }, children: [_jsxs("div", { style: audioPlayerCardStyles, children: [_jsxs("div", { style: audioPlayerHeaderStyles, children: [_jsx("span", { style: audioPlayerTitleStyles, children: fileName }), _jsx("span", { style: audioPlayerMetaStyles, children: metadata })] }), _jsxs("div", { style: audioPlayerControlsStyles, children: [_jsx(Button, { variant: "borderless", onClick: togglePlayback, "aria-label": isPlaying ? 'Pause audio' : 'Play audio', style: audioPlayerIconButtonStyles, children: isPlaying ? (_jsx(Pause, { size: 20, strokeWidth: 1.5 })) : (_jsx(Play, { size: 20, strokeWidth: 1.5 })) }), _jsxs("span", { style: audioPlayerTimeStyles, children: [formatAudioDuration(currentTime), " / ", formatAudioDuration(duration)] }), _jsx("input", { type: "range", min: 0, max: duration || 0, step: "any", value: currentTime, "aria-label": "Audio progress", className: "glchat-a2ui-audio-progress", onChange: (event) => {
134
+ const audio = audioRef.current;
135
+ if (!audio)
136
+ return;
137
+ const nextTime = Number(event.target.value);
138
+ audio.currentTime = nextTime;
139
+ setCurrentTime(nextTime);
140
+ }, style: {
141
+ ...audioPlayerProgressStyles,
142
+ background: `linear-gradient(to right, hsl(var(--primary)) 0%, hsl(var(--primary)) ${progress}%, hsl(var(--border)) ${progress}%, hsl(var(--border)) 100%)`,
143
+ } }), _jsx(ButtonAsLink, { variant: "borderless", href: src, download: fileName, target: "_blank", "aria-label": "Download audio", style: audioPlayerIconButtonStyles, children: _jsx(Download, { size: 16, strokeWidth: 1.5 }) })] })] }), _jsx("audio", { ref: audioRef, src: src, preload: "metadata", style: audioPlayerHiddenAudioStyles, onLoadedMetadata: (event) => setDuration(event.currentTarget.duration), onPlay: () => setIsPlaying(true), onPause: (event) => {
144
+ setIsPlaying(false);
145
+ setCurrentTime(event.currentTarget.currentTime);
146
+ }, onEnded: (event) => {
147
+ setIsPlaying(false);
148
+ setCurrentTime(event.currentTarget.duration);
149
+ }, onTimeUpdate: (event) => {
150
+ const audio = event.currentTarget;
151
+ setCurrentTime(audio.currentTime);
152
+ if (audio.duration !== duration) {
153
+ setDuration(audio.duration);
154
+ }
155
+ }, children: _jsx("track", { kind: "captions", label: fileName }) })] }));
156
+ }
@@ -0,0 +1,12 @@
1
+ import type { CSSProperties } from 'react';
2
+ export declare const audioPlayerRootStyles: CSSProperties;
3
+ export declare const audioPlayerCardStyles: CSSProperties;
4
+ export declare const audioPlayerHeaderStyles: CSSProperties;
5
+ export declare const audioPlayerTitleStyles: CSSProperties;
6
+ export declare const audioPlayerMetaStyles: CSSProperties;
7
+ export declare const audioPlayerControlsStyles: CSSProperties;
8
+ export declare const audioPlayerIconButtonStyles: CSSProperties;
9
+ export declare const audioPlayerTimeStyles: CSSProperties;
10
+ export declare const audioPlayerProgressStyles: CSSProperties;
11
+ export declare const audioPlayerHiddenAudioStyles: CSSProperties;
12
+ //# sourceMappingURL=theme.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/AudioPlayer/theme.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAE3C,eAAO,MAAM,qBAAqB,EAAE,aAInC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,aASnC,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,aAMrC,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,aAQpC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,aAInC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAKvC,CAAC;AAEF,eAAO,MAAM,2BAA2B,EAAE,aAMzC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,aAKnC,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,aAUvC,CAAC;AAEF,eAAO,MAAM,4BAA4B,EAAE,aAE1C,CAAC"}
@@ -0,0 +1,69 @@
1
+ export const audioPlayerRootStyles = {
2
+ width: '100%',
3
+ maxWidth: '100%',
4
+ margin: '1rem 0',
5
+ };
6
+ export const audioPlayerCardStyles = {
7
+ display: 'flex',
8
+ width: '100%',
9
+ flexDirection: 'column',
10
+ gap: '0.375rem',
11
+ borderRadius: 'var(--radius-md)',
12
+ border: '1px solid hsl(var(--border))',
13
+ padding: '0.5rem 0.75rem',
14
+ boxSizing: 'border-box',
15
+ };
16
+ export const audioPlayerHeaderStyles = {
17
+ display: 'flex',
18
+ alignItems: 'center',
19
+ justifyContent: 'space-between',
20
+ gap: '0.5rem',
21
+ minWidth: 0,
22
+ };
23
+ export const audioPlayerTitleStyles = {
24
+ overflow: 'hidden',
25
+ textOverflow: 'ellipsis',
26
+ whiteSpace: 'nowrap',
27
+ fontSize: '0.875rem',
28
+ fontWeight: 600,
29
+ color: 'hsl(var(--foreground))',
30
+ minWidth: 0,
31
+ };
32
+ export const audioPlayerMetaStyles = {
33
+ flexShrink: 0,
34
+ fontSize: '0.75rem',
35
+ color: 'hsl(var(--foreground) / 0.5)',
36
+ };
37
+ export const audioPlayerControlsStyles = {
38
+ display: 'flex',
39
+ alignItems: 'center',
40
+ gap: '0.5rem',
41
+ flexDirection: 'row',
42
+ };
43
+ export const audioPlayerIconButtonStyles = {
44
+ width: '1.75rem',
45
+ height: '1.75rem',
46
+ padding: 0,
47
+ flexShrink: 0,
48
+ borderRadius: 'var(--radius-sm)',
49
+ };
50
+ export const audioPlayerTimeStyles = {
51
+ flexShrink: 0,
52
+ fontSize: '0.75rem',
53
+ fontVariantNumeric: 'tabular-nums',
54
+ color: 'hsl(var(--foreground) / 0.5)',
55
+ };
56
+ export const audioPlayerProgressStyles = {
57
+ height: '0.25rem',
58
+ minWidth: 0,
59
+ flex: 1,
60
+ cursor: 'pointer',
61
+ appearance: 'none',
62
+ WebkitAppearance: 'none',
63
+ borderRadius: '9999px',
64
+ border: 'none',
65
+ outline: 'none',
66
+ };
67
+ export const audioPlayerHiddenAudioStyles = {
68
+ display: 'none',
69
+ };
@@ -1 +1 @@
1
- {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,EAaL,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAMF,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAA8B,EAC9B,QAAgB,EAChB,UAAkB,EAClB,aAAa,EACb,SAAS,EACT,KAAK,GACN,EAAE,QAAQ,CAAC,gBAAgB,CAAC,+BAuS5B"}
1
+ {"version":3,"file":"MultiSelect.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/MultiSelect/MultiSelect.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQ3C,OAAO,EAaL,KAAK,iBAAiB,EACvB,MAAM,YAAY,CAAC;AAEpB,MAAM,MAAM,gBAAgB,GAAG;IAC7B,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,IAAI,CAAC;IACzC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAMF,wBAAgB,WAAW,CAAC,EAC1B,OAAO,EACP,KAAK,EACL,aAAa,EACb,WAA8B,EAC9B,QAAgB,EAChB,UAAkB,EAClB,aAAa,EACb,SAAS,EACT,KAAK,GACN,EAAE,QAAQ,CAAC,gBAAgB,CAAC,+BA2R5B"}
@@ -104,28 +104,22 @@ export function MultiSelect({ options, value, onValueChange, placeholder = 'Sele
104
104
  width: '100%',
105
105
  alignItems: 'center',
106
106
  justifyContent: 'space-between',
107
- }, children: [_jsx("span", { style: multiSelectPlaceholderStyles, children: placeholder }), _jsx(ChevronDown, { style: { height: '1rem', width: '1rem', opacity: 0.5 }, strokeWidth: 1.5, "aria-hidden": true })] })) }), _jsx(PopoverPrimitive.Portal, { children: _jsxs(PopoverPrimitive.Content, { align: "start", sideOffset: 4, className: "glchat-a2ui-multiselect-content", style: multiSelectContentStyles, onEscapeKeyDown: () => setOpen(false), children: [filterable && (_jsx("input", { type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search...", style: multiSelectSearchInputStyles })), _jsxs("div", { style: multiSelectListStyles, children: [options.length > 0 && (_jsxs("button", { type: "button", className: "glchat-a2ui-multiselect-option", style: {
107
+ }, children: [_jsx("span", { style: multiSelectPlaceholderStyles, children: placeholder }), _jsx(ChevronDown, { style: { height: '1rem', width: '1rem', opacity: 0.5 }, strokeWidth: 1.5, "aria-hidden": true })] })) }), _jsx(PopoverPrimitive.Portal, { children: _jsxs(PopoverPrimitive.Content, { align: "start", className: "glchat-a2ui-multiselect-content", style: multiSelectContentStyles, onEscapeKeyDown: () => setOpen(false), children: [filterable && (_jsx("input", { type: "text", value: search, onChange: (e) => setSearch(e.target.value), placeholder: "Search...", style: multiSelectSearchInputStyles })), _jsxs("div", { style: multiSelectListStyles, children: [options.length > 0 && (_jsxs("button", { type: "button", className: "glchat-a2ui-multiselect-option", style: {
108
108
  ...multiSelectOptionStyles,
109
109
  ...(hoveredOption === '__all__' ? optionHoverStyle : {}),
110
- }, onMouseEnter: () => setHoveredOption('__all__'), onMouseLeave: () => setHoveredOption(null), onClick: toggleAll, children: [_jsx("span", { style: isAllSelected
111
- ? multiSelectCheckboxCheckedStyles
112
- : multiSelectCheckboxStyles, children: isAllSelected && (_jsx(Check, { style: { height: '1rem', width: '1rem' }, strokeWidth: 1.5 })) }), _jsx("span", { children: "Select all" })] })), filteredOptions.length === 0 ? (_jsx("div", { style: {
110
+ }, onMouseEnter: () => setHoveredOption('__all__'), onMouseLeave: () => setHoveredOption(null), onClick: toggleAll, children: [_jsx("span", { style: isAllSelected ? multiSelectCheckboxCheckedStyles : multiSelectCheckboxStyles, children: isAllSelected && (_jsx(Check, { style: { height: '1rem', width: '1rem' }, strokeWidth: 1.5 })) }), _jsx("span", { children: "Select all" })] })), filteredOptions.length === 0 ? (_jsx("div", { style: {
113
111
  padding: '0.5rem 0.75rem',
114
112
  fontSize: '0.875rem',
115
113
  color: 'hsl(var(--foreground) / 0.5)',
116
114
  }, children: "No results" })) : (filteredOptions.map((option) => {
117
115
  const isSelected = value.includes(option.value);
118
- const atMax = maxSelections !== void 0 &&
119
- value.length >= maxSelections &&
120
- !isSelected;
116
+ const atMax = maxSelections !== void 0 && value.length >= maxSelections && !isSelected;
121
117
  return (_jsxs("button", { type: "button", className: "glchat-a2ui-multiselect-option", disabled: atMax, style: {
122
118
  ...multiSelectOptionStyles,
123
119
  ...(hoveredOption === option.value ? optionHoverStyle : {}),
124
120
  opacity: atMax ? 0.5 : 1,
125
121
  cursor: atMax ? 'not-allowed' : 'pointer',
126
- }, onMouseEnter: () => setHoveredOption(option.value), onMouseLeave: () => setHoveredOption(null), onClick: () => toggleOption(option.value), children: [_jsx("span", { style: isSelected
127
- ? multiSelectCheckboxCheckedStyles
128
- : multiSelectCheckboxStyles, children: isSelected && (_jsx(Check, { style: { height: '1rem', width: '1rem' }, strokeWidth: 1.5 })) }), _jsx("span", { style: {
122
+ }, onMouseEnter: () => setHoveredOption(option.value), onMouseLeave: () => setHoveredOption(null), onClick: () => toggleOption(option.value), children: [_jsx("span", { style: isSelected ? multiSelectCheckboxCheckedStyles : multiSelectCheckboxStyles, children: isSelected && (_jsx(Check, { style: { height: '1rem', width: '1rem' }, strokeWidth: 1.5 })) }), _jsx("span", { style: {
129
123
  overflow: 'hidden',
130
124
  display: '-webkit-box',
131
125
  WebkitLineClamp: 2,
@@ -1 +1 @@
1
- {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/Select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAa3C,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAM1C,QAAA,MAAM,aAAa;YAHT,aAAa;2CAqBrB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAOH,QAAA,MAAM,aAAa;YAHT,aAAa;wCAiCrB,CAAC;AAOH,QAAA,MAAM,UAAU;YAHN,aAAa;wCAoBrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,WAAW,GACZ,CAAC"}
1
+ {"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../../../src/components/ui/Select/Select.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,eAAe,MAAM,wBAAwB,CAAC;AAE1D,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAa3C,QAAA,MAAM,MAAM,uCAAuB,CAAC;AAEpC,QAAA,MAAM,WAAW,yGAAwB,CAAC;AAE1C,QAAA,MAAM,WAAW,0GAAwB,CAAC;AAM1C,QAAA,MAAM,aAAa;YAHT,aAAa;2CAqBrB,CAAC;AAGH,QAAA,MAAM,oBAAoB,qKAWxB,CAAC;AAGH,QAAA,MAAM,sBAAsB,uKAW1B,CAAC;AAOH,QAAA,MAAM,aAAa;YAHT,aAAa;wCAkCrB,CAAC;AAOH,QAAA,MAAM,UAAU;YAHN,aAAa;wCAoBrB,CAAC;AAGH,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,WAAW,GACZ,CAAC"}
@@ -14,7 +14,7 @@ const SelectScrollUpButton = React.forwardRef(({ style, ...props }, ref) => (_js
14
14
  SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
15
15
  const SelectScrollDownButton = React.forwardRef(({ style, ...props }, ref) => (_jsx(SelectPrimitive.ScrollDownButton, { ref: ref, style: { ...selectScrollButtonStyles, ...style }, ...props, children: _jsx(ChevronDown, { style: { height: '1rem', width: '1rem' }, "aria-hidden": true }) })));
16
16
  SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
17
- const SelectContent = React.forwardRef(({ className, children, position = 'popper', style, ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: className, position: position, style: { ...selectContentStyles, ...style }, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { style: position === 'popper'
17
+ const SelectContent = React.forwardRef(({ className, children, position = 'popper', style, sideOffset = 0, ...props }, ref) => (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { ref: ref, className: className, position: position, sideOffset: sideOffset, style: { ...selectContentStyles, ...style }, ...props, children: [_jsx(SelectScrollUpButton, {}), _jsx(SelectPrimitive.Viewport, { style: position === 'popper'
18
18
  ? {
19
19
  ...selectViewportStyles,
20
20
  height: 'var(--radix-select-trigger-height)',
@@ -10,8 +10,8 @@ export declare const GLCHAT_CATALOG_OVERRIDES: readonly ["Button"];
10
10
  export declare const GLCHAT_CATALOG_EXTENSIONS: readonly ["TagInput", "Timeout"];
11
11
  /**
12
12
  * Builds the GLChat A2UI v0.9 catalog:
13
- * - Includes basic catalog components except those GLChat overrides (`Button`, `ChoicePicker`).
14
- * - Adds GLChat overrides and extensions (`Button`, `ChoicePicker`, `TagInput`, `Timeout`).
13
+ * - Includes basic catalog components except those GLChat overrides (`AudioPlayer`, `Button`, `ChoicePicker`).
14
+ * - Adds GLChat overrides and extensions (`AudioPlayer`, `Button`, `ChoicePicker`, `TagInput`, `Timeout`).
15
15
  * - Reuses basic catalog functions unchanged.
16
16
  */
17
17
  export declare function createGlchatCatalog(): Catalog<ReactComponentImplementation>;
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/v0_9/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAOhE;;GAEG;AACH,eAAO,MAAM,iBAAiB,iIACkG,CAAC;AAKjI,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,qBAAsB,CAAC;AAE5D,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,kCAAmC,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,4BAA4B,CAAC,CAgB3E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,WAAW,EAAE,EACvB,YAAY,EAAE,MAAM,GACnB,WAAW,EAAE,CAqBf"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../../src/v0_9/catalog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,4BAA4B,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQhE;;GAEG;AACH,eAAO,MAAM,iBAAiB,iIACkG,CAAC;AAKjI,0EAA0E;AAC1E,eAAO,MAAM,wBAAwB,qBAAsB,CAAC;AAE5D,+DAA+D;AAC/D,eAAO,MAAM,yBAAyB,kCAAmC,CAAC;AAE1E;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,OAAO,CAAC,4BAA4B,CAAC,CAiB3E;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CACnC,QAAQ,EAAE,WAAW,EAAE,EACvB,YAAY,EAAE,MAAM,GACnB,WAAW,EAAE,CAqBf"}
@@ -1,5 +1,6 @@
1
1
  import { basicCatalog } from '@a2ui/react/v0_9';
2
2
  import { Catalog } from '@a2ui/web_core/v0_9';
3
+ import { GlchatAudioPlayerComponent } from '../components/a2ui/v0_9/AudioPlayer/AudioPlayer.js';
3
4
  import { GlchatButtonComponent } from '../components/a2ui/v0_9/Button/Button.js';
4
5
  import { GlchatChoicePickerComponent } from '../components/a2ui/v0_9/ChoicePicker/ChoicePicker.js';
5
6
  import { GlchatTagInputComponent } from '../components/a2ui/v0_9/TagInput/TagInput.js';
@@ -9,21 +10,22 @@ import { GlchatTimeoutComponent } from '../components/a2ui/v0_9/Timeout/Timeout.
9
10
  */
10
11
  export const GLCHAT_CATALOG_ID = 'https://github.com/GDP-ADMIN/glchat-sdk/blob/main/js/glchat-a2ui-react-renderer/json/glchat_standard_catalog_definition.json';
11
12
  /** Basic catalog components overridden at runtime by GLChat implementations. */
12
- const OVERRIDDEN_COMPONENTS = new Set(['Button', 'ChoicePicker']);
13
+ const OVERRIDDEN_COMPONENTS = new Set(['AudioPlayer', 'Button', 'ChoicePicker']);
13
14
  /** Basic catalog components whose JSON Schema is regenerated from Zod. */
14
15
  export const GLCHAT_CATALOG_OVERRIDES = ['Button'];
15
16
  /** GLChat-only components not present in the basic catalog. */
16
17
  export const GLCHAT_CATALOG_EXTENSIONS = ['TagInput', 'Timeout'];
17
18
  /**
18
19
  * Builds the GLChat A2UI v0.9 catalog:
19
- * - Includes basic catalog components except those GLChat overrides (`Button`, `ChoicePicker`).
20
- * - Adds GLChat overrides and extensions (`Button`, `ChoicePicker`, `TagInput`, `Timeout`).
20
+ * - Includes basic catalog components except those GLChat overrides (`AudioPlayer`, `Button`, `ChoicePicker`).
21
+ * - Adds GLChat overrides and extensions (`AudioPlayer`, `Button`, `ChoicePicker`, `TagInput`, `Timeout`).
21
22
  * - Reuses basic catalog functions unchanged.
22
23
  */
23
24
  export function createGlchatCatalog() {
24
25
  const baseComponents = Array.from(basicCatalog.components.values()).filter((component) => !OVERRIDDEN_COMPONENTS.has(component.name));
25
26
  const components = [
26
27
  ...baseComponents,
28
+ GlchatAudioPlayerComponent,
27
29
  GlchatButtonComponent,
28
30
  GlchatChoicePickerComponent,
29
31
  GlchatTagInputComponent,
@@ -907,24 +907,11 @@
907
907
  "id": "catalog-modal",
908
908
  "component": {
909
909
  "Modal": {
910
- "entryPointChild": "modal-open-btn",
910
+ "entryPointChild": "modal-open-text",
911
911
  "contentChild": "modal-body-col"
912
912
  }
913
913
  }
914
914
  },
915
- {
916
- "id": "modal-open-btn",
917
- "component": {
918
- "Button": {
919
- "child": "modal-open-text",
920
- "action": {
921
- "name": "modal_open",
922
- "context": []
923
- },
924
- "primary": false
925
- }
926
- }
927
- },
928
915
  {
929
916
  "id": "modal-open-text",
930
917
  "component": {
@@ -386,7 +386,7 @@
386
386
  "properties": {
387
387
  "entryPointChild": {
388
388
  "type": "string",
389
- "description": "The ID of the component that opens the modal when interacted with (e.g., a button)."
389
+ "description": "The ID of the component that opens the modal when interacted with (e.g. Text). Do NOT use Button as the entry point — Modal opens locally on click, and Button would also dispatch an action."
390
390
  },
391
391
  "contentChild": {
392
392
  "type": "string",
@@ -520,7 +520,7 @@
520
520
  },
521
521
  "trigger": {
522
522
  "$ref": "common_types.json#/$defs/ComponentId",
523
- "description": "The ID of the component that opens the modal when interacted with (e.g., a button). Do NOT define the component inline."
523
+ "description": "The ID of the component that opens the modal when interacted with (e.g. Text). Do NOT use Button as the trigger — Modal opens locally on click, and Button would also dispatch an action. Do NOT define the component inline."
524
524
  },
525
525
  "content": {
526
526
  "$ref": "common_types.json#/$defs/ComponentId",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glchat-a2ui-react-renderer",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
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",
@@ -135,6 +135,10 @@
135
135
  --a2ui-card-box-shadow: none;
136
136
  --a2ui-card-margin: 0;
137
137
 
138
+ /** Modal */
139
+ --a2ui-modal-border-radius: var(--radius);
140
+ --a2ui-modal-min-width: 20rem;
141
+
138
142
  /** TextField */
139
143
  --a2ui-color-input: hsl(var(--background));
140
144
  --a2ui-color-on-input: hsl(var(--foreground));
@@ -227,6 +231,51 @@
227
231
  width: 100%;
228
232
  }
229
233
 
234
+ /* AudioPlayer — custom progress range thumbs (pseudo-elements need CSS) */
235
+ .a2ui-surface .glchat-a2ui-audio-progress::-webkit-slider-thumb {
236
+ width: 0.75rem;
237
+ height: 0.75rem;
238
+ cursor: pointer;
239
+ appearance: none;
240
+ -webkit-appearance: none;
241
+ border: 0;
242
+ border-radius: 9999px;
243
+ background-color: hsl(var(--primary));
244
+ }
245
+
246
+ .a2ui-surface .glchat-a2ui-audio-progress::-moz-range-thumb {
247
+ width: 0.75rem;
248
+ height: 0.75rem;
249
+ cursor: pointer;
250
+ appearance: none;
251
+ border: 0;
252
+ border-radius: 9999px;
253
+ background-color: hsl(var(--primary));
254
+ }
255
+
256
+ /* Modal trigger — clickable affordance (v0.9 `.a2ui-modal-trigger`, v0.8 `.a2ui-modal > section`) */
257
+ .a2ui-surface .a2ui-modal-trigger,
258
+ .a2ui-surface .a2ui-modal > section {
259
+ cursor: pointer;
260
+ width: fit-content;
261
+ }
262
+
263
+ /* Modal panel — v0.9 overlay content; v0.8 dialog body */
264
+ .a2ui-surface .a2ui-modal-overlay > div,
265
+ .a2ui-surface .a2ui-modal dialog > section {
266
+ min-width: min(var(--a2ui-modal-min-width), 100%);
267
+ box-sizing: border-box;
268
+ }
269
+
270
+ /*
271
+ * Vertical Divider (v0.9): upstream sets inline height: 100%, which collapses to 0
272
+ * in content-sized Rows. No class is emitted, so match via --a2ui-divider-spacing.
273
+ */
274
+ .a2ui-surface [style*='height: 100%'][style*='--a2ui-divider-spacing'] {
275
+ height: auto !important;
276
+ align-self: stretch;
277
+ }
278
+
230
279
  /* Button */
231
280
  .a2ui-surface .a2ui-button > button.glchat-a2ui-button {
232
281
  font-weight: 600 !important;