@mieweb/ui 0.6.1-dev.124 → 0.6.1-dev.126

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.cts CHANGED
@@ -1051,6 +1051,10 @@ interface MessageComposerProps {
1051
1051
  onTypingStart?: () => void;
1052
1052
  /** Called when the user stops typing */
1053
1053
  onTypingStop?: () => void;
1054
+ /** Controlled value for the textarea */
1055
+ value?: string;
1056
+ /** Callback when value changes (for controlled mode) */
1057
+ onValueChange?: (value: string) => void;
1054
1058
  /** Placeholder text */
1055
1059
  placeholder?: string;
1056
1060
  /** Maximum message length */
@@ -1143,6 +1147,8 @@ interface AIChatProps extends VariantProps<typeof chatVariants>, AIChatCallbacks
1143
1147
  composerProps?: Partial<MessageComposerProps>;
1144
1148
  /** Enable talk-to-text microphone button inside the input */
1145
1149
  talkToText?: boolean;
1150
+ /** Callback when recording starts */
1151
+ onRecordingStart?: () => void;
1146
1152
  /** Callback when recording completes (receives audio blob and duration) */
1147
1153
  onRecordingComplete?: (blob: Blob, duration: number) => void;
1148
1154
  /** Callback when close button is clicked (shows close button when provided) */
@@ -1159,7 +1165,7 @@ interface AIChatProps extends VariantProps<typeof chatVariants>, AIChatCallbacks
1159
1165
  * A complete AI chat interface with message history, input, and tool call support.
1160
1166
  * Reuses MessageComposer from the Messaging components for consistent UX.
1161
1167
  */
1162
- declare function AIChat({ session, messages: messagesProp, isGenerating: isGeneratingProp, userName, title, suggestions, showHeader, showTimestamps, inputPlaceholder, variant, size, height, composerProps, talkToText, onRecordingComplete, className, onSendMessage, onToolCall: _onToolCall, onResourceClick, onSuggestedAction, onCancel, onClear, onClose, renderTextContent, }: AIChatProps): react_jsx_runtime.JSX.Element;
1168
+ declare function AIChat({ session, messages: messagesProp, isGenerating: isGeneratingProp, userName, title, suggestions, showHeader, showTimestamps, inputPlaceholder, variant, size, height, composerProps, talkToText, onRecordingStart, onRecordingComplete, className, onSendMessage, onToolCall: _onToolCall, onResourceClick, onSuggestedAction, onCancel, onClear, onClose, renderTextContent, }: AIChatProps): react_jsx_runtime.JSX.Element;
1163
1169
 
1164
1170
  interface AIChatTriggerProps {
1165
1171
  /** Whether the chat is open */
package/dist/index.d.ts CHANGED
@@ -1051,6 +1051,10 @@ interface MessageComposerProps {
1051
1051
  onTypingStart?: () => void;
1052
1052
  /** Called when the user stops typing */
1053
1053
  onTypingStop?: () => void;
1054
+ /** Controlled value for the textarea */
1055
+ value?: string;
1056
+ /** Callback when value changes (for controlled mode) */
1057
+ onValueChange?: (value: string) => void;
1054
1058
  /** Placeholder text */
1055
1059
  placeholder?: string;
1056
1060
  /** Maximum message length */
@@ -1143,6 +1147,8 @@ interface AIChatProps extends VariantProps<typeof chatVariants>, AIChatCallbacks
1143
1147
  composerProps?: Partial<MessageComposerProps>;
1144
1148
  /** Enable talk-to-text microphone button inside the input */
1145
1149
  talkToText?: boolean;
1150
+ /** Callback when recording starts */
1151
+ onRecordingStart?: () => void;
1146
1152
  /** Callback when recording completes (receives audio blob and duration) */
1147
1153
  onRecordingComplete?: (blob: Blob, duration: number) => void;
1148
1154
  /** Callback when close button is clicked (shows close button when provided) */
@@ -1159,7 +1165,7 @@ interface AIChatProps extends VariantProps<typeof chatVariants>, AIChatCallbacks
1159
1165
  * A complete AI chat interface with message history, input, and tool call support.
1160
1166
  * Reuses MessageComposer from the Messaging components for consistent UX.
1161
1167
  */
1162
- declare function AIChat({ session, messages: messagesProp, isGenerating: isGeneratingProp, userName, title, suggestions, showHeader, showTimestamps, inputPlaceholder, variant, size, height, composerProps, talkToText, onRecordingComplete, className, onSendMessage, onToolCall: _onToolCall, onResourceClick, onSuggestedAction, onCancel, onClear, onClose, renderTextContent, }: AIChatProps): react_jsx_runtime.JSX.Element;
1168
+ declare function AIChat({ session, messages: messagesProp, isGenerating: isGeneratingProp, userName, title, suggestions, showHeader, showTimestamps, inputPlaceholder, variant, size, height, composerProps, talkToText, onRecordingStart, onRecordingComplete, className, onSendMessage, onToolCall: _onToolCall, onResourceClick, onSuggestedAction, onCancel, onClear, onClose, renderTextContent, }: AIChatProps): react_jsx_runtime.JSX.Element;
1163
1169
 
1164
1170
  interface AIChatTriggerProps {
1165
1171
  /** Whether the chat is open */
package/dist/index.js CHANGED
@@ -3131,6 +3131,8 @@ var MessageComposer = React48.forwardRef(
3131
3131
  onSend,
3132
3132
  onTypingStart,
3133
3133
  onTypingStop,
3134
+ value: controlledValue,
3135
+ onValueChange,
3134
3136
  placeholder = "Type a message...",
3135
3137
  maxLength = 1600,
3136
3138
  showCharacterCount = false,
@@ -3150,7 +3152,20 @@ var MessageComposer = React48.forwardRef(
3150
3152
  className
3151
3153
  }, ref) => {
3152
3154
  const textareaRef = React48.useRef(null);
3153
- const [content, setContent] = React48.useState("");
3155
+ const [internalContent, setInternalContent] = React48.useState("");
3156
+ const isControlled = controlledValue !== void 0;
3157
+ const content = isControlled ? controlledValue : internalContent;
3158
+ const setContent = React48.useCallback(
3159
+ (val) => {
3160
+ if (isControlled) {
3161
+ const newVal = typeof val === "function" ? val(controlledValue) : val;
3162
+ onValueChange?.(newVal);
3163
+ } else {
3164
+ setInternalContent(val);
3165
+ }
3166
+ },
3167
+ [isControlled, controlledValue, onValueChange]
3168
+ );
3154
3169
  const [attachments, setAttachments] = React48.useState(
3155
3170
  []
3156
3171
  );
@@ -4690,6 +4705,7 @@ function AIChat({
4690
4705
  height,
4691
4706
  composerProps,
4692
4707
  talkToText = false,
4708
+ onRecordingStart,
4693
4709
  onRecordingComplete,
4694
4710
  className,
4695
4711
  onSendMessage,
@@ -4853,6 +4869,7 @@ function AIChat({
4853
4869
  showPulse: false,
4854
4870
  showWaveform: true,
4855
4871
  disabled: isGenerating,
4872
+ onRecordingStart,
4856
4873
  onRecordingComplete
4857
4874
  }
4858
4875
  ) : void 0,