@epicbagel/saas-kit 1.22.0 → 1.24.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 (39) hide show
  1. package/dist/chunk-HETZNLKT.cjs +148 -0
  2. package/dist/{chunk-WE3F6EUM.cjs → chunk-KLBMHQ6U.cjs} +5 -1
  3. package/dist/{chunk-YFXZWDA5.js → chunk-M5BYOPDK.js} +5 -1
  4. package/dist/chunk-PL2462GA.js +148 -0
  5. package/dist/primitives/agent-audio-visualizer-bar.d.cts +2 -2
  6. package/dist/primitives/agent-audio-visualizer-bar.d.ts +2 -2
  7. package/dist/primitives/alert.d.cts +1 -1
  8. package/dist/primitives/alert.d.ts +1 -1
  9. package/dist/primitives/attachment.d.cts +1 -1
  10. package/dist/primitives/attachment.d.ts +1 -1
  11. package/dist/primitives/badge.d.cts +1 -1
  12. package/dist/primitives/badge.d.ts +1 -1
  13. package/dist/primitives/bubble.d.cts +1 -1
  14. package/dist/primitives/bubble.d.ts +1 -1
  15. package/dist/primitives/button.d.cts +2 -2
  16. package/dist/primitives/button.d.ts +2 -2
  17. package/dist/primitives/chat.cjs +7 -5
  18. package/dist/primitives/chat.js +4 -2
  19. package/dist/primitives/editable-list.cjs +27 -24
  20. package/dist/primitives/editable-list.js +27 -24
  21. package/dist/primitives/item.d.cts +2 -2
  22. package/dist/primitives/item.d.ts +2 -2
  23. package/dist/primitives/list.cjs +2 -2
  24. package/dist/primitives/list.js +1 -1
  25. package/dist/primitives/section-header.d.cts +1 -1
  26. package/dist/primitives/section-header.d.ts +1 -1
  27. package/dist/primitives/toggle-group.d.cts +2 -2
  28. package/dist/primitives/toggle-group.d.ts +2 -2
  29. package/dist/primitives/toggle.d.cts +2 -2
  30. package/dist/primitives/toggle.d.ts +2 -2
  31. package/dist/primitives/voice-session-controls.cjs +2 -2
  32. package/dist/primitives/voice-session-controls.d.cts +9 -1
  33. package/dist/primitives/voice-session-controls.d.ts +9 -1
  34. package/dist/primitives/voice-session-controls.js +1 -1
  35. package/dist/primitives/workflow-assistant.cjs +2 -2
  36. package/dist/primitives/workflow-assistant.js +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunk-KF4X37DP.js +0 -140
  39. package/dist/chunk-YMI3X2YL.cjs +0 -140
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  List,
4
4
  ListItem
5
- } from "../chunk-YFXZWDA5.js";
5
+ } from "../chunk-M5BYOPDK.js";
6
6
  import "../chunk-YWAQRAXP.js";
7
7
  import {
8
8
  Text
@@ -51,29 +51,32 @@ function EditableList({
51
51
  };
52
52
  return /* @__PURE__ */ jsxs("section", { className: cn("border-t border-border pt-4", className), children: [
53
53
  /* @__PURE__ */ jsx(Text, { as: "span", variant: "caption", className: "text-xs font-medium uppercase tracking-wider", children: label }),
54
- items.length === 0 ? /* @__PURE__ */ jsx(Text, { variant: "caption", className: "mt-3 italic", children: emptyText }) : /* @__PURE__ */ jsx(List, { spacing: "normal", className: "mt-3", children: items.map((item, index) => /* @__PURE__ */ jsx(ListItem, { layout: "bullet", sentiment, actions: !readOnly && (editing?.index === index ? /* @__PURE__ */ jsxs(Fragment, { children: [
55
- /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", shrink: true, className: "text-emerald-600", "aria-label": `Save ${itemName}`, onClick: commitEdit, children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }),
56
- /* @__PURE__ */ jsx(Button, { type: "button", variant: "quiet", size: "icon-sm", shrink: true, marginEnd: "negative-xs", "aria-label": `Cancel editing ${itemName}`, onClick: () => setEditing(null), children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
57
- ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
58
- /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "h-8 w-8 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100", "aria-label": `Edit ${itemName}`, onClick: () => setEditing({ index, value: item }), children: /* @__PURE__ */ jsx(Pencil, { className: "h-4 w-4" }) }),
59
- /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "-mr-1 h-8 w-8 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100", "aria-label": `Remove ${itemName}`, onClick: () => onChange(items.filter((_, itemIndex) => itemIndex !== index)), children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
60
- ] })), children: !readOnly && editing?.index === index ? /* @__PURE__ */ jsx(
61
- Input,
62
- {
63
- autoFocus: true,
64
- value: editing.value,
65
- "aria-label": `Edit ${itemName}`,
66
- onChange: (event) => setEditing({ index, value: event.target.value }),
67
- onKeyDown: (event) => {
68
- if (event.key === "Enter") {
69
- event.preventDefault();
70
- commitEdit();
71
- }
72
- if (event.key === "Escape") setEditing(null);
73
- },
74
- grow: true
75
- }
76
- ) : item }, `${item}-${index}`)) }),
54
+ items.length === 0 ? /* @__PURE__ */ jsx(Text, { variant: "caption", className: "mt-3 italic", children: emptyText }) : (
55
+ // Read-only rows are just text, about 1.8em apart; editable rows keep room for their controls.
56
+ /* @__PURE__ */ jsx(List, { spacing: readOnly ? "tight" : "normal", className: "mt-3", children: items.map((item, index) => /* @__PURE__ */ jsx(ListItem, { layout: "bullet", sentiment, actions: !readOnly && (editing?.index === index ? /* @__PURE__ */ jsxs(Fragment, { children: [
57
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon-sm", shrink: true, className: "text-emerald-600", "aria-label": `Save ${itemName}`, onClick: commitEdit, children: /* @__PURE__ */ jsx(Check, { className: "h-4 w-4" }) }),
58
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "quiet", size: "icon-sm", shrink: true, marginEnd: "negative-xs", "aria-label": `Cancel editing ${itemName}`, onClick: () => setEditing(null), children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
59
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
60
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "h-8 w-8 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100", "aria-label": `Edit ${itemName}`, onClick: () => setEditing({ index, value: item }), children: /* @__PURE__ */ jsx(Pencil, { className: "h-4 w-4" }) }),
61
+ /* @__PURE__ */ jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "-mr-1 h-8 w-8 shrink-0 text-muted-foreground opacity-0 transition-opacity group-hover:opacity-100 focus:opacity-100", "aria-label": `Remove ${itemName}`, onClick: () => onChange(items.filter((_, itemIndex) => itemIndex !== index)), children: /* @__PURE__ */ jsx(X, { className: "h-4 w-4" }) })
62
+ ] })), children: !readOnly && editing?.index === index ? /* @__PURE__ */ jsx(
63
+ Input,
64
+ {
65
+ autoFocus: true,
66
+ value: editing.value,
67
+ "aria-label": `Edit ${itemName}`,
68
+ onChange: (event) => setEditing({ index, value: event.target.value }),
69
+ onKeyDown: (event) => {
70
+ if (event.key === "Enter") {
71
+ event.preventDefault();
72
+ commitEdit();
73
+ }
74
+ if (event.key === "Escape") setEditing(null);
75
+ },
76
+ grow: true
77
+ }
78
+ ) : item }, `${item}-${index}`)) })
79
+ ),
77
80
  !readOnly && /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-2", children: [
78
81
  /* @__PURE__ */ jsx(
79
82
  Input,
@@ -8,14 +8,14 @@ import '@radix-ui/react-separator';
8
8
  declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
9
9
  declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
10
10
  declare const itemVariants: (props?: ({
11
- variant?: "muted" | "default" | "outline" | null | undefined;
11
+ variant?: "default" | "muted" | "outline" | null | undefined;
12
12
  size?: "xs" | "sm" | "default" | null | undefined;
13
13
  } & class_variance_authority_types.ClassProp) | undefined) => string;
14
14
  declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
15
15
  asChild?: boolean;
16
16
  }): react_jsx_runtime.JSX.Element;
17
17
  declare const itemMediaVariants: (props?: ({
18
- variant?: "icon" | "image" | "default" | null | undefined;
18
+ variant?: "image" | "default" | "icon" | null | undefined;
19
19
  } & class_variance_authority_types.ClassProp) | undefined) => string;
20
20
  declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): react_jsx_runtime.JSX.Element;
21
21
  declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
@@ -8,14 +8,14 @@ import '@radix-ui/react-separator';
8
8
  declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
9
9
  declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): react_jsx_runtime.JSX.Element;
10
10
  declare const itemVariants: (props?: ({
11
- variant?: "muted" | "default" | "outline" | null | undefined;
11
+ variant?: "default" | "muted" | "outline" | null | undefined;
12
12
  size?: "xs" | "sm" | "default" | null | undefined;
13
13
  } & class_variance_authority_types.ClassProp) | undefined) => string;
14
14
  declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
15
15
  asChild?: boolean;
16
16
  }): react_jsx_runtime.JSX.Element;
17
17
  declare const itemMediaVariants: (props?: ({
18
- variant?: "icon" | "image" | "default" | null | undefined;
18
+ variant?: "image" | "default" | "icon" | null | undefined;
19
19
  } & class_variance_authority_types.ClassProp) | undefined) => string;
20
20
  declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): react_jsx_runtime.JSX.Element;
21
21
  declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): react_jsx_runtime.JSX.Element;
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkWE3F6EUMcjs = require('../chunk-WE3F6EUM.cjs');
5
+ var _chunkKLBMHQ6Ucjs = require('../chunk-KLBMHQ6U.cjs');
6
6
  require('../chunk-W5I4FN7G.cjs');
7
7
  require('../chunk-373W6VAD.cjs');
8
8
  require('../chunk-EJP2L5QV.cjs');
@@ -10,4 +10,4 @@ require('../chunk-KWLSBTB2.cjs');
10
10
 
11
11
 
12
12
 
13
- exports.List = _chunkWE3F6EUMcjs.List; exports.ListItem = _chunkWE3F6EUMcjs.ListItem;
13
+ exports.List = _chunkKLBMHQ6Ucjs.List; exports.ListItem = _chunkKLBMHQ6Ucjs.ListItem;
@@ -2,7 +2,7 @@
2
2
  import {
3
3
  List,
4
4
  ListItem
5
- } from "../chunk-YFXZWDA5.js";
5
+ } from "../chunk-M5BYOPDK.js";
6
6
  import "../chunk-YWAQRAXP.js";
7
7
  import "../chunk-EIY5LLSP.js";
8
8
  import "../chunk-F7JHSZNT.js";
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const sectionHeaderVariants: (props?: ({
7
7
  variant?: "muted" | "plain" | null | undefined;
8
- spacing?: "tight" | "loose" | "none" | null | undefined;
8
+ spacing?: "none" | "tight" | "loose" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLHeadingElement>, "children">, VariantProps<typeof sectionHeaderVariants> {
11
11
  /** Pre-rendered icon node. Sized to match the header text. */
@@ -5,7 +5,7 @@ import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const sectionHeaderVariants: (props?: ({
7
7
  variant?: "muted" | "plain" | null | undefined;
8
- spacing?: "tight" | "loose" | "none" | null | undefined;
8
+ spacing?: "none" | "tight" | "loose" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  interface SectionHeaderProps extends Omit<HTMLAttributes<HTMLHeadingElement>, "children">, VariantProps<typeof sectionHeaderVariants> {
11
11
  /** Pre-rendered icon node. Sized to match the header text. */
@@ -5,11 +5,11 @@ import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
7
7
  variant?: "default" | "outline" | null | undefined;
8
- size?: "icon" | "sm" | "lg" | "default" | "icon-lg" | "avatar" | "chip" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
10
10
  declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
11
11
  variant?: "default" | "outline" | null | undefined;
12
- size?: "icon" | "sm" | "lg" | "default" | "icon-lg" | "avatar" | "chip" | null | undefined;
12
+ size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
13
13
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
14
14
  grow?: boolean;
15
15
  textSize?: "inherit" | "xs";
@@ -5,11 +5,11 @@ import { VariantProps } from 'class-variance-authority';
5
5
 
6
6
  declare const ToggleGroup: React.ForwardRefExoticComponent<((Omit<ToggleGroupPrimitive.ToggleGroupSingleProps & React.RefAttributes<HTMLDivElement>, "ref"> | Omit<ToggleGroupPrimitive.ToggleGroupMultipleProps & React.RefAttributes<HTMLDivElement>, "ref">) & VariantProps<(props?: ({
7
7
  variant?: "default" | "outline" | null | undefined;
8
- size?: "icon" | "sm" | "lg" | "default" | "icon-lg" | "avatar" | "chip" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string>) & React.RefAttributes<HTMLDivElement>>;
10
10
  declare const ToggleGroupItem: React.ForwardRefExoticComponent<Omit<ToggleGroupPrimitive.ToggleGroupItemProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
11
11
  variant?: "default" | "outline" | null | undefined;
12
- size?: "icon" | "sm" | "lg" | "default" | "icon-lg" | "avatar" | "chip" | null | undefined;
12
+ size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
13
13
  } & class_variance_authority_types.ClassProp) | undefined) => string> & {
14
14
  grow?: boolean;
15
15
  textSize?: "inherit" | "xs";
@@ -5,11 +5,11 @@ import * as React from 'react';
5
5
 
6
6
  declare const toggleVariants: (props?: ({
7
7
  variant?: "default" | "outline" | null | undefined;
8
- size?: "icon" | "sm" | "lg" | "default" | "icon-lg" | "avatar" | "chip" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
11
11
  variant?: "default" | "outline" | null | undefined;
12
- size?: "icon" | "sm" | "lg" | "default" | "icon-lg" | "avatar" | "chip" | null | undefined;
12
+ size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
13
13
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
14
14
 
15
15
  export { Toggle, toggleVariants };
@@ -5,11 +5,11 @@ import * as React from 'react';
5
5
 
6
6
  declare const toggleVariants: (props?: ({
7
7
  variant?: "default" | "outline" | null | undefined;
8
- size?: "icon" | "sm" | "lg" | "default" | "icon-lg" | "avatar" | "chip" | null | undefined;
8
+ size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
9
9
  } & class_variance_authority_types.ClassProp) | undefined) => string;
10
10
  declare const Toggle: React.ForwardRefExoticComponent<Omit<TogglePrimitive.ToggleProps & React.RefAttributes<HTMLButtonElement>, "ref"> & VariantProps<(props?: ({
11
11
  variant?: "default" | "outline" | null | undefined;
12
- size?: "icon" | "sm" | "lg" | "default" | "icon-lg" | "avatar" | "chip" | null | undefined;
12
+ size?: "sm" | "lg" | "default" | "icon" | "icon-lg" | "avatar" | "chip" | null | undefined;
13
13
  } & class_variance_authority_types.ClassProp) | undefined) => string> & React.RefAttributes<HTMLButtonElement>>;
14
14
 
15
15
  export { Toggle, toggleVariants };
@@ -2,11 +2,11 @@
2
2
  "use client";
3
3
 
4
4
 
5
- var _chunkYMI3X2YLcjs = require('../chunk-YMI3X2YL.cjs');
5
+ var _chunkHETZNLKTcjs = require('../chunk-HETZNLKT.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 = _chunkYMI3X2YLcjs.VoiceSessionControls;
12
+ exports.VoiceSessionControls = _chunkHETZNLKTcjs.VoiceSessionControls;
@@ -22,10 +22,18 @@ interface VoiceSessionControlsProps {
22
22
  /** Optional external audio store, so level changes only re-render these controls. */
23
23
  audioLevels?: VoiceAudioLevelsSource;
24
24
  labels?: Partial<Record<VoiceSessionState | "start" | "end" | "mute" | "unmute" | "muted" | "retry" | "endShort" | "muteShort" | "unmuteShort" | "transcriptPlaceholder", string>>;
25
+ /**
26
+ * Called when someone is about to start (the start control is hovered,
27
+ * pressed or focused), before the click lands. Hosts load their voice
28
+ * transport here so starting doesn't wait for it. It must never touch the
29
+ * microphone: capture belongs to `onStart`, so warming never prompts for
30
+ * permission. It can fire several times; make it idempotent.
31
+ */
32
+ onWarm?: () => void;
25
33
  size?: "icon" | "hero";
26
34
  className?: string;
27
35
  }
28
36
  /** Transport-independent voice controls. The conversation stays visible while speaking. */
29
- declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
37
+ declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, onWarm, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
30
38
 
31
39
  export { type VoiceAudioLevelsSource, VoiceSessionControls, type VoiceSessionControlsProps, type VoiceSessionState };
@@ -22,10 +22,18 @@ interface VoiceSessionControlsProps {
22
22
  /** Optional external audio store, so level changes only re-render these controls. */
23
23
  audioLevels?: VoiceAudioLevelsSource;
24
24
  labels?: Partial<Record<VoiceSessionState | "start" | "end" | "mute" | "unmute" | "muted" | "retry" | "endShort" | "muteShort" | "unmuteShort" | "transcriptPlaceholder", string>>;
25
+ /**
26
+ * Called when someone is about to start (the start control is hovered,
27
+ * pressed or focused), before the click lands. Hosts load their voice
28
+ * transport here so starting doesn't wait for it. It must never touch the
29
+ * microphone: capture belongs to `onStart`, so warming never prompts for
30
+ * permission. It can fire several times; make it idempotent.
31
+ */
32
+ onWarm?: () => void;
25
33
  size?: "icon" | "hero";
26
34
  className?: string;
27
35
  }
28
36
  /** Transport-independent voice controls. The conversation stays visible while speaking. */
29
- declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
37
+ declare function VoiceSessionControls({ state, onStart, onEnd, muted, onMutedChange, disabled, error, volumeBands, audioLevels, labels, onWarm, size, className, }: VoiceSessionControlsProps): react_jsx_runtime.JSX.Element;
30
38
 
31
39
  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-KF4X37DP.js";
5
+ } from "../chunk-PL2462GA.js";
6
6
  import "../chunk-5OF6D3GH.js";
7
7
  import "../chunk-W326GKML.js";
8
8
  import "../chunk-G6SRSWXB.js";
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
 
4
4
 
5
- var _chunkYMI3X2YLcjs = require('../chunk-YMI3X2YL.cjs');
5
+ var _chunkHETZNLKTcjs = require('../chunk-HETZNLKT.cjs');
6
6
  require('../chunk-NKWHDI4C.cjs');
7
7
 
8
8
 
@@ -139,7 +139,7 @@ var WorkflowAssistant = _react.forwardRef.call(void 0, function WorkflowAssistan
139
139
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _chunkJDEXZGIYcjs.Button, { type: "button", variant: "ghost", size: "icon", "aria-label": _nullishCoalesce(_optionalChain([labels, 'optionalAccess', _16 => _16.minimize]), () => ( "Minimize voice review")), onClick: () => toggle(false), children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.ChevronDown, { "aria-hidden": "true" }) })
140
140
  ] }),
141
141
  /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { className: "shrink-0", "data-slot": "workflow-assistant-voice", children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
142
- _chunkYMI3X2YLcjs.VoiceSessionControls,
142
+ _chunkHETZNLKTcjs.VoiceSessionControls,
143
143
  {
144
144
  ...voiceSession,
145
145
  disabled: Boolean(startDisabled),
@@ -2,7 +2,7 @@
2
2
  "use client";
3
3
  import {
4
4
  VoiceSessionControls
5
- } from "../chunk-KF4X37DP.js";
5
+ } from "../chunk-PL2462GA.js";
6
6
  import "../chunk-5OF6D3GH.js";
7
7
  import {
8
8
  Button
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@epicbagel/saas-kit",
3
- "version": "1.22.0",
3
+ "version": "1.24.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": [
@@ -1,140 +0,0 @@
1
- "use client";
2
- import {
3
- AgentAudioVisualizerBar
4
- } from "./chunk-5OF6D3GH.js";
5
- import {
6
- Button
7
- } from "./chunk-W326GKML.js";
8
- import {
9
- cn
10
- } from "./chunk-G6SRSWXB.js";
11
-
12
- // src/primitives/voice-session-controls.tsx
13
- import { useSyncExternalStore } from "react";
14
- import { Mic, MicOff, Square, AudioLines } from "lucide-react";
15
- import { jsx, jsxs } from "react/jsx-runtime";
16
- var SILENCE = [];
17
- var silence = () => SILENCE;
18
- var noSubscription = () => () => {
19
- };
20
- var DEFAULT_LABELS = {
21
- disconnected: "Voice chat",
22
- connecting: "Connecting\u2026",
23
- listening: "Listening\u2026",
24
- thinking: "Thinking\u2026",
25
- speaking: "Speaking",
26
- reconnecting: "Reconnecting\u2026",
27
- error: "Voice chat unavailable",
28
- start: "Start voice chat",
29
- end: "End voice chat",
30
- mute: "Mute microphone",
31
- unmute: "Unmute microphone",
32
- muted: "Microphone muted",
33
- retry: "Retry voice chat",
34
- endShort: "End voice",
35
- muteShort: "Mute",
36
- unmuteShort: "Unmute"
37
- };
38
- function VoiceSessionControls({
39
- state,
40
- onStart,
41
- onEnd,
42
- muted = false,
43
- onMutedChange,
44
- disabled = false,
45
- error,
46
- volumeBands,
47
- audioLevels,
48
- labels,
49
- size = "icon",
50
- className
51
- }) {
52
- const liveBands = useSyncExternalStore(audioLevels?.subscribe ?? noSubscription, audioLevels?.getSnapshot ?? silence, silence);
53
- const copy = { ...DEFAULT_LABELS, ...labels };
54
- const active = state !== "disconnected" && state !== "error";
55
- const waiting = state === "connecting" || state === "reconnecting";
56
- return /* @__PURE__ */ jsxs(
57
- "div",
58
- {
59
- "data-slot": "voice-session-controls",
60
- "data-state": state,
61
- className: cn("min-w-0", active ? "@container/voice w-full" : "flex flex-wrap items-center gap-2", className),
62
- children: [
63
- active ? /* @__PURE__ */ jsxs("div", { "data-slot": "voice-session-strip", className: "flex w-full flex-wrap items-center gap-4 bg-primary/5 p-4 @2xl/voice:flex-nowrap @2xl/voice:px-5", children: [
64
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 basis-full items-center gap-3 @2xl/voice:basis-auto @2xl/voice:gap-4", children: [
65
- /* @__PURE__ */ jsx("div", { "aria-hidden": "true", className: cn(
66
- "flex size-12 shrink-0 items-center justify-center rounded-full ring-8 ring-primary/5 @sm/voice:size-14",
67
- muted ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground"
68
- ), children: muted ? /* @__PURE__ */ jsx(MicOff, { className: "size-5" }) : /* @__PURE__ */ jsx(Mic, { className: "size-5" }) }),
69
- /* @__PURE__ */ jsx(
70
- AgentAudioVisualizerBar,
71
- {
72
- "aria-hidden": "true",
73
- size: "sm",
74
- barCount: 5,
75
- className: "shrink-0 text-primary [&>div]:w-1",
76
- state: muted && state === "listening" ? "disconnected" : state === "reconnecting" ? "connecting" : state,
77
- volumeBands: muted && state === "listening" ? SILENCE : volumeBands ?? liveBands
78
- }
79
- ),
80
- /* @__PURE__ */ jsx("span", { role: "status", className: "min-w-0 flex-1 text-sm font-medium text-primary", children: muted && state === "listening" ? copy.muted : copy[state] })
81
- ] }),
82
- /* @__PURE__ */ jsxs("div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
83
- /* @__PURE__ */ jsxs(
84
- Button,
85
- {
86
- type: "button",
87
- variant: "outline",
88
- size: "sm",
89
- className: "min-h-[44px] shrink-0 rounded-xl bg-background px-3 text-foreground",
90
- "aria-label": muted ? copy.unmute : copy.mute,
91
- title: muted ? copy.unmute : copy.mute,
92
- "aria-pressed": muted,
93
- disabled: waiting,
94
- onClick: () => onMutedChange(!muted),
95
- children: [
96
- muted ? /* @__PURE__ */ jsx(Mic, { "aria-hidden": "true" }) : /* @__PURE__ */ jsx(MicOff, { "aria-hidden": "true" }),
97
- muted ? copy.unmuteShort : copy.muteShort
98
- ]
99
- }
100
- ),
101
- /* @__PURE__ */ jsxs(
102
- Button,
103
- {
104
- type: "button",
105
- variant: "outline",
106
- size: "sm",
107
- className: "min-h-[44px] shrink-0 rounded-xl bg-background px-3 text-foreground",
108
- "aria-label": copy.end,
109
- title: copy.end,
110
- onClick: onEnd,
111
- children: [
112
- /* @__PURE__ */ jsx(Square, { "aria-hidden": "true", className: "fill-current" }),
113
- copy.endShort
114
- ]
115
- }
116
- )
117
- ] })
118
- ] }) : /* @__PURE__ */ jsx(
119
- Button,
120
- {
121
- type: "button",
122
- size: "icon",
123
- shape: "circle",
124
- disabled,
125
- onClick: onStart,
126
- "aria-label": state === "error" ? copy.retry : copy.start,
127
- title: state === "error" ? copy.retry : copy.start,
128
- className: cn("min-h-[44px] min-w-[44px] shrink-0 rounded-full", size === "hero" && "size-24 [&_svg]:size-7"),
129
- children: /* @__PURE__ */ jsx(AudioLines, { "aria-hidden": "true" })
130
- }
131
- ),
132
- state === "error" && /* @__PURE__ */ jsx("span", { role: "alert", className: "basis-full text-xs text-destructive", children: error || copy.error })
133
- ]
134
- }
135
- );
136
- }
137
-
138
- export {
139
- VoiceSessionControls
140
- };
@@ -1,140 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }"use client";
2
-
3
-
4
- var _chunkNKWHDI4Ccjs = require('./chunk-NKWHDI4C.cjs');
5
-
6
-
7
- var _chunkJDEXZGIYcjs = require('./chunk-JDEXZGIY.cjs');
8
-
9
-
10
- var _chunkKWLSBTB2cjs = require('./chunk-KWLSBTB2.cjs');
11
-
12
- // src/primitives/voice-session-controls.tsx
13
- var _react = require('react');
14
- var _lucidereact = require('lucide-react');
15
- var _jsxruntime = require('react/jsx-runtime');
16
- var SILENCE = [];
17
- var silence = () => SILENCE;
18
- var noSubscription = () => () => {
19
- };
20
- var DEFAULT_LABELS = {
21
- disconnected: "Voice chat",
22
- connecting: "Connecting\u2026",
23
- listening: "Listening\u2026",
24
- thinking: "Thinking\u2026",
25
- speaking: "Speaking",
26
- reconnecting: "Reconnecting\u2026",
27
- error: "Voice chat unavailable",
28
- start: "Start voice chat",
29
- end: "End voice chat",
30
- mute: "Mute microphone",
31
- unmute: "Unmute microphone",
32
- muted: "Microphone muted",
33
- retry: "Retry voice chat",
34
- endShort: "End voice",
35
- muteShort: "Mute",
36
- unmuteShort: "Unmute"
37
- };
38
- function VoiceSessionControls({
39
- state,
40
- onStart,
41
- onEnd,
42
- muted = false,
43
- onMutedChange,
44
- disabled = false,
45
- error,
46
- volumeBands,
47
- audioLevels,
48
- labels,
49
- size = "icon",
50
- className
51
- }) {
52
- const liveBands = _react.useSyncExternalStore.call(void 0, _nullishCoalesce(_optionalChain([audioLevels, 'optionalAccess', _ => _.subscribe]), () => ( noSubscription)), _nullishCoalesce(_optionalChain([audioLevels, 'optionalAccess', _2 => _2.getSnapshot]), () => ( silence)), silence);
53
- const copy = { ...DEFAULT_LABELS, ...labels };
54
- const active = state !== "disconnected" && state !== "error";
55
- const waiting = state === "connecting" || state === "reconnecting";
56
- return /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
57
- "div",
58
- {
59
- "data-slot": "voice-session-controls",
60
- "data-state": state,
61
- className: _chunkKWLSBTB2cjs.cn.call(void 0, "min-w-0", active ? "@container/voice w-full" : "flex flex-wrap items-center gap-2", className),
62
- children: [
63
- active ? /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { "data-slot": "voice-session-strip", className: "flex w-full flex-wrap items-center gap-4 bg-primary/5 p-4 @2xl/voice:flex-nowrap @2xl/voice:px-5", children: [
64
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "flex min-w-0 flex-1 basis-full items-center gap-3 @2xl/voice:basis-auto @2xl/voice:gap-4", children: [
65
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "div", { "aria-hidden": "true", className: _chunkKWLSBTB2cjs.cn.call(void 0,
66
- "flex size-12 shrink-0 items-center justify-center rounded-full ring-8 ring-primary/5 @sm/voice:size-14",
67
- muted ? "bg-muted text-muted-foreground" : "bg-primary text-primary-foreground"
68
- ), children: muted ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MicOff, { className: "size-5" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Mic, { className: "size-5" }) }),
69
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
70
- _chunkNKWHDI4Ccjs.AgentAudioVisualizerBar,
71
- {
72
- "aria-hidden": "true",
73
- size: "sm",
74
- barCount: 5,
75
- className: "shrink-0 text-primary [&>div]:w-1",
76
- state: muted && state === "listening" ? "disconnected" : state === "reconnecting" ? "connecting" : state,
77
- volumeBands: muted && state === "listening" ? SILENCE : _nullishCoalesce(volumeBands, () => ( liveBands))
78
- }
79
- ),
80
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "status", className: "min-w-0 flex-1 text-sm font-medium text-primary", children: muted && state === "listening" ? copy.muted : copy[state] })
81
- ] }),
82
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0, "div", { className: "ml-auto flex shrink-0 items-center gap-2", children: [
83
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
84
- _chunkJDEXZGIYcjs.Button,
85
- {
86
- type: "button",
87
- variant: "outline",
88
- size: "sm",
89
- className: "min-h-[44px] shrink-0 rounded-xl bg-background px-3 text-foreground",
90
- "aria-label": muted ? copy.unmute : copy.mute,
91
- title: muted ? copy.unmute : copy.mute,
92
- "aria-pressed": muted,
93
- disabled: waiting,
94
- onClick: () => onMutedChange(!muted),
95
- children: [
96
- muted ? /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Mic, { "aria-hidden": "true" }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.MicOff, { "aria-hidden": "true" }),
97
- muted ? copy.unmuteShort : copy.muteShort
98
- ]
99
- }
100
- ),
101
- /* @__PURE__ */ _jsxruntime.jsxs.call(void 0,
102
- _chunkJDEXZGIYcjs.Button,
103
- {
104
- type: "button",
105
- variant: "outline",
106
- size: "sm",
107
- className: "min-h-[44px] shrink-0 rounded-xl bg-background px-3 text-foreground",
108
- "aria-label": copy.end,
109
- title: copy.end,
110
- onClick: onEnd,
111
- children: [
112
- /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.Square, { "aria-hidden": "true", className: "fill-current" }),
113
- copy.endShort
114
- ]
115
- }
116
- )
117
- ] })
118
- ] }) : /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
119
- _chunkJDEXZGIYcjs.Button,
120
- {
121
- type: "button",
122
- size: "icon",
123
- shape: "circle",
124
- disabled,
125
- onClick: onStart,
126
- "aria-label": state === "error" ? copy.retry : copy.start,
127
- title: state === "error" ? copy.retry : copy.start,
128
- className: _chunkKWLSBTB2cjs.cn.call(void 0, "min-h-[44px] min-w-[44px] shrink-0 rounded-full", size === "hero" && "size-24 [&_svg]:size-7"),
129
- children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0, _lucidereact.AudioLines, { "aria-hidden": "true" })
130
- }
131
- ),
132
- state === "error" && /* @__PURE__ */ _jsxruntime.jsx.call(void 0, "span", { role: "alert", className: "basis-full text-xs text-destructive", children: error || copy.error })
133
- ]
134
- }
135
- );
136
- }
137
-
138
-
139
-
140
- exports.VoiceSessionControls = VoiceSessionControls;