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

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.
@@ -62,7 +62,7 @@ declare const audioRecorderVariants: (props?: ({
62
62
  variant?: "default" | "minimal" | "elevated" | null | undefined;
63
63
  } & class_variance_authority_types.ClassProp) | undefined) => string;
64
64
  declare const waveformContainerVariants: (props?: ({
65
- state?: "paused" | "idle" | "listening" | "recording" | "stopped" | "playback" | null | undefined;
65
+ state?: "paused" | "idle" | "recording" | "listening" | "stopped" | "playback" | null | undefined;
66
66
  } & class_variance_authority_types.ClassProp) | undefined) => string;
67
67
  declare const controlButtonVariants: (props?: ({
68
68
  variant?: "primary" | "secondary" | "ghost" | "danger" | null | undefined;
@@ -62,7 +62,7 @@ declare const audioRecorderVariants: (props?: ({
62
62
  variant?: "default" | "minimal" | "elevated" | null | undefined;
63
63
  } & class_variance_authority_types.ClassProp) | undefined) => string;
64
64
  declare const waveformContainerVariants: (props?: ({
65
- state?: "paused" | "idle" | "listening" | "recording" | "stopped" | "playback" | null | undefined;
65
+ state?: "paused" | "idle" | "recording" | "listening" | "stopped" | "playback" | null | undefined;
66
66
  } & class_variance_authority_types.ClassProp) | undefined) => string;
67
67
  declare const controlButtonVariants: (props?: ({
68
68
  variant?: "primary" | "secondary" | "ghost" | "danger" | null | undefined;
package/dist/index.cjs CHANGED
@@ -3123,6 +3123,8 @@ var MessageComposer = React48__namespace.forwardRef(
3123
3123
  onSend,
3124
3124
  onTypingStart,
3125
3125
  onTypingStop,
3126
+ value: controlledValue,
3127
+ onValueChange,
3126
3128
  placeholder = "Type a message...",
3127
3129
  maxLength = 1600,
3128
3130
  showCharacterCount = false,
@@ -3138,10 +3140,24 @@ var MessageComposer = React48__namespace.forwardRef(
3138
3140
  replyTo = null,
3139
3141
  onCancelReply,
3140
3142
  variant = "default",
3143
+ inputTrailing,
3141
3144
  className
3142
3145
  }, ref) => {
3143
3146
  const textareaRef = React48__namespace.useRef(null);
3144
- const [content, setContent] = React48__namespace.useState("");
3147
+ const [internalContent, setInternalContent] = React48__namespace.useState("");
3148
+ const isControlled = controlledValue !== void 0;
3149
+ const content = isControlled ? controlledValue : internalContent;
3150
+ const setContent = React48__namespace.useCallback(
3151
+ (val) => {
3152
+ if (isControlled) {
3153
+ const newVal = typeof val === "function" ? val(controlledValue) : val;
3154
+ onValueChange?.(newVal);
3155
+ } else {
3156
+ setInternalContent(val);
3157
+ }
3158
+ },
3159
+ [isControlled, controlledValue, onValueChange]
3160
+ );
3145
3161
  const [attachments, setAttachments] = React48__namespace.useState(
3146
3162
  []
3147
3163
  );
@@ -3383,7 +3399,8 @@ var MessageComposer = React48__namespace.forwardRef(
3383
3399
  disabled: disabled || isSending,
3384
3400
  rows: 1,
3385
3401
  className: chunkOR5DRJCW_cjs.cn(
3386
- "w-full resize-none rounded-2xl px-4 py-2.5",
3402
+ "w-full resize-none rounded-2xl py-2.5",
3403
+ inputTrailing ? "pr-10 pl-4" : "px-4",
3387
3404
  "bg-neutral-100 dark:bg-neutral-800",
3388
3405
  "text-neutral-900 dark:text-neutral-100",
3389
3406
  "placeholder:text-neutral-400 dark:placeholder:text-neutral-500",
@@ -3396,6 +3413,14 @@ var MessageComposer = React48__namespace.forwardRef(
3396
3413
  "aria-describedby": showCharacterCount ? "char-count" : void 0
3397
3414
  }
3398
3415
  ),
3416
+ inputTrailing && /* @__PURE__ */ jsxRuntime.jsx(
3417
+ "div",
3418
+ {
3419
+ "data-slot": "composer-input-trailing",
3420
+ className: "pointer-events-none absolute top-0 right-1 flex h-[44px] items-center [&>*]:pointer-events-auto",
3421
+ children: inputTrailing
3422
+ }
3423
+ ),
3399
3424
  showCharacterCount && /* @__PURE__ */ jsxRuntime.jsx(
3400
3425
  "div",
3401
3426
  {
@@ -4671,6 +4696,9 @@ function AIChat({
4671
4696
  size,
4672
4697
  height,
4673
4698
  composerProps,
4699
+ talkToText = false,
4700
+ onRecordingStart,
4701
+ onRecordingComplete,
4674
4702
  className,
4675
4703
  onSendMessage,
4676
4704
  onToolCall: _onToolCall,
@@ -4825,6 +4853,18 @@ function AIChat({
4825
4853
  showCameraButton: false,
4826
4854
  showCharacterCount: false,
4827
4855
  variant: "minimal",
4856
+ inputTrailing: talkToText ? /* @__PURE__ */ jsxRuntime.jsx(
4857
+ chunkK7IGBNZA_cjs.RecordButton,
4858
+ {
4859
+ variant: "ghost",
4860
+ size: "sm",
4861
+ showPulse: false,
4862
+ showWaveform: true,
4863
+ disabled: isGenerating,
4864
+ onRecordingStart,
4865
+ onRecordingComplete
4866
+ }
4867
+ ) : void 0,
4828
4868
  ...composerProps
4829
4869
  }
4830
4870
  )