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

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
@@ -1085,6 +1085,8 @@ interface MessageComposerProps {
1085
1085
  onCancelReply?: () => void;
1086
1086
  /** Visual variant - 'default' shows border-t, 'minimal' has no border */
1087
1087
  variant?: 'default' | 'minimal';
1088
+ /** Content to render inside the input wrapper (e.g. a mic button) */
1089
+ inputTrailing?: React$1.ReactNode;
1088
1090
  /** Additional class name */
1089
1091
  className?: string;
1090
1092
  }
@@ -1139,6 +1141,10 @@ interface AIChatProps extends VariantProps<typeof chatVariants>, AIChatCallbacks
1139
1141
  height?: string | number;
1140
1142
  /** Props to pass to the MessageComposer */
1141
1143
  composerProps?: Partial<MessageComposerProps>;
1144
+ /** Enable talk-to-text microphone button inside the input */
1145
+ talkToText?: boolean;
1146
+ /** Callback when recording completes (receives audio blob and duration) */
1147
+ onRecordingComplete?: (blob: Blob, duration: number) => void;
1142
1148
  /** Callback when close button is clicked (shows close button when provided) */
1143
1149
  onClose?: () => void;
1144
1150
  /**
@@ -1153,7 +1159,7 @@ interface AIChatProps extends VariantProps<typeof chatVariants>, AIChatCallbacks
1153
1159
  * A complete AI chat interface with message history, input, and tool call support.
1154
1160
  * Reuses MessageComposer from the Messaging components for consistent UX.
1155
1161
  */
1156
- declare function AIChat({ session, messages: messagesProp, isGenerating: isGeneratingProp, userName, title, suggestions, showHeader, showTimestamps, inputPlaceholder, variant, size, height, composerProps, className, onSendMessage, onToolCall: _onToolCall, onResourceClick, onSuggestedAction, onCancel, onClear, onClose, renderTextContent, }: AIChatProps): react_jsx_runtime.JSX.Element;
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;
1157
1163
 
1158
1164
  interface AIChatTriggerProps {
1159
1165
  /** Whether the chat is open */
package/dist/index.d.ts CHANGED
@@ -1085,6 +1085,8 @@ interface MessageComposerProps {
1085
1085
  onCancelReply?: () => void;
1086
1086
  /** Visual variant - 'default' shows border-t, 'minimal' has no border */
1087
1087
  variant?: 'default' | 'minimal';
1088
+ /** Content to render inside the input wrapper (e.g. a mic button) */
1089
+ inputTrailing?: React$1.ReactNode;
1088
1090
  /** Additional class name */
1089
1091
  className?: string;
1090
1092
  }
@@ -1139,6 +1141,10 @@ interface AIChatProps extends VariantProps<typeof chatVariants>, AIChatCallbacks
1139
1141
  height?: string | number;
1140
1142
  /** Props to pass to the MessageComposer */
1141
1143
  composerProps?: Partial<MessageComposerProps>;
1144
+ /** Enable talk-to-text microphone button inside the input */
1145
+ talkToText?: boolean;
1146
+ /** Callback when recording completes (receives audio blob and duration) */
1147
+ onRecordingComplete?: (blob: Blob, duration: number) => void;
1142
1148
  /** Callback when close button is clicked (shows close button when provided) */
1143
1149
  onClose?: () => void;
1144
1150
  /**
@@ -1153,7 +1159,7 @@ interface AIChatProps extends VariantProps<typeof chatVariants>, AIChatCallbacks
1153
1159
  * A complete AI chat interface with message history, input, and tool call support.
1154
1160
  * Reuses MessageComposer from the Messaging components for consistent UX.
1155
1161
  */
1156
- declare function AIChat({ session, messages: messagesProp, isGenerating: isGeneratingProp, userName, title, suggestions, showHeader, showTimestamps, inputPlaceholder, variant, size, height, composerProps, className, onSendMessage, onToolCall: _onToolCall, onResourceClick, onSuggestedAction, onCancel, onClear, onClose, renderTextContent, }: AIChatProps): react_jsx_runtime.JSX.Element;
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;
1157
1163
 
1158
1164
  interface AIChatTriggerProps {
1159
1165
  /** Whether the chat is open */
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ export { VisuallyHidden } from './chunk-H2CIKJQI.js';
25
25
  export { QuickAction, QuickActionGroup, QuickActionIcons, quickActionIconVariants, quickActionVariants } from './chunk-3CJBUAJ4.js';
26
26
  import { RadioGroup, Radio } from './chunk-EZKRAW2X.js';
27
27
  export { Radio, RadioGroup, radioVariants } from './chunk-EZKRAW2X.js';
28
+ import { RecordButton } from './chunk-QVJBUWJQ.js';
28
29
  export { RecordButton, formatDuration, recordButtonVariants } from './chunk-QVJBUWJQ.js';
29
30
  export { DateButton, DatePicker, RadioOption, SchedulePicker, TimeButton, TimePicker, dateButtonVariants, radioOptionVariants, timeButtonVariants } from './chunk-4DMZAVB2.js';
30
31
  import { Select } from './chunk-R25H4N4Z.js';
@@ -3145,6 +3146,7 @@ var MessageComposer = React48.forwardRef(
3145
3146
  replyTo = null,
3146
3147
  onCancelReply,
3147
3148
  variant = "default",
3149
+ inputTrailing,
3148
3150
  className
3149
3151
  }, ref) => {
3150
3152
  const textareaRef = React48.useRef(null);
@@ -3390,7 +3392,8 @@ var MessageComposer = React48.forwardRef(
3390
3392
  disabled: disabled || isSending,
3391
3393
  rows: 1,
3392
3394
  className: cn(
3393
- "w-full resize-none rounded-2xl px-4 py-2.5",
3395
+ "w-full resize-none rounded-2xl py-2.5",
3396
+ inputTrailing ? "pr-10 pl-4" : "px-4",
3394
3397
  "bg-neutral-100 dark:bg-neutral-800",
3395
3398
  "text-neutral-900 dark:text-neutral-100",
3396
3399
  "placeholder:text-neutral-400 dark:placeholder:text-neutral-500",
@@ -3403,6 +3406,14 @@ var MessageComposer = React48.forwardRef(
3403
3406
  "aria-describedby": showCharacterCount ? "char-count" : void 0
3404
3407
  }
3405
3408
  ),
3409
+ inputTrailing && /* @__PURE__ */ jsx(
3410
+ "div",
3411
+ {
3412
+ "data-slot": "composer-input-trailing",
3413
+ className: "pointer-events-none absolute top-0 right-1 flex h-[44px] items-center [&>*]:pointer-events-auto",
3414
+ children: inputTrailing
3415
+ }
3416
+ ),
3406
3417
  showCharacterCount && /* @__PURE__ */ jsx(
3407
3418
  "div",
3408
3419
  {
@@ -4678,6 +4689,8 @@ function AIChat({
4678
4689
  size,
4679
4690
  height,
4680
4691
  composerProps,
4692
+ talkToText = false,
4693
+ onRecordingComplete,
4681
4694
  className,
4682
4695
  onSendMessage,
4683
4696
  onToolCall: _onToolCall,
@@ -4832,6 +4845,17 @@ function AIChat({
4832
4845
  showCameraButton: false,
4833
4846
  showCharacterCount: false,
4834
4847
  variant: "minimal",
4848
+ inputTrailing: talkToText ? /* @__PURE__ */ jsx(
4849
+ RecordButton,
4850
+ {
4851
+ variant: "ghost",
4852
+ size: "sm",
4853
+ showPulse: false,
4854
+ showWaveform: true,
4855
+ disabled: isGenerating,
4856
+ onRecordingComplete
4857
+ }
4858
+ ) : void 0,
4835
4859
  ...composerProps
4836
4860
  }
4837
4861
  )