@swisper.ai/web-chat-ui 0.3.3 → 0.4.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.
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts +10 -1
- package/dist/components/chat-prompt-box/chat-prompt-box-context.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/chat-prompt-box-voice-motion.d.ts +85 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice-motion.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice.d.ts +20 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice.stories.d.ts +45 -0
- package/dist/components/chat-prompt-box/chat-prompt-box-voice.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts +24 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/chat-prompt-box.stories.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.d.ts +31 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.stories.d.ts +17 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.d.ts +29 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.stories.d.ts +12 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-button/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.d.ts +44 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.stories.d.ts +17 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-light/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.d.ts +14 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.stories.d.ts +11 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.d.ts +18 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.stories.d.ts +18 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-panel/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.d.ts +14 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.stories.d.ts +11 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.stories.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/index.d.ts +3 -0
- package/dist/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/components/index.d.ts +7 -0
- package/dist/components/chat-prompt-box/components/index.d.ts.map +1 -0
- package/dist/components/chat-prompt-box/index.d.ts +5 -1
- package/dist/components/chat-prompt-box/index.d.ts.map +1 -1
- package/dist/components/chat-prompt-box/use-voice-motion.d.ts +22 -0
- package/dist/components/chat-prompt-box/use-voice-motion.d.ts.map +1 -0
- package/dist/index.css +1 -1
- package/dist/index.es.js +2285 -1443
- package/dist/index.es.js.map +1 -1
- package/package.json +2 -2
- package/src/components/chat-prompt-box/chat-prompt-box-context.tsx +35 -1
- package/src/components/chat-prompt-box/chat-prompt-box-voice-motion.ts +436 -0
- package/src/components/chat-prompt-box/chat-prompt-box-voice.stories.tsx +243 -0
- package/src/components/chat-prompt-box/chat-prompt-box-voice.tsx +191 -0
- package/src/components/chat-prompt-box/chat-prompt-box.json +66 -7
- package/src/components/chat-prompt-box/chat-prompt-box.stories.tsx +16 -0
- package/src/components/chat-prompt-box/chat-prompt-box.tsx +131 -77
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.stories.tsx +155 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/chat-prompt-box-voice-bar-icon.tsx +80 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-bar-icon/index.ts +5 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.stories.tsx +107 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-button/chat-prompt-box-voice-button.tsx +101 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-button/index.ts +5 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.stories.tsx +177 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-light/chat-prompt-box-voice-light.tsx +283 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-light/index.ts +5 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.stories.tsx +50 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/chat-prompt-box-voice-mic-button.tsx +46 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-mic-button/index.ts +2 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.stories.tsx +149 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-panel/chat-prompt-box-voice-panel.tsx +55 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-panel/index.ts +5 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.stories.tsx +50 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/chat-prompt-box-voice-sound-button.tsx +46 -0
- package/src/components/chat-prompt-box/components/chat-prompt-box-voice-sound-button/index.ts +2 -0
- package/src/components/chat-prompt-box/components/index.ts +6 -0
- package/src/components/chat-prompt-box/index.ts +23 -0
- package/src/components/chat-prompt-box/use-voice-motion.ts +184 -0
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { forwardRef } from 'react';
|
|
2
|
+
|
|
3
|
+
import { CloseIcon, EnterIcon } from '@swisper.ai/icons';
|
|
4
|
+
import { IconButton, type IconButtonProps } from '@swisper.ai/ui';
|
|
5
|
+
import { cn } from '@swisper.ai/web-core';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
ChatPromptBoxVoiceBarIcon,
|
|
9
|
+
type ChatPromptBoxVoiceBarIconState,
|
|
10
|
+
} from '../chat-prompt-box-voice-bar-icon';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* What the button shows. `bars`: the live voice bars on a pressed Prominent button; hover or
|
|
14
|
+
* keyboard focus swaps them for Close, and a click ends voice mode. `send`: a Primary button with
|
|
15
|
+
* the enter icon, for when the field has text.
|
|
16
|
+
*/
|
|
17
|
+
export type ChatPromptBoxVoiceButtonShow = 'bars' | 'send';
|
|
18
|
+
|
|
19
|
+
export interface ChatPromptBoxVoiceButtonProps extends Omit<
|
|
20
|
+
IconButtonProps,
|
|
21
|
+
'variant' | 'size' | 'children' | 'isActive'
|
|
22
|
+
> {
|
|
23
|
+
/** What the button shows. Defaults to `bars`. */
|
|
24
|
+
show?: ChatPromptBoxVoiceButtonShow;
|
|
25
|
+
/**
|
|
26
|
+
* What the voice session is doing; passed to `ChatPromptBoxVoiceBarIcon`. Only read when `show`
|
|
27
|
+
* is `bars`. Leave it unset inside a voice-mode `ChatPromptBox`: the bars then follow the box.
|
|
28
|
+
*/
|
|
29
|
+
state?: ChatPromptBoxVoiceBarIconState;
|
|
30
|
+
/** How loud the speaker is, 0 to 1; passed to `ChatPromptBoxVoiceBarIcon`. Only read when `state` is `voice`. */
|
|
31
|
+
level?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* The bars button is pressed (`isActive`). On hover and keyboard focus it shows Close with the
|
|
36
|
+
* Prominent hover look, as in the Echo DS Close variant; the `data-active:` compounds outrank the
|
|
37
|
+
* pressed classes of `iconButtonVariants`.
|
|
38
|
+
*/
|
|
39
|
+
const BARS_CLASSES = [
|
|
40
|
+
'group/voice-button',
|
|
41
|
+
'data-active:hover:[--interactive-overlay:var(--interactive-overlay-hover)]',
|
|
42
|
+
'data-active:hover:border-icon-button-prominent-border-hover',
|
|
43
|
+
'data-active:hover:text-icon-button-prominent-icon-hover',
|
|
44
|
+
'data-active:focus-visible:[--interactive-overlay:var(--interactive-overlay-hover)]',
|
|
45
|
+
'data-active:focus-visible:border-icon-button-prominent-border-hover',
|
|
46
|
+
'data-active:focus-visible:text-icon-button-prominent-icon-hover',
|
|
47
|
+
];
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* The last button of the voice panel (Echo DS `_Voice-button`). With `show="bars"` it holds the
|
|
51
|
+
* `ChatPromptBoxVoiceBarIcon` for `state` and turns into Close on hover or keyboard focus (touch keeps the
|
|
52
|
+
* bars); wire `onClick` to end voice mode. With `show="send"` it is the send button; wire
|
|
53
|
+
* `onClick` to send. `aria-label` defaults to "End voice mode" or "Send message". Inside a
|
|
54
|
+
* voice-mode `ChatPromptBox`, leave `state` and `level` unset: the bars follow the box's mode and
|
|
55
|
+
* `voiceLevel`.
|
|
56
|
+
*/
|
|
57
|
+
export const ChatPromptBoxVoiceButton = forwardRef<
|
|
58
|
+
HTMLButtonElement | HTMLSpanElement,
|
|
59
|
+
ChatPromptBoxVoiceButtonProps
|
|
60
|
+
>(function ChatPromptBoxVoiceButton({ show = 'bars', state, level, className, ...rest }, ref) {
|
|
61
|
+
if (show === 'send') {
|
|
62
|
+
return (
|
|
63
|
+
<IconButton
|
|
64
|
+
ref={ref}
|
|
65
|
+
variant="primary"
|
|
66
|
+
size="lg"
|
|
67
|
+
aria-label="Send message"
|
|
68
|
+
data-show={show}
|
|
69
|
+
className={className}
|
|
70
|
+
{...rest}
|
|
71
|
+
>
|
|
72
|
+
<EnterIcon />
|
|
73
|
+
</IconButton>
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<IconButton
|
|
79
|
+
ref={ref}
|
|
80
|
+
variant="prominent"
|
|
81
|
+
size="lg"
|
|
82
|
+
isActive
|
|
83
|
+
aria-label="End voice mode"
|
|
84
|
+
data-show={show}
|
|
85
|
+
className={cn(BARS_CLASSES, className)}
|
|
86
|
+
{...rest}
|
|
87
|
+
>
|
|
88
|
+
<ChatPromptBoxVoiceBarIcon
|
|
89
|
+
state={state}
|
|
90
|
+
level={level}
|
|
91
|
+
className="group-hover/voice-button:hidden group-focus-visible/voice-button:hidden"
|
|
92
|
+
/>
|
|
93
|
+
{/* SvgIcon sets an inline `display`, so the wrapper does the hiding. */}
|
|
94
|
+
<span className="hidden group-hover/voice-button:contents group-focus-visible/voice-button:contents">
|
|
95
|
+
<CloseIcon />
|
|
96
|
+
</span>
|
|
97
|
+
</IconButton>
|
|
98
|
+
);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
ChatPromptBoxVoiceButton.displayName = 'ChatPromptBoxVoiceButton';
|
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { useEffect, useState, type ReactNode } from 'react';
|
|
3
|
+
|
|
4
|
+
import { Typography } from '@swisper.ai/ui';
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
ChatPromptBoxVoiceLight,
|
|
8
|
+
type ChatPromptBoxVoiceLightState,
|
|
9
|
+
} from './chat-prompt-box-voice-light';
|
|
10
|
+
|
|
11
|
+
const STATES: ChatPromptBoxVoiceLightState[] = [
|
|
12
|
+
'listening',
|
|
13
|
+
'user-speaking',
|
|
14
|
+
'thinking',
|
|
15
|
+
'speaking',
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
const STATE_LABELS: Record<ChatPromptBoxVoiceLightState, string> = {
|
|
19
|
+
listening: 'Listening',
|
|
20
|
+
'user-speaking': 'User speaking',
|
|
21
|
+
thinking: 'Thinking',
|
|
22
|
+
speaking: 'Speaking',
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
const INTENSITIES = [
|
|
26
|
+
{ label: 'Min', level: 0 },
|
|
27
|
+
{ label: 'Base', level: 0.5 },
|
|
28
|
+
{ label: 'Max', level: 1 },
|
|
29
|
+
] as const;
|
|
30
|
+
|
|
31
|
+
/** The prompt box's top edge under the light, as in the Echo DS frames. */
|
|
32
|
+
function Stage({ children }: { children: ReactNode }) {
|
|
33
|
+
return (
|
|
34
|
+
<div className="w-full max-w-chat-area">
|
|
35
|
+
{children}
|
|
36
|
+
<div className="h-px bg-promptbox-voice-border-line" />
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const meta: Meta<typeof ChatPromptBoxVoiceLight> = {
|
|
42
|
+
title: 'Chat/ChatPromptBox/Components/ChatPromptBoxVoiceLight',
|
|
43
|
+
component: ChatPromptBoxVoiceLight,
|
|
44
|
+
argTypes: {
|
|
45
|
+
state: {
|
|
46
|
+
control: 'select',
|
|
47
|
+
options: STATES,
|
|
48
|
+
description: 'What the voice session is doing; sets the shape, the colours and the motion.',
|
|
49
|
+
table: { defaultValue: { summary: 'listening' } },
|
|
50
|
+
},
|
|
51
|
+
level: {
|
|
52
|
+
control: { type: 'range', min: 0, max: 1, step: 0.01 },
|
|
53
|
+
description:
|
|
54
|
+
'Holds the light at one moment of the state: 0 Min, 0.5 Base, 1 Max. Unset, Listening and Thinking move on their own; clear the control to see that.',
|
|
55
|
+
},
|
|
56
|
+
bands: {
|
|
57
|
+
control: 'object',
|
|
58
|
+
description:
|
|
59
|
+
'Swisper’s voice by frequency, 0 to 1, low to high. Low bands lift the middle, high bands the sides. Only read in `speaking`.',
|
|
60
|
+
},
|
|
61
|
+
className: { description: 'Extra classes merged onto the full-width, 103px box.' },
|
|
62
|
+
},
|
|
63
|
+
args: {
|
|
64
|
+
state: 'speaking',
|
|
65
|
+
level: 0.5,
|
|
66
|
+
},
|
|
67
|
+
render: (args) => (
|
|
68
|
+
<Stage>
|
|
69
|
+
<ChatPromptBoxVoiceLight {...args} />
|
|
70
|
+
</Stage>
|
|
71
|
+
),
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export default meta;
|
|
75
|
+
type Story = StoryObj<typeof ChatPromptBoxVoiceLight>;
|
|
76
|
+
|
|
77
|
+
/** Try each state, drag `level`, and give `bands` to shape the Speaking wave. */
|
|
78
|
+
export const Playground: Story = {};
|
|
79
|
+
|
|
80
|
+
/** The Echo DS frames: each state at Min, Base and Max (`level` 0, 0.5 and 1). */
|
|
81
|
+
export const AllStates: Story = {
|
|
82
|
+
parameters: { controls: { disable: true } },
|
|
83
|
+
render: () => (
|
|
84
|
+
<div className="flex flex-col gap-8">
|
|
85
|
+
{STATES.map((state) => (
|
|
86
|
+
<div key={state} className="flex flex-col gap-4">
|
|
87
|
+
<Typography variant="body-sm">{STATE_LABELS[state]}</Typography>
|
|
88
|
+
<div className="grid grid-cols-3 gap-8">
|
|
89
|
+
{INTENSITIES.map(({ label, level }) => (
|
|
90
|
+
<div key={label} className="flex flex-col gap-2">
|
|
91
|
+
<Stage>
|
|
92
|
+
<ChatPromptBoxVoiceLight state={state} level={level} />
|
|
93
|
+
</Stage>
|
|
94
|
+
<Typography variant="body-sm">{label}</Typography>
|
|
95
|
+
</div>
|
|
96
|
+
))}
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
))}
|
|
100
|
+
</div>
|
|
101
|
+
),
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Without `level`: Listening breathes (5.5s), Thinking beats (1.1s); User speaking and Speaking
|
|
106
|
+
* rest on Base (in `ChatPromptBox` they follow `voiceLevel`). With reduced motion all rest on Base.
|
|
107
|
+
*/
|
|
108
|
+
export const SelfAnimated: Story = {
|
|
109
|
+
parameters: { controls: { disable: true } },
|
|
110
|
+
render: () => (
|
|
111
|
+
<div className="flex flex-col gap-8">
|
|
112
|
+
{STATES.map((state) => (
|
|
113
|
+
<div key={state} className="flex flex-col gap-2">
|
|
114
|
+
<Stage>
|
|
115
|
+
<ChatPromptBoxVoiceLight state={state} />
|
|
116
|
+
</Stage>
|
|
117
|
+
<Typography variant="body-sm">{STATE_LABELS[state]}</Typography>
|
|
118
|
+
</div>
|
|
119
|
+
))}
|
|
120
|
+
</div>
|
|
121
|
+
),
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
const BAND_COUNT = 8;
|
|
125
|
+
|
|
126
|
+
/** A voice that moves like speech: a loudness swell and bands that drift, updated every frame. */
|
|
127
|
+
function useSimulatedVoice() {
|
|
128
|
+
const [voice, setVoice] = useState({ level: 0.5, bands: Array<number>(BAND_COUNT).fill(0.5) });
|
|
129
|
+
|
|
130
|
+
useEffect(() => {
|
|
131
|
+
let frame = 0;
|
|
132
|
+
const tick = (time: number) => {
|
|
133
|
+
const swell = 0.55 + 0.4 * Math.sin(time / 300) * Math.sin(time / 830);
|
|
134
|
+
const bands = Array.from({ length: BAND_COUNT }, (_, band) => {
|
|
135
|
+
const wave = 0.5 + 0.5 * Math.sin(time / (180 + band * 40) + band * 1.7);
|
|
136
|
+
return Math.min(1, Math.max(0, wave * (1 - band * 0.06)));
|
|
137
|
+
});
|
|
138
|
+
setVoice({ level: Math.min(1, Math.max(0, swell)), bands });
|
|
139
|
+
frame = requestAnimationFrame(tick);
|
|
140
|
+
};
|
|
141
|
+
frame = requestAnimationFrame(tick);
|
|
142
|
+
return () => cancelAnimationFrame(frame);
|
|
143
|
+
}, []);
|
|
144
|
+
|
|
145
|
+
return voice;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function FollowsAudioDemo() {
|
|
149
|
+
const { level, bands } = useSimulatedVoice();
|
|
150
|
+
|
|
151
|
+
return (
|
|
152
|
+
<div className="flex flex-col gap-8">
|
|
153
|
+
<div className="flex flex-col gap-2">
|
|
154
|
+
<Stage>
|
|
155
|
+
<ChatPromptBoxVoiceLight state="speaking" level={level} bands={bands} />
|
|
156
|
+
</Stage>
|
|
157
|
+
<Typography variant="body-sm" className="tabular-nums">
|
|
158
|
+
Speaking · level {level.toFixed(2)} · {BAND_COUNT} bands
|
|
159
|
+
</Typography>
|
|
160
|
+
</div>
|
|
161
|
+
<div className="flex flex-col gap-2">
|
|
162
|
+
<Stage>
|
|
163
|
+
<ChatPromptBoxVoiceLight state="user-speaking" level={level} />
|
|
164
|
+
</Stage>
|
|
165
|
+
<Typography variant="body-sm" className="tabular-nums">
|
|
166
|
+
User speaking · level {level.toFixed(2)}
|
|
167
|
+
</Typography>
|
|
168
|
+
</div>
|
|
169
|
+
</div>
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
/** Speaking follows the voice frame by frame: `level` sets the height, `bands` the wave. */
|
|
174
|
+
export const FollowsAudio: Story = {
|
|
175
|
+
parameters: { controls: { disable: true } },
|
|
176
|
+
render: () => <FollowsAudioDemo />,
|
|
177
|
+
};
|
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { forwardRef, useMemo, type ComponentProps, type CSSProperties } from 'react';
|
|
2
|
+
|
|
3
|
+
import { cn } from '@swisper.ai/web-core';
|
|
4
|
+
|
|
5
|
+
import {
|
|
6
|
+
VOICE_LIGHT_LAYERS,
|
|
7
|
+
voiceLightRiseAt,
|
|
8
|
+
voiceLightVars,
|
|
9
|
+
type VoiceLightState,
|
|
10
|
+
} from '../../chat-prompt-box-voice-motion';
|
|
11
|
+
import { useVoiceMotion, useVoiceMotionRef } from '../../use-voice-motion';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* What the voice session is doing. `listening`: nobody speaks, a slow breath. `user-speaking`: the
|
|
15
|
+
* user's voice. `thinking`: the shield beat. `speaking`: Swisper's voice, a wave with a cream middle
|
|
16
|
+
* where it is loud.
|
|
17
|
+
*/
|
|
18
|
+
export type ChatPromptBoxVoiceLightState = VoiceLightState;
|
|
19
|
+
|
|
20
|
+
/** How each layer looks; how far it rises and its cream are in `VOICE_LIGHT_LAYERS`. */
|
|
21
|
+
const LAYER_LOOK: Record<
|
|
22
|
+
(typeof VOICE_LIGHT_LAYERS)[number]['name'],
|
|
23
|
+
{ blur: string; fade: string }
|
|
24
|
+
> = {
|
|
25
|
+
haze: {
|
|
26
|
+
blur: '21px',
|
|
27
|
+
fade: 'linear-gradient(to bottom, transparent 25.04%, rgba(0,0,0,0.6) 62.9%, #000 88.15%)',
|
|
28
|
+
},
|
|
29
|
+
body: {
|
|
30
|
+
blur: '14px',
|
|
31
|
+
fade: 'linear-gradient(to bottom, transparent 42.64%, rgba(0,0,0,0.6) 69.94%, #000 88.15%)',
|
|
32
|
+
},
|
|
33
|
+
rim: {
|
|
34
|
+
blur: '5.6px',
|
|
35
|
+
fade: 'linear-gradient(to bottom, transparent 66.1%, rgba(0,0,0,0.6) 79.33%, #000 88.15%)',
|
|
36
|
+
},
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** Points across the light, one every 9.2px of the 588.8px Echo DS light. */
|
|
40
|
+
const POINTS = 65;
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* The top edge of Speaking, Base in Echo DS, as a share of its rise (left to right). Used when no
|
|
44
|
+
* `bands` are given.
|
|
45
|
+
*/
|
|
46
|
+
const FIGMA_SPEAKING_WAVE: readonly number[] = [
|
|
47
|
+
0, 0.073, 0.106, 0.135, 0.155, 0.172, 0.182, 0.191, 0.195, 0.188, 0.182, 0.182, 0.182, 0.182,
|
|
48
|
+
0.185, 0.201, 0.241, 0.304, 0.38, 0.452, 0.538, 0.66, 0.802, 0.917, 0.98, 1, 1, 0.993, 0.964,
|
|
49
|
+
0.875, 0.739, 0.604, 0.531, 0.518, 0.545, 0.581, 0.611, 0.657, 0.719, 0.792, 0.842, 0.842, 0.789,
|
|
50
|
+
0.706, 0.63, 0.571, 0.512, 0.436, 0.37, 0.333, 0.337, 0.366, 0.399, 0.416, 0.409, 0.389, 0.36,
|
|
51
|
+
0.337, 0.323, 0.32, 0.317, 0.297, 0.251, 0.175, 0,
|
|
52
|
+
];
|
|
53
|
+
|
|
54
|
+
/** Position of point `i` from the middle, -1 (left edge) to 1 (right edge). */
|
|
55
|
+
function positionOf(i: number) {
|
|
56
|
+
return (i / (POINTS - 1)) * 2 - 1;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** Thinking: fuller in the middle, 25% at the ends. */
|
|
60
|
+
function tent(u: number) {
|
|
61
|
+
return 0.25 + 0.75 * Math.pow(Math.max(0, 1 - Math.abs(u)), 0.9);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/** Speaking's frequency wave: a dome under the bands. */
|
|
65
|
+
function dome(u: number) {
|
|
66
|
+
return Math.pow(Math.max(0, 1 - u * u), 0.6);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function clamp01(value: number) {
|
|
70
|
+
if (Number.isNaN(value)) return 0;
|
|
71
|
+
return Math.min(1, Math.max(0, value));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* The Speaking wave from frequency bands: low bands lift the middle, high bands the sides (mirrored),
|
|
76
|
+
* eased between bands and brought down to 0 at the edges. Its peak is 1.
|
|
77
|
+
*/
|
|
78
|
+
function waveFromBands(bands: readonly number[]) {
|
|
79
|
+
const last = bands.length - 1;
|
|
80
|
+
const raw = Array.from({ length: POINTS }, (_, i) => {
|
|
81
|
+
const u = positionOf(i);
|
|
82
|
+
const t = Math.abs(u) * last;
|
|
83
|
+
const low = Math.floor(t);
|
|
84
|
+
const high = Math.min(last, low + 1);
|
|
85
|
+
const ease = (1 - Math.cos((t - low) * Math.PI)) / 2;
|
|
86
|
+
const band = clamp01(bands[low]) * (1 - ease) + clamp01(bands[high]) * ease;
|
|
87
|
+
return (0.4 + 0.6 * band) * dome(u);
|
|
88
|
+
});
|
|
89
|
+
const peak = Math.max(...raw);
|
|
90
|
+
return peak > 0 ? raw.map((value) => value / peak) : raw;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
function profileFor(state: ChatPromptBoxVoiceLightState, bands: readonly number[] | undefined) {
|
|
94
|
+
if (state === 'speaking') {
|
|
95
|
+
return bands && bands.length > 0 ? waveFromBands(bands) : FIGMA_SPEAKING_WAVE;
|
|
96
|
+
}
|
|
97
|
+
// Listening and User speaking: the same height all along the box.
|
|
98
|
+
if (state !== 'thinking') return Array.from({ length: POINTS }, () => 1);
|
|
99
|
+
return Array.from({ length: POINTS }, (_, i) => tent(positionOf(i)));
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** The curve's outline in a 64 × 1 box, stretched to the light's width and rise. */
|
|
103
|
+
function pathFor(profile: readonly number[]) {
|
|
104
|
+
const top = profile.map((value, i) => `L${i} ${(1 - value).toFixed(3)}`).join('');
|
|
105
|
+
return `M0 1${top}L${POINTS - 1} 1Z`;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Where the voice is loud, as a share of the cream's peak: the wave smoothed, above about a third of
|
|
110
|
+
* its height. Stops every fourth point, left to right across the light.
|
|
111
|
+
*/
|
|
112
|
+
function creamShape(profile: readonly number[]) {
|
|
113
|
+
const stops: { at: number; alpha: number }[] = [];
|
|
114
|
+
for (let i = 0; i < POINTS; i += 4) {
|
|
115
|
+
let sum = 0;
|
|
116
|
+
let count = 0;
|
|
117
|
+
for (let j = Math.max(0, i - 3); j <= Math.min(POINTS - 1, i + 3); j++) {
|
|
118
|
+
sum += profile[j];
|
|
119
|
+
count++;
|
|
120
|
+
}
|
|
121
|
+
stops.push({ at: (i / (POINTS - 1)) * 100, alpha: clamp01((sum / count - 0.35) / 0.6) });
|
|
122
|
+
}
|
|
123
|
+
return stops;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
function creamMask(shape: { at: number; alpha: number }[]) {
|
|
127
|
+
const stops = shape.map(({ at, alpha }) => `rgba(0,0,0,${alpha.toFixed(3)}) ${at.toFixed(1)}%`);
|
|
128
|
+
return `linear-gradient(to right, ${stops.join(', ')})`;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** The curve, stretched to the layer's rise, over the 22px solid base. Fills with `currentColor`. */
|
|
132
|
+
function VoiceLightShape({
|
|
133
|
+
path,
|
|
134
|
+
className,
|
|
135
|
+
style,
|
|
136
|
+
}: {
|
|
137
|
+
path: string;
|
|
138
|
+
className?: string;
|
|
139
|
+
style?: CSSProperties;
|
|
140
|
+
}) {
|
|
141
|
+
return (
|
|
142
|
+
<div className={cn('flex flex-col', className)} style={style}>
|
|
143
|
+
<div data-slot="voice-light-curve" className="h-(--voice-light-layer-rise) shrink-0">
|
|
144
|
+
<svg
|
|
145
|
+
viewBox={`0 0 ${POINTS - 1} 1`}
|
|
146
|
+
preserveAspectRatio="none"
|
|
147
|
+
className="block size-full"
|
|
148
|
+
fill="currentColor"
|
|
149
|
+
>
|
|
150
|
+
<path d={path} />
|
|
151
|
+
</svg>
|
|
152
|
+
</div>
|
|
153
|
+
<div className="h-[22px] shrink-0 bg-current" />
|
|
154
|
+
</div>
|
|
155
|
+
);
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
export interface ChatPromptBoxVoiceLightLayersProps extends Omit<
|
|
159
|
+
ComponentProps<'div'>,
|
|
160
|
+
'children'
|
|
161
|
+
> {
|
|
162
|
+
state: ChatPromptBoxVoiceLightState;
|
|
163
|
+
bands?: readonly number[];
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The light's three layers, drawn from CSS variables: `--voice-light-rise` (the haze's rise in px),
|
|
168
|
+
* `--voice-light-opacity-{haze|body|rim}` and, in Speaking, `--voice-light-cream-{haze|body|rim}`.
|
|
169
|
+
* The voice clock sets them (see `voiceLightVars`); `ChatPromptBox` draws its light with this.
|
|
170
|
+
*/
|
|
171
|
+
export const ChatPromptBoxVoiceLightLayers = forwardRef<
|
|
172
|
+
HTMLDivElement,
|
|
173
|
+
ChatPromptBoxVoiceLightLayersProps
|
|
174
|
+
>(function ChatPromptBoxVoiceLightLayers({ state, bands, className, ...rest }, ref) {
|
|
175
|
+
const isSpeaking = state === 'speaking';
|
|
176
|
+
const profile = useMemo(
|
|
177
|
+
() => profileFor(state, isSpeaking ? bands : undefined),
|
|
178
|
+
[state, isSpeaking, bands],
|
|
179
|
+
);
|
|
180
|
+
const path = useMemo(() => pathFor(profile), [profile]);
|
|
181
|
+
const cream = useMemo(
|
|
182
|
+
() => (isSpeaking ? creamMask(creamShape(profile)) : null),
|
|
183
|
+
[isSpeaking, profile],
|
|
184
|
+
);
|
|
185
|
+
|
|
186
|
+
return (
|
|
187
|
+
<div
|
|
188
|
+
ref={ref}
|
|
189
|
+
aria-hidden
|
|
190
|
+
data-slot="voice-light"
|
|
191
|
+
data-state={state}
|
|
192
|
+
className={cn('relative h-[103px] w-full overflow-hidden pointer-events-none', className)}
|
|
193
|
+
{...rest}
|
|
194
|
+
>
|
|
195
|
+
{VOICE_LIGHT_LAYERS.map((layer) => {
|
|
196
|
+
const look = LAYER_LOOK[layer.name];
|
|
197
|
+
const style = {
|
|
198
|
+
'--voice-light-layer-rise': `calc(var(--voice-light-rise, 0px) * ${layer.riseScale})`,
|
|
199
|
+
opacity: `var(--voice-light-opacity-${layer.name}, 0)`,
|
|
200
|
+
maskImage: look.fade,
|
|
201
|
+
WebkitMaskImage: look.fade,
|
|
202
|
+
filter: `blur(${look.blur})`,
|
|
203
|
+
} as CSSProperties;
|
|
204
|
+
|
|
205
|
+
return (
|
|
206
|
+
<div
|
|
207
|
+
key={layer.name}
|
|
208
|
+
data-slot="voice-light-layer"
|
|
209
|
+
data-layer={layer.name}
|
|
210
|
+
className="absolute inset-x-0 bottom-[-32px] h-[135px]"
|
|
211
|
+
style={style}
|
|
212
|
+
>
|
|
213
|
+
<div className="absolute inset-x-[10%] bottom-[-4px]">
|
|
214
|
+
<VoiceLightShape path={path} className="text-promptbox-voice-light" />
|
|
215
|
+
{cream ? (
|
|
216
|
+
<VoiceLightShape
|
|
217
|
+
path={path}
|
|
218
|
+
className="absolute inset-x-0 bottom-0 text-promptbox-voice-light-loud"
|
|
219
|
+
style={{
|
|
220
|
+
maskImage: cream,
|
|
221
|
+
WebkitMaskImage: cream,
|
|
222
|
+
opacity: `var(--voice-light-cream-${layer.name}, 0)`,
|
|
223
|
+
}}
|
|
224
|
+
/>
|
|
225
|
+
) : null}
|
|
226
|
+
</div>
|
|
227
|
+
</div>
|
|
228
|
+
);
|
|
229
|
+
})}
|
|
230
|
+
</div>
|
|
231
|
+
);
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
ChatPromptBoxVoiceLightLayers.displayName = 'ChatPromptBoxVoiceLightLayers';
|
|
235
|
+
|
|
236
|
+
export interface ChatPromptBoxVoiceLightProps extends Omit<ComponentProps<'div'>, 'children'> {
|
|
237
|
+
/** What the voice session is doing; sets the shape, the colours and the motion. Defaults to `listening`. */
|
|
238
|
+
state?: ChatPromptBoxVoiceLightState;
|
|
239
|
+
/**
|
|
240
|
+
* Holds the light at one moment of the state, 0 to 1: 0 is the Echo DS Min frame, 0.5 Base, 1
|
|
241
|
+
* Max. Unset, Listening breathes (5.5s) and Thinking beats (1.1s) on their own; User speaking
|
|
242
|
+
* and Speaking rest on Base. Inside a `ChatPromptBox` use its `voiceLevel` instead: the box
|
|
243
|
+
* follows the voice with the spec's easing.
|
|
244
|
+
*/
|
|
245
|
+
level?: number;
|
|
246
|
+
/**
|
|
247
|
+
* Swisper's voice by frequency, 0 to 1 each, low to high (e.g. from an `AnalyserNode`). Low bands lift
|
|
248
|
+
* the middle, high bands the sides. Only read when `state` is `speaking`; without it the wave is the
|
|
249
|
+
* Echo DS one.
|
|
250
|
+
*/
|
|
251
|
+
bands?: readonly number[];
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
/**
|
|
255
|
+
* The voice light (Echo DS `_Voice-light`): the aurora that rises from the top edge of the prompt
|
|
256
|
+
* box, full width and 103px tall, the light across the middle 80%. Three blurred layers (haze, body,
|
|
257
|
+
* rim) fade out towards the top; blue, with a cream middle in `speaking` where the voice is loud.
|
|
258
|
+
* Decorative (`aria-hidden`). `ChatPromptBox` draws its own in voice mode; use this one on its own,
|
|
259
|
+
* positioned above a box. It sets `data-state`. With reduced motion it rests on Base, or on `level`.
|
|
260
|
+
*/
|
|
261
|
+
export const ChatPromptBoxVoiceLight = forwardRef<HTMLDivElement, ChatPromptBoxVoiceLightProps>(
|
|
262
|
+
function ChatPromptBoxVoiceLight({ state = 'listening', level, bands, style, ...rest }, ref) {
|
|
263
|
+
const moves = level === undefined && (state === 'listening' || state === 'thinking');
|
|
264
|
+
const motion = useVoiceMotion(
|
|
265
|
+
moves ? { border: 'travel', light: state, bars: 'still' } : null,
|
|
266
|
+
undefined,
|
|
267
|
+
);
|
|
268
|
+
const motionRef = useVoiceMotionRef(moves ? motion : null, 'light', ref);
|
|
269
|
+
const held = moves ? null : voiceLightVars(state, voiceLightRiseAt(state, level ?? 0.5));
|
|
270
|
+
|
|
271
|
+
return (
|
|
272
|
+
<ChatPromptBoxVoiceLightLayers
|
|
273
|
+
ref={motionRef}
|
|
274
|
+
state={state}
|
|
275
|
+
bands={bands}
|
|
276
|
+
style={{ ...held, ...style }}
|
|
277
|
+
{...rest}
|
|
278
|
+
/>
|
|
279
|
+
);
|
|
280
|
+
},
|
|
281
|
+
);
|
|
282
|
+
|
|
283
|
+
ChatPromptBoxVoiceLight.displayName = 'ChatPromptBoxVoiceLight';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
import { fn } from 'storybook/test';
|
|
4
|
+
|
|
5
|
+
import { ChatPromptBoxVoiceMicButton } from './chat-prompt-box-voice-mic-button';
|
|
6
|
+
|
|
7
|
+
const meta: Meta<typeof ChatPromptBoxVoiceMicButton> = {
|
|
8
|
+
title: 'Chat/ChatPromptBox/Components/ChatPromptBoxVoiceMicButton',
|
|
9
|
+
component: ChatPromptBoxVoiceMicButton,
|
|
10
|
+
argTypes: {
|
|
11
|
+
muted: {
|
|
12
|
+
control: 'boolean',
|
|
13
|
+
description: 'Shows the mic-off icon; the button is `aria-pressed`.',
|
|
14
|
+
table: { defaultValue: { summary: 'false' } },
|
|
15
|
+
},
|
|
16
|
+
onMutedChange: { description: 'Called with the new value when the button is clicked.' },
|
|
17
|
+
},
|
|
18
|
+
args: {
|
|
19
|
+
muted: false,
|
|
20
|
+
onMutedChange: fn(),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof ChatPromptBoxVoiceMicButton>;
|
|
26
|
+
|
|
27
|
+
export const Playground: Story = {};
|
|
28
|
+
|
|
29
|
+
/** On, then off. */
|
|
30
|
+
export const AllStates: Story = {
|
|
31
|
+
parameters: { controls: { disable: true } },
|
|
32
|
+
render: () => (
|
|
33
|
+
<div className="flex items-center gap-24">
|
|
34
|
+
<ChatPromptBoxVoiceMicButton />
|
|
35
|
+
<ChatPromptBoxVoiceMicButton muted />
|
|
36
|
+
</div>
|
|
37
|
+
),
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
function ToggleDemo() {
|
|
41
|
+
const [muted, setMuted] = useState(false);
|
|
42
|
+
|
|
43
|
+
return <ChatPromptBoxVoiceMicButton muted={muted} onMutedChange={setMuted} />;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Click it: the icon swaps and `aria-pressed` flips. */
|
|
47
|
+
export const Toggle: Story = {
|
|
48
|
+
parameters: { controls: { disable: true } },
|
|
49
|
+
render: () => <ToggleDemo />,
|
|
50
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { forwardRef, type MouseEvent } from 'react';
|
|
2
|
+
|
|
3
|
+
import { MicOffIcon, MicIcon } from '@swisper.ai/icons';
|
|
4
|
+
import { IconButton, type IconButtonProps } from '@swisper.ai/ui';
|
|
5
|
+
|
|
6
|
+
export interface ChatPromptBoxVoiceMicButtonProps extends Omit<
|
|
7
|
+
IconButtonProps,
|
|
8
|
+
'variant' | 'size' | 'children' | 'aria-pressed'
|
|
9
|
+
> {
|
|
10
|
+
/** The mic is off: shows the mic-off icon and presses the button. Defaults to `false`. */
|
|
11
|
+
muted?: boolean;
|
|
12
|
+
/** Called with the new value when the button is clicked. */
|
|
13
|
+
onMutedChange?: (muted: boolean) => void;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* The mic toggle of the voice panel (Echo DS `_Voice-panel`): a Tertiary `aria-pressed` button
|
|
18
|
+
* that swaps to the mic-off icon while `muted`. Put it in `ChatPromptBoxVoicePanel`.
|
|
19
|
+
* `aria-label` defaults to "Mute microphone".
|
|
20
|
+
*/
|
|
21
|
+
export const ChatPromptBoxVoiceMicButton = forwardRef<
|
|
22
|
+
HTMLButtonElement | HTMLSpanElement,
|
|
23
|
+
ChatPromptBoxVoiceMicButtonProps
|
|
24
|
+
>(function ChatPromptBoxVoiceMicButton({ muted = false, onMutedChange, onClick, ...rest }, ref) {
|
|
25
|
+
const handleClick = (event: MouseEvent<HTMLButtonElement>) => {
|
|
26
|
+
onClick?.(event);
|
|
27
|
+
onMutedChange?.(!muted);
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<IconButton
|
|
32
|
+
ref={ref}
|
|
33
|
+
variant="tertiary"
|
|
34
|
+
size="lg"
|
|
35
|
+
aria-label="Mute microphone"
|
|
36
|
+
aria-pressed={muted}
|
|
37
|
+
data-slot="chat-prompt-box-voice-mic-button"
|
|
38
|
+
onClick={handleClick}
|
|
39
|
+
{...rest}
|
|
40
|
+
>
|
|
41
|
+
{muted ? <MicOffIcon /> : <MicIcon />}
|
|
42
|
+
</IconButton>
|
|
43
|
+
);
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
ChatPromptBoxVoiceMicButton.displayName = 'ChatPromptBoxVoiceMicButton';
|