@epicbagel/saas-kit 1.11.0 → 1.12.0

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.
Files changed (30) hide show
  1. package/README.md +34 -12
  2. package/dist/{chunk-ZZ7ICQR2.cjs → chunk-7Q4EFCUI.cjs} +93 -28
  3. package/dist/chunk-JKVVTFAP.js +294 -0
  4. package/dist/{chunk-UOVA4YKW.js → chunk-KF4X37DP.js} +2 -15
  5. package/dist/chunk-QWUMIAYD.cjs +294 -0
  6. package/dist/{chunk-HLAHOVEI.js → chunk-RPSRCB5O.js} +79 -14
  7. package/dist/{chunk-7QTFYEPE.cjs → chunk-YMI3X2YL.cjs} +2 -15
  8. package/dist/hooks/use-dictation.cjs +2 -2
  9. package/dist/hooks/use-dictation.d.cts +27 -5
  10. package/dist/hooks/use-dictation.d.ts +27 -5
  11. package/dist/hooks/use-dictation.js +1 -1
  12. package/dist/primitives/chat.cjs +17 -13
  13. package/dist/primitives/chat.d.cts +13 -6
  14. package/dist/primitives/chat.d.ts +13 -6
  15. package/dist/primitives/chat.js +12 -8
  16. package/dist/primitives/dictation-provider.cjs +2 -2
  17. package/dist/primitives/dictation-provider.d.cts +1 -1
  18. package/dist/primitives/dictation-provider.d.ts +1 -1
  19. package/dist/primitives/dictation-provider.js +1 -1
  20. package/dist/primitives/voice-dictation-button.cjs +3 -3
  21. package/dist/primitives/voice-dictation-button.d.cts +8 -6
  22. package/dist/primitives/voice-dictation-button.d.ts +8 -6
  23. package/dist/primitives/voice-dictation-button.js +2 -2
  24. package/dist/primitives/voice-session-controls.cjs +2 -2
  25. package/dist/primitives/voice-session-controls.d.cts +2 -2
  26. package/dist/primitives/voice-session-controls.d.ts +2 -2
  27. package/dist/primitives/voice-session-controls.js +1 -1
  28. package/package.json +1 -1
  29. package/dist/chunk-KQBXAQAY.cjs +0 -221
  30. package/dist/chunk-T3XMHWYV.js +0 -221
@@ -9,8 +9,27 @@ interface DictationTranscribeOptions {
9
9
  }
10
10
  /** The host authenticates this request; provider credentials never belong in the kit. */
11
11
  type DictationTranscribe = (audio: Blob, options: DictationTranscribeOptions) => Promise<string>;
12
+ interface DictationStreamOptions extends DictationTranscribeOptions {
13
+ /** Replace the current preview. These updates must never save a note. */
14
+ onTranscript: (preview: {
15
+ transcript: string;
16
+ interimTranscript: string;
17
+ }) => void;
18
+ onError: (error: Error) => void;
19
+ }
20
+ interface DictationStreamSession {
21
+ /** Drain the final audio and resolve the complete, final transcript. */
22
+ finish: () => Promise<string>;
23
+ /** Release the transport without committing any text. Must be idempotent. */
24
+ cancel: () => void;
25
+ }
26
+ /** The host owns transport/authentication; use the supplied microphone stream. */
27
+ type DictationStream = (audio: MediaStream, options: DictationStreamOptions) => Promise<DictationStreamSession>;
12
28
  interface DictationProviderProps {
13
- transcribe: DictationTranscribe;
29
+ /** Complete-recording transcription, also used to retry a failed stream. */
30
+ transcribe?: DictationTranscribe;
31
+ /** Optional live transcription. Preview events never invoke onTranscript. */
32
+ stream?: DictationStream;
14
33
  /** Change when the acting user or workspace changes to discard its active take. */
15
34
  scopeKey?: string;
16
35
  children: ReactNode;
@@ -22,12 +41,13 @@ type DictationScope = {
22
41
  };
23
42
  };
24
43
  type DictationContextValue = {
25
- transcribe: DictationTranscribe;
44
+ transcribe?: DictationTranscribe;
45
+ stream?: DictationStream;
26
46
  scope: DictationScope;
27
47
  generation: number;
28
48
  };
29
- /** Use recorded audio + the host's API for every descendant dictation control. */
30
- declare function DictationProvider({ transcribe, scopeKey, children }: DictationProviderProps): React.FunctionComponentElement<React.ProviderProps<DictationContextValue | null>>;
49
+ /** Use the host's live or recorded-audio API for every descendant control. */
50
+ declare function DictationProvider({ transcribe, stream, scopeKey, children }: DictationProviderProps): React.FunctionComponentElement<React.ProviderProps<DictationContextValue | null>>;
31
51
  type DictationState = "idle" | "requesting" | "recording" | "transcribing" | "ready" | "error";
32
52
  interface UseDictationOptions {
33
53
  lang?: string;
@@ -42,6 +62,8 @@ interface DictationCapture {
42
62
  transcript: string;
43
63
  interimTranscript: string;
44
64
  error: string | null;
65
+ /** A live preview failed, but the recorded take can still be transcribed on Done. */
66
+ previewError?: string;
45
67
  canRetry: boolean;
46
68
  /** Live bands from the recording stream. Native speech recognition exposes no audio meter. */
47
69
  audioLevels?: {
@@ -58,4 +80,4 @@ interface DictationCapture {
58
80
  /** Shared microphone lifecycle. Without a provider, existing native dictation keeps working. */
59
81
  declare function useDictation({ lang, continuous, onTranscript }?: UseDictationOptions): DictationCapture;
60
82
 
61
- export { type DictationCapture, DictationProvider, type DictationProviderProps, type DictationState, type DictationTranscribe, type DictationTranscribeOptions, type UseDictationOptions, useDictation };
83
+ export { type DictationCapture, DictationProvider, type DictationProviderProps, type DictationState, type DictationStream, type DictationStreamOptions, type DictationStreamSession, type DictationTranscribe, type DictationTranscribeOptions, type UseDictationOptions, useDictation };
@@ -3,7 +3,7 @@
3
3
  import {
4
4
  DictationProvider,
5
5
  useDictation
6
- } from "../chunk-HLAHOVEI.js";
6
+ } from "../chunk-RPSRCB5O.js";
7
7
  export {
8
8
  DictationProvider,
9
9
  useDictation
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
 
4
4
 
5
- var _chunk7QTFYEPEcjs = require('../chunk-7QTFYEPE.cjs');
5
+ var _chunkYMI3X2YLcjs = require('../chunk-YMI3X2YL.cjs');
6
6
 
7
7
 
8
8
 
@@ -10,7 +10,7 @@ var _chunk7QTFYEPEcjs = require('../chunk-7QTFYEPE.cjs');
10
10
  var _chunk2BTDBZYNcjs = require('../chunk-2BTDBZYN.cjs');
11
11
 
12
12
 
13
- var _chunkKQBXAQAYcjs = require('../chunk-KQBXAQAY.cjs');
13
+ var _chunkQWUMIAYDcjs = require('../chunk-QWUMIAYD.cjs');
14
14
 
15
15
 
16
16
 
@@ -86,7 +86,7 @@ require('../chunk-2BSFYU22.cjs');
86
86
 
87
87
 
88
88
  var _chunk4LXN6GLZcjs = require('../chunk-4LXN6GLZ.cjs');
89
- require('../chunk-ZZ7ICQR2.cjs');
89
+ require('../chunk-7Q4EFCUI.cjs');
90
90
 
91
91
 
92
92
  var _chunkR35FT53Gcjs = require('../chunk-R35FT53G.cjs');
@@ -402,8 +402,9 @@ function ChatInput({
402
402
  const [editing, setEditing] = _react.useState.call(void 0, false);
403
403
  const focusVersion = _react.useRef.call(void 0, 0);
404
404
  const isDisabled = pending || disabled;
405
+ const hasText = Boolean(value.trim());
405
406
  const attachmentsReady = attachments.length > 0 && attachments.every((item) => item.state !== "uploading");
406
- const canSubmit = !isDisabled && (Boolean(value.trim()) || attachmentsReady);
407
+ const canSubmit = !isDisabled && (hasText || attachmentsReady);
407
408
  const liveVoiceActive = voiceSession && voiceSession.state !== "disconnected" && voiceSession.state !== "error";
408
409
  const submit = () => {
409
410
  const trimmed = value.trim();
@@ -465,7 +466,7 @@ function ChatInput({
465
466
  className
466
467
  ),
467
468
  children: [
468
- liveVoiceActive && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7LDJAXRXcjs.InputGroupAddon, { align: "block-start", className: "w-full cursor-default border-b border-border p-0 [.border-b]:pb-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7QTFYEPEcjs.VoiceSessionControls, { ...voiceSession }) }),
469
+ liveVoiceActive && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7LDJAXRXcjs.InputGroupAddon, { align: "block-start", className: "w-full cursor-default border-b border-border p-0 [.border-b]:pb-0", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYMI3X2YLcjs.VoiceSessionControls, { ...voiceSession }) }),
469
470
  attachments.length > 0 && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
470
471
  ChatAttachmentList,
471
472
  {
@@ -541,7 +542,7 @@ function ChatInput({
541
542
  ) : null,
542
543
  (!helperText || compact) && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "flex-1" }),
543
544
  voice && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
544
- _chunkKQBXAQAYcjs.VoiceDictationButton,
545
+ _chunkQWUMIAYDcjs.VoiceDictationButton,
545
546
  {
546
547
  size: "icon",
547
548
  title: voiceTitle,
@@ -555,8 +556,7 @@ function ChatInput({
555
556
  )
556
557
  }
557
558
  ),
558
- voiceSession && !liveVoiceActive && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7QTFYEPEcjs.VoiceSessionControls, { ...voiceSession, disabled: voiceSession.disabled || isDisabled }),
559
- submitLabel ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
559
+ voiceSession && !liveVoiceActive && !hasText && attachments.length === 0 ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYMI3X2YLcjs.VoiceSessionControls, { ...voiceSession, disabled: voiceSession.disabled || isDisabled }) : submitLabel ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
560
560
  _chunkJDEXZGIYcjs.Button,
561
561
  {
562
562
  type: "submit",
@@ -572,11 +572,15 @@ function ChatInput({
572
572
  _chunkJDEXZGIYcjs.Button,
573
573
  {
574
574
  type: "submit",
575
- size: spacious && !compact ? "icon-lg" : "icon",
575
+ size: !voiceSession && spacious && !compact ? "icon-lg" : "icon",
576
+ shape: voiceSession ? "circle" : void 0,
576
577
  disabled: !canSubmit,
577
578
  "aria-label": "Send",
578
579
  "data-chat-action": "submit",
579
- className: _chunkKWLSBTB2cjs.cn.call(void 0, spacious && "rounded-xl", compactOnBlur && "min-h-[44px] min-w-[44px] shrink-0"),
580
+ className: _chunkKWLSBTB2cjs.cn.call(void 0,
581
+ spacious && !voiceSession && "rounded-xl",
582
+ (voiceSession || compactOnBlur) && "min-h-[44px] min-w-[44px] shrink-0"
583
+ ),
580
584
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ArrowUp, { className: _chunkKWLSBTB2cjs.cn.call(void 0, spacious && "h-5 w-5") })
581
585
  }
582
586
  )
@@ -614,9 +618,9 @@ function VoiceHero({
614
618
  }) {
615
619
  return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex flex-col items-center gap-5 py-6", children: [
616
620
  voiceSession ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, _jsxruntime.Fragment, { children: [
617
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunk7QTFYEPEcjs.VoiceSessionControls, { ...voiceSession, size: "hero" }),
621
+ /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkYMI3X2YLcjs.VoiceSessionControls, { ...voiceSession, size: "hero" }),
618
622
  voice && /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
619
- _chunkKQBXAQAYcjs.VoiceDictationButton,
623
+ _chunkQWUMIAYDcjs.VoiceDictationButton,
620
624
  {
621
625
  size: "icon",
622
626
  title: voiceTitle,
@@ -626,7 +630,7 @@ function VoiceHero({
626
630
  }
627
631
  )
628
632
  ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
629
- _chunkKQBXAQAYcjs.VoiceDictationButton,
633
+ _chunkQWUMIAYDcjs.VoiceDictationButton,
630
634
  {
631
635
  size: "lg",
632
636
  title: voiceTitle,
@@ -154,7 +154,11 @@ interface ChatInputProps {
154
154
  uploadingLabel?: string;
155
155
  /** Show the inline voice dictation button. Defaults to true. */
156
156
  voice?: boolean;
157
- /** A separate live voice control alongside dictation. The host owns its transport and lifecycle. */
157
+ /**
158
+ * Live voice controls, separate from dictation. With no text or staged files,
159
+ * the round voice action replaces Send; an active call keeps its controls
160
+ * above the input. The host owns the transport and lifecycle.
161
+ */
158
162
  voiceSession?: VoiceSessionControlsProps;
159
163
  /** Title shown inside the voice overlay. */
160
164
  voiceTitle?: string;
@@ -164,6 +168,7 @@ interface ChatInputProps {
164
168
  * Label for the submit button. When set, the button renders as a labelled
165
169
  * primary action (`{label} →`) instead of the default icon-only send — use
166
170
  * it to name the outcome, e.g. "Propose 3 times", "Create link", "Send".
171
+ * An empty composer with live voice still shows the voice action first.
167
172
  */
168
173
  submitLabel?: ReactNode;
169
174
  /** Auto-focus the textarea on mount. */
@@ -200,9 +205,10 @@ interface ChatInputProps {
200
205
  /**
201
206
  * Compact text input: a form around one bordered input group, with any
202
207
  * staged files on top, a textarea that grows with its text, then an action
203
- * bar (the file menu and voice mic on the left, the submit button on the
204
- * right). Always text-first; voice is a secondary affordance. Enter sends;
205
- * Shift+Enter newlines, and Enter that commits an IME candidate never sends.
208
+ * bar ending in one primary action. When live voice is available, an empty
209
+ * composer shows its round start action; text or staged files replace it
210
+ * with Send. Dictation remains a separate mic. Enter sends; Shift+Enter
211
+ * newlines, and Enter that commits an IME candidate never sends or starts a call.
206
212
  *
207
213
  * The submit button is icon-only by default; pass `submitLabel` to name the
208
214
  * outcome ("Propose 3 times", "Create link") — it then renders as a labelled
@@ -294,7 +300,8 @@ interface ChatProps {
294
300
  * Label for the submit button (empty-state input). When set, the button
295
301
  * names the outcome (`{label} →`) instead of the icon-only send — e.g.
296
302
  * "Propose 3 times". Once the conversation is active the input reverts to
297
- * the compact icon send.
303
+ * the compact icon send. With live voice available, an empty composer shows
304
+ * the voice action until text or files are staged.
298
305
  */
299
306
  submitLabel?: ReactNode;
300
307
  /** Files currently staged in the composer. */
@@ -357,7 +364,7 @@ interface ChatProps {
357
364
  fileDropDescription?: ReactNode;
358
365
  /** Enable voice dictation. Defaults to true. */
359
366
  voice?: boolean;
360
- /** Controlled live voice UI, used instead of browser dictation when provided. */
367
+ /** Controlled live voice UI; its empty-input action is separate from the dictation mic. */
361
368
  voiceSession?: VoiceSessionControlsProps;
362
369
  /** Title shown inside the voice overlay. */
363
370
  voiceTitle?: string;
@@ -154,7 +154,11 @@ interface ChatInputProps {
154
154
  uploadingLabel?: string;
155
155
  /** Show the inline voice dictation button. Defaults to true. */
156
156
  voice?: boolean;
157
- /** A separate live voice control alongside dictation. The host owns its transport and lifecycle. */
157
+ /**
158
+ * Live voice controls, separate from dictation. With no text or staged files,
159
+ * the round voice action replaces Send; an active call keeps its controls
160
+ * above the input. The host owns the transport and lifecycle.
161
+ */
158
162
  voiceSession?: VoiceSessionControlsProps;
159
163
  /** Title shown inside the voice overlay. */
160
164
  voiceTitle?: string;
@@ -164,6 +168,7 @@ interface ChatInputProps {
164
168
  * Label for the submit button. When set, the button renders as a labelled
165
169
  * primary action (`{label} →`) instead of the default icon-only send — use
166
170
  * it to name the outcome, e.g. "Propose 3 times", "Create link", "Send".
171
+ * An empty composer with live voice still shows the voice action first.
167
172
  */
168
173
  submitLabel?: ReactNode;
169
174
  /** Auto-focus the textarea on mount. */
@@ -200,9 +205,10 @@ interface ChatInputProps {
200
205
  /**
201
206
  * Compact text input: a form around one bordered input group, with any
202
207
  * staged files on top, a textarea that grows with its text, then an action
203
- * bar (the file menu and voice mic on the left, the submit button on the
204
- * right). Always text-first; voice is a secondary affordance. Enter sends;
205
- * Shift+Enter newlines, and Enter that commits an IME candidate never sends.
208
+ * bar ending in one primary action. When live voice is available, an empty
209
+ * composer shows its round start action; text or staged files replace it
210
+ * with Send. Dictation remains a separate mic. Enter sends; Shift+Enter
211
+ * newlines, and Enter that commits an IME candidate never sends or starts a call.
206
212
  *
207
213
  * The submit button is icon-only by default; pass `submitLabel` to name the
208
214
  * outcome ("Propose 3 times", "Create link") — it then renders as a labelled
@@ -294,7 +300,8 @@ interface ChatProps {
294
300
  * Label for the submit button (empty-state input). When set, the button
295
301
  * names the outcome (`{label} →`) instead of the icon-only send — e.g.
296
302
  * "Propose 3 times". Once the conversation is active the input reverts to
297
- * the compact icon send.
303
+ * the compact icon send. With live voice available, an empty composer shows
304
+ * the voice action until text or files are staged.
298
305
  */
299
306
  submitLabel?: ReactNode;
300
307
  /** Files currently staged in the composer. */
@@ -357,7 +364,7 @@ interface ChatProps {
357
364
  fileDropDescription?: ReactNode;
358
365
  /** Enable voice dictation. Defaults to true. */
359
366
  voice?: boolean;
360
- /** Controlled live voice UI, used instead of browser dictation when provided. */
367
+ /** Controlled live voice UI; its empty-input action is separate from the dictation mic. */
361
368
  voiceSession?: VoiceSessionControlsProps;
362
369
  /** Title shown inside the voice overlay. */
363
370
  voiceTitle?: string;
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  import {
4
4
  VoiceSessionControls
5
- } from "../chunk-UOVA4YKW.js";
5
+ } from "../chunk-KF4X37DP.js";
6
6
  import {
7
7
  Trace,
8
8
  TraceLine,
@@ -10,7 +10,7 @@ import {
10
10
  } from "../chunk-Z45YKVAM.js";
11
11
  import {
12
12
  VoiceDictationButton
13
- } from "../chunk-T3XMHWYV.js";
13
+ } from "../chunk-JKVVTFAP.js";
14
14
  import {
15
15
  Suggestion,
16
16
  Suggestions
@@ -86,7 +86,7 @@ import "../chunk-GJ7S3L6R.js";
86
86
  import {
87
87
  useCopyToClipboard
88
88
  } from "../chunk-ZWZAAGQF.js";
89
- import "../chunk-HLAHOVEI.js";
89
+ import "../chunk-RPSRCB5O.js";
90
90
  import {
91
91
  useIsMobile
92
92
  } from "../chunk-PIU5SSUV.js";
@@ -402,8 +402,9 @@ function ChatInput({
402
402
  const [editing, setEditing] = useState(false);
403
403
  const focusVersion = useRef(0);
404
404
  const isDisabled = pending || disabled;
405
+ const hasText = Boolean(value.trim());
405
406
  const attachmentsReady = attachments.length > 0 && attachments.every((item) => item.state !== "uploading");
406
- const canSubmit = !isDisabled && (Boolean(value.trim()) || attachmentsReady);
407
+ const canSubmit = !isDisabled && (hasText || attachmentsReady);
407
408
  const liveVoiceActive = voiceSession && voiceSession.state !== "disconnected" && voiceSession.state !== "error";
408
409
  const submit = () => {
409
410
  const trimmed = value.trim();
@@ -555,8 +556,7 @@ function ChatInput({
555
556
  )
556
557
  }
557
558
  ),
558
- voiceSession && !liveVoiceActive && /* @__PURE__ */ jsx(VoiceSessionControls, { ...voiceSession, disabled: voiceSession.disabled || isDisabled }),
559
- submitLabel ? /* @__PURE__ */ jsxs(
559
+ voiceSession && !liveVoiceActive && !hasText && attachments.length === 0 ? /* @__PURE__ */ jsx(VoiceSessionControls, { ...voiceSession, disabled: voiceSession.disabled || isDisabled }) : submitLabel ? /* @__PURE__ */ jsxs(
560
560
  Button,
561
561
  {
562
562
  type: "submit",
@@ -572,11 +572,15 @@ function ChatInput({
572
572
  Button,
573
573
  {
574
574
  type: "submit",
575
- size: spacious && !compact ? "icon-lg" : "icon",
575
+ size: !voiceSession && spacious && !compact ? "icon-lg" : "icon",
576
+ shape: voiceSession ? "circle" : void 0,
576
577
  disabled: !canSubmit,
577
578
  "aria-label": "Send",
578
579
  "data-chat-action": "submit",
579
- className: cn(spacious && "rounded-xl", compactOnBlur && "min-h-[44px] min-w-[44px] shrink-0"),
580
+ className: cn(
581
+ spacious && !voiceSession && "rounded-xl",
582
+ (voiceSession || compactOnBlur) && "min-h-[44px] min-w-[44px] shrink-0"
583
+ ),
580
584
  children: /* @__PURE__ */ jsx(ArrowUp, { className: cn(spacious && "h-5 w-5") })
581
585
  }
582
586
  )
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
 
4
4
 
5
- var _chunkZZ7ICQR2cjs = require('../chunk-ZZ7ICQR2.cjs');
5
+ var _chunk7Q4EFCUIcjs = require('../chunk-7Q4EFCUI.cjs');
6
6
 
7
7
 
8
- exports.DictationProvider = _chunkZZ7ICQR2cjs.DictationProvider;
8
+ exports.DictationProvider = _chunk7Q4EFCUIcjs.DictationProvider;
@@ -1,2 +1,2 @@
1
- export { DictationProvider, DictationProviderProps, DictationTranscribe, DictationTranscribeOptions } from '../hooks/use-dictation.cjs';
1
+ export { DictationProvider, DictationProviderProps, DictationStream, DictationStreamOptions, DictationStreamSession, DictationTranscribe, DictationTranscribeOptions } from '../hooks/use-dictation.cjs';
2
2
  import 'react';
@@ -1,2 +1,2 @@
1
- export { DictationProvider, DictationProviderProps, DictationTranscribe, DictationTranscribeOptions } from '../hooks/use-dictation.js';
1
+ export { DictationProvider, DictationProviderProps, DictationStream, DictationStreamOptions, DictationStreamSession, DictationTranscribe, DictationTranscribeOptions } from '../hooks/use-dictation.js';
2
2
  import 'react';
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  import {
4
4
  DictationProvider
5
- } from "../chunk-HLAHOVEI.js";
5
+ } from "../chunk-RPSRCB5O.js";
6
6
  export {
7
7
  DictationProvider
8
8
  };
@@ -2,12 +2,12 @@
2
2
  "use client";
3
3
 
4
4
 
5
- var _chunkKQBXAQAYcjs = require('../chunk-KQBXAQAY.cjs');
5
+ var _chunkQWUMIAYDcjs = require('../chunk-QWUMIAYD.cjs');
6
6
  require('../chunk-NKWHDI4C.cjs');
7
7
  require('../chunk-JDEXZGIY.cjs');
8
8
  require('../chunk-KWLSBTB2.cjs');
9
9
  require('../chunk-2BSFYU22.cjs');
10
- require('../chunk-ZZ7ICQR2.cjs');
10
+ require('../chunk-7Q4EFCUI.cjs');
11
11
 
12
12
 
13
- exports.VoiceDictationButton = _chunkKQBXAQAYcjs.VoiceDictationButton;
13
+ exports.VoiceDictationButton = _chunkQWUMIAYDcjs.VoiceDictationButton;
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
2
+ import { ReactNode, RefObject } from 'react';
3
3
 
4
4
  interface VoiceDictationButtonProps {
5
5
  /** Fired when the user taps "Done" with the captured transcript. */
6
6
  onCommit: (text: string) => void;
7
7
  /** Fired if the user closes the overlay without committing. */
8
8
  onCancel?: () => void;
9
- /** Title shown in the compact recorder. */
9
+ /** Title shown in the recorder. */
10
10
  title?: ReactNode;
11
11
  /** Recording status label. Defaults to "Recording". */
12
12
  caption?: string;
@@ -26,12 +26,14 @@ interface VoiceDictationButtonProps {
26
26
  disabled?: boolean;
27
27
  visibility?: "visible" | "hidden";
28
28
  shrink?: boolean;
29
+ /** Visible desktop anchor for a custom/programmatic trigger. Hidden anchors are ignored. */
30
+ anchorRef?: RefObject<HTMLElement | null>;
29
31
  }
30
32
  /**
31
- * Opens a compact portaled recorder. A fixed panel also works when its
32
- * trigger is hidden or sits inside another dialog. Done finishes the take
33
- * and commits its transcript once; Cancel discards it.
33
+ * Opens beside the invoking control on desktop and fills the screen on
34
+ * mobile, or when no visible anchor exists. Placement changes keep the same
35
+ * recording alive. Done commits its transcript once; Cancel discards it.
34
36
  */
35
- declare function VoiceDictationButton({ onCommit, onCancel, title, caption, lang, continuous, className, size, showLabel, children, disabled, visibility, shrink, }: VoiceDictationButtonProps): react_jsx_runtime.JSX.Element | null;
37
+ declare function VoiceDictationButton({ onCommit, onCancel, title, caption, lang, continuous, className, size, showLabel, children, disabled, visibility, shrink, anchorRef, }: VoiceDictationButtonProps): react_jsx_runtime.JSX.Element | null;
36
38
 
37
39
  export { VoiceDictationButton, type VoiceDictationButtonProps };
@@ -1,12 +1,12 @@
1
1
  import * as react_jsx_runtime from 'react/jsx-runtime';
2
- import { ReactNode } from 'react';
2
+ import { ReactNode, RefObject } from 'react';
3
3
 
4
4
  interface VoiceDictationButtonProps {
5
5
  /** Fired when the user taps "Done" with the captured transcript. */
6
6
  onCommit: (text: string) => void;
7
7
  /** Fired if the user closes the overlay without committing. */
8
8
  onCancel?: () => void;
9
- /** Title shown in the compact recorder. */
9
+ /** Title shown in the recorder. */
10
10
  title?: ReactNode;
11
11
  /** Recording status label. Defaults to "Recording". */
12
12
  caption?: string;
@@ -26,12 +26,14 @@ interface VoiceDictationButtonProps {
26
26
  disabled?: boolean;
27
27
  visibility?: "visible" | "hidden";
28
28
  shrink?: boolean;
29
+ /** Visible desktop anchor for a custom/programmatic trigger. Hidden anchors are ignored. */
30
+ anchorRef?: RefObject<HTMLElement | null>;
29
31
  }
30
32
  /**
31
- * Opens a compact portaled recorder. A fixed panel also works when its
32
- * trigger is hidden or sits inside another dialog. Done finishes the take
33
- * and commits its transcript once; Cancel discards it.
33
+ * Opens beside the invoking control on desktop and fills the screen on
34
+ * mobile, or when no visible anchor exists. Placement changes keep the same
35
+ * recording alive. Done commits its transcript once; Cancel discards it.
34
36
  */
35
- declare function VoiceDictationButton({ onCommit, onCancel, title, caption, lang, continuous, className, size, showLabel, children, disabled, visibility, shrink, }: VoiceDictationButtonProps): react_jsx_runtime.JSX.Element | null;
37
+ declare function VoiceDictationButton({ onCommit, onCancel, title, caption, lang, continuous, className, size, showLabel, children, disabled, visibility, shrink, anchorRef, }: VoiceDictationButtonProps): react_jsx_runtime.JSX.Element | null;
36
38
 
37
39
  export { VoiceDictationButton, type VoiceDictationButtonProps };
@@ -2,12 +2,12 @@
2
2
  "use client";
3
3
  import {
4
4
  VoiceDictationButton
5
- } from "../chunk-T3XMHWYV.js";
5
+ } from "../chunk-JKVVTFAP.js";
6
6
  import "../chunk-5OF6D3GH.js";
7
7
  import "../chunk-W326GKML.js";
8
8
  import "../chunk-G6SRSWXB.js";
9
9
  import "../chunk-GJ7S3L6R.js";
10
- import "../chunk-HLAHOVEI.js";
10
+ import "../chunk-RPSRCB5O.js";
11
11
  export {
12
12
  VoiceDictationButton
13
13
  };
@@ -2,11 +2,11 @@
2
2
  "use client";
3
3
 
4
4
 
5
- var _chunk7QTFYEPEcjs = require('../chunk-7QTFYEPE.cjs');
5
+ var _chunkYMI3X2YLcjs = require('../chunk-YMI3X2YL.cjs');
6
6
  require('../chunk-NKWHDI4C.cjs');
7
7
  require('../chunk-JDEXZGIY.cjs');
8
8
  require('../chunk-KWLSBTB2.cjs');
9
9
  require('../chunk-2BSFYU22.cjs');
10
10
 
11
11
 
12
- exports.VoiceSessionControls = _chunk7QTFYEPEcjs.VoiceSessionControls;
12
+ exports.VoiceSessionControls = _chunkYMI3X2YLcjs.VoiceSessionControls;
@@ -15,7 +15,7 @@ interface VoiceSessionControlsProps {
15
15
  /** Prevent starting a new session; ending an active session stays available. */
16
16
  disabled?: boolean;
17
17
  error?: string | null;
18
- /** The latest user utterance supplied by the host; never submits a message. */
18
+ /** @deprecated Render transcripts in the conversation thread. Ignored by the controls. */
19
19
  transcript?: string;
20
20
  /** Audio levels supplied by the host; no media connection is created by the kit. */
21
21
  volumeBands?: number[];
@@ -26,6 +26,6 @@ interface VoiceSessionControlsProps {
26
26
  className?: string;
27
27
  }
28
28
  /** Transport-independent voice controls. The conversation stays visible while speaking. */
29
- declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, transcript, volumeBands, audioLevels, labels, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
29
+ declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
30
30
 
31
31
  export { type VoiceAudioLevelsSource, VoiceSessionControls, type VoiceSessionControlsProps, type VoiceSessionState };
@@ -15,7 +15,7 @@ interface VoiceSessionControlsProps {
15
15
  /** Prevent starting a new session; ending an active session stays available. */
16
16
  disabled?: boolean;
17
17
  error?: string | null;
18
- /** The latest user utterance supplied by the host; never submits a message. */
18
+ /** @deprecated Render transcripts in the conversation thread. Ignored by the controls. */
19
19
  transcript?: string;
20
20
  /** Audio levels supplied by the host; no media connection is created by the kit. */
21
21
  volumeBands?: number[];
@@ -26,6 +26,6 @@ interface VoiceSessionControlsProps {
26
26
  className?: string;
27
27
  }
28
28
  /** Transport-independent voice controls. The conversation stays visible while speaking. */
29
- declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, transcript, volumeBands, audioLevels, labels, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
29
+ declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
30
30
 
31
31
  export { type VoiceAudioLevelsSource, VoiceSessionControls, type VoiceSessionControlsProps, type VoiceSessionState };
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  import {
4
4
  VoiceSessionControls
5
- } from "../chunk-UOVA4YKW.js";
5
+ } from "../chunk-KF4X37DP.js";
6
6
  import "../chunk-5OF6D3GH.js";
7
7
  import "../chunk-W326GKML.js";
8
8
  import "../chunk-G6SRSWXB.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epicbagel/saas-kit",
3
- "version": "1.11.0",
3
+ "version": "1.12.0",
4
4
  "description": "Accessible React primitives, layout components and design tokens for SaaS apps, built on Radix UI and Tailwind CSS v4.",
5
5
  "license": "MIT",
6
6
  "keywords": [