@progress/kendo-react-buttons 13.3.0-develop.9 → 13.4.0-develop.1
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/Button.d.ts +114 -0
- package/Button.js +1 -1
- package/Button.mjs +42 -44
- package/ButtonGroup.d.ts +47 -0
- package/ButtonGroupInterface.d.ts +39 -0
- package/ButtonInterface.d.ts +49 -0
- package/Chip/Chip.d.ts +425 -0
- package/Chip/Chip.js +1 -1
- package/Chip/Chip.mjs +43 -39
- package/Chip/ChipList.d.ts +221 -0
- package/Chip/ChipList.js +1 -1
- package/Chip/ChipList.mjs +40 -41
- package/Chip/chip-list-contexts.d.ts +20 -0
- package/Chip/data-reducer.d.ts +29 -0
- package/Chip/focus-reducer.d.ts +31 -0
- package/Chip/selection-reducer.d.ts +37 -0
- package/FloatingActionButton/FloatingActionButton.d.ts +23 -0
- package/FloatingActionButton/FloatingActionButton.js +1 -1
- package/FloatingActionButton/FloatingActionButton.mjs +85 -85
- package/FloatingActionButton/FloatingActionButtonItem.d.ts +132 -0
- package/FloatingActionButton/interfaces/FloatingActionButtonHandle.d.ts +20 -0
- package/FloatingActionButton/interfaces/FloatingActionButtonPopupSettings.d.ts +31 -0
- package/FloatingActionButton/interfaces/FloatingActionButtonProps.d.ts +354 -0
- package/FloatingActionButton/models/align-offset.d.ts +27 -0
- package/FloatingActionButton/models/align.d.ts +34 -0
- package/FloatingActionButton/models/events.d.ts +28 -0
- package/FloatingActionButton/models/position-mode.d.ts +16 -0
- package/FloatingActionButton/models/rounded.d.ts +19 -0
- package/FloatingActionButton/models/size.d.ts +18 -0
- package/FloatingActionButton/models/theme-color.d.ts +25 -0
- package/FloatingActionButton/utils.d.ts +34 -0
- package/ListButton/ButtonItem.d.ts +72 -0
- package/ListButton/DropDownButton.d.ts +153 -0
- package/ListButton/DropDownButton.js +1 -1
- package/ListButton/DropDownButton.mjs +62 -46
- package/ListButton/DropDownButtonItem.d.ts +37 -0
- package/ListButton/SplitButton.d.ts +142 -0
- package/ListButton/SplitButton.js +1 -1
- package/ListButton/SplitButton.mjs +29 -13
- package/ListButton/SplitButtonItem.d.ts +32 -0
- package/ListButton/models/ButtonItem.d.ts +41 -0
- package/ListButton/models/ListButtonProps.d.ts +411 -0
- package/ListButton/models/PopupSettings.d.ts +35 -0
- package/ListButton/models/events.d.ts +59 -0
- package/ListButton/utils/navigation.d.ts +12 -0
- package/ListButton/utils/popup.d.ts +16 -0
- package/SpeechToTextButton/SpeechToTextButton.d.ts +36 -0
- package/SpeechToTextButton/SpeechToTextButton.js +1 -1
- package/SpeechToTextButton/SpeechToTextButton.mjs +24 -24
- package/SpeechToTextButton/interfaces/SpeechToTextButtonHandle.d.ts +28 -0
- package/SpeechToTextButton/interfaces/SpeechToTextButtonProps.d.ts +117 -0
- package/dist/cdn/js/kendo-react-buttons.js +1 -1
- package/index.d.mts +43 -2928
- package/index.d.ts +43 -2928
- package/messages/index.d.ts +22 -0
- package/models/index.d.ts +95 -0
- package/package-metadata.d.ts +12 -0
- package/package-metadata.js +1 -1
- package/package-metadata.mjs +10 -16
- package/package.json +5 -5
- package/toolbar/Toolbar.d.ts +38 -0
- package/toolbar/Toolbar.js +1 -1
- package/toolbar/Toolbar.mjs +15 -15
- package/toolbar/events/ToolbarResizeEvent.d.ts +29 -0
- package/toolbar/interfaces/ToolbarHandle.d.ts +21 -0
- package/toolbar/interfaces/ToolbarOverflowProps.d.ts +50 -0
- package/toolbar/interfaces/ToolbarProps.d.ts +128 -0
- package/toolbar/messages/index.d.ts +27 -0
- package/toolbar/tools/ToolbarItem.d.ts +47 -0
- package/toolbar/tools/ToolbarOverflowSection.d.ts +21 -0
- package/toolbar/tools/ToolbarScrollButton.d.ts +23 -0
- package/toolbar/tools/ToolbarScrollButton.js +1 -1
- package/toolbar/tools/ToolbarScrollButton.mjs +11 -20
- package/toolbar/tools/ToolbarScrollable.d.ts +28 -0
- package/toolbar/tools/ToolbarSeparator.d.ts +22 -0
- package/toolbar/tools/ToolbarSpacer.d.ts +30 -0
- package/util.d.ts +31 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { SplitButton } from './../SplitButton.js';
|
|
9
|
+
import { DropDownButton } from './../DropDownButton.js';
|
|
10
|
+
import { BaseEvent } from '@progress/kendo-react-common';
|
|
11
|
+
export interface SplitButtonFocusEvent extends BaseEvent<SplitButton> {
|
|
12
|
+
}
|
|
13
|
+
export interface SplitButtonBlurEvent extends BaseEvent<SplitButton> {
|
|
14
|
+
}
|
|
15
|
+
export interface SplitButtonClickEvent extends BaseEvent<SplitButton> {
|
|
16
|
+
}
|
|
17
|
+
export interface SplitButtonOpenEvent extends BaseEvent<SplitButton> {
|
|
18
|
+
}
|
|
19
|
+
export interface SplitButtonCloseEvent extends BaseEvent<SplitButton> {
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* The arguments for the `itemClick` event.
|
|
23
|
+
*/
|
|
24
|
+
export interface SplitButtonItemClickEvent extends BaseEvent<SplitButton> {
|
|
25
|
+
/**
|
|
26
|
+
* The clicked item.
|
|
27
|
+
*/
|
|
28
|
+
item: any;
|
|
29
|
+
/**
|
|
30
|
+
* The zero-based index of the clicked item.
|
|
31
|
+
*/
|
|
32
|
+
itemIndex: number;
|
|
33
|
+
}
|
|
34
|
+
export interface DropDownButtonFocusEvent extends BaseEvent<DropDownButton> {
|
|
35
|
+
}
|
|
36
|
+
export interface DropDownButtonBlurEvent extends BaseEvent<DropDownButton> {
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @hidden
|
|
40
|
+
*/
|
|
41
|
+
export interface DropDownButtonClickEvent extends BaseEvent<DropDownButton> {
|
|
42
|
+
}
|
|
43
|
+
export interface DropDownButtonOpenEvent extends BaseEvent<DropDownButton> {
|
|
44
|
+
}
|
|
45
|
+
export interface DropDownButtonCloseEvent extends BaseEvent<DropDownButton> {
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The arguments for the `itemClick` event.
|
|
49
|
+
*/
|
|
50
|
+
export interface DropDownButtonItemClickEvent extends BaseEvent<DropDownButton> {
|
|
51
|
+
/**
|
|
52
|
+
* The clicked item.
|
|
53
|
+
*/
|
|
54
|
+
item: any;
|
|
55
|
+
/**
|
|
56
|
+
* The zero-based index of the clicked item.
|
|
57
|
+
*/
|
|
58
|
+
itemIndex: number;
|
|
59
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* @hidden
|
|
10
|
+
*/
|
|
11
|
+
declare const navigate: (focusedIndex: number, keyCode: number, altKey: boolean, total: number) => number;
|
|
12
|
+
export { navigate };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { Align } from '@progress/kendo-react-popup';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
export declare function getAnchorAlign(isDirectionRightToLeft?: boolean): Align;
|
|
13
|
+
/**
|
|
14
|
+
* @hidden
|
|
15
|
+
*/
|
|
16
|
+
export declare function getPopupAlign(isDirectionRightToLeft?: boolean): Align;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { default as React } from 'react';
|
|
9
|
+
import { SpeechToTextButtonProps } from './interfaces/SpeechToTextButtonProps.js';
|
|
10
|
+
import { SpeechToTextButtonHandle } from './interfaces/SpeechToTextButtonHandle.js';
|
|
11
|
+
/**
|
|
12
|
+
* Represents a speech recognition engine that will be used.
|
|
13
|
+
*/
|
|
14
|
+
export declare enum SpeechToTextButtonMode {
|
|
15
|
+
/**
|
|
16
|
+
* Uses the [Web Speech API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API) for speech recognition.
|
|
17
|
+
*/
|
|
18
|
+
WebSpeech = "webSpeech",
|
|
19
|
+
/**
|
|
20
|
+
* Does not use any speech recognition engine. Use when you need to integrate the component with external speech recognition services or APIs.
|
|
21
|
+
*/
|
|
22
|
+
None = "none"
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Represents the [KendoReact SpeechToTextButton component](https://www.telerik.com/kendo-react-ui/components/buttons/speechtotextbutton).
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```jsx
|
|
29
|
+
* const App = () => {
|
|
30
|
+
* return (
|
|
31
|
+
* <SpeechToTextButton />
|
|
32
|
+
* );
|
|
33
|
+
* };
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const SpeechToTextButton: React.ForwardRefExoticComponent<SpeechToTextButtonProps & React.RefAttributes<SpeechToTextButtonHandle>>;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
6
|
*-------------------------------------------------------------------------------------------
|
|
7
7
|
*/
|
|
8
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),ee=require("@progress/kendo-webspeech-common"),te=require("../Button.js"),u=require("@progress/kendo-react-common"),M=require("@progress/kendo-svg-icons"),a=require("../messages/index.js"),ne=require("@progress/kendo-react-intl"),I=require("../package-metadata.js"),y=e.forwardRef((r,A)=>{const q=!u.validatePackage(I.packageMetadata,{component:"SpeechToTextButton"}),B=u.getLicenseMessage(I.packageMetadata),h=ne.useLocalization(),{fillMode:E
|
|
8
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),ee=require("@progress/kendo-webspeech-common"),te=require("../Button.js"),u=require("@progress/kendo-react-common"),M=require("@progress/kendo-svg-icons"),a=require("../messages/index.js"),ne=require("@progress/kendo-react-intl"),I=require("../package-metadata.js"),y=e.forwardRef((r,A)=>{const q=!u.validatePackage(I.packageMetadata,{component:"SpeechToTextButton"}),B=u.getLicenseMessage(I.packageMetadata),h=ne.useLocalization(),{fillMode:E,rounded:L,size:z,themeColor:H,ariaLabel:d,svgIcon:S,disabled:N,iconSize:O="medium",title:f,className:F,id:P,style:W,lang:k="en-US",continuous:v=!1,interimResults:b=!1,maxAlternatives:T=1,integrationMode:K="webSpeech",onStart:g,onResult:i,onEnd:m,onError:s,...j}=r,o=e.useRef(null),n=e.useRef(!1),[c,l]=e.useState(!1),U=e.useCallback(async()=>{n.current=!0,l(!0),g&&await g()},[g]),D=e.useCallback(async()=>{n.current=!1,l(!1),m&&await m()},[m]),G=e.useCallback(t=>{const w=t.results,C=w[w.length-1],$=Array.from(C).map(x=>({transcript:x.transcript,confidence:x.confidence}));i==null||i({isFinal:C.isFinal,alternatives:$})},[i]),J=e.useCallback(t=>{l(!1),n.current=!1,s==null||s({errorMessage:t.error})},[s]),Q=()=>{var t;if(typeof window!="undefined"&&!("webkitSpeechRecognition"in window||"SpeechRecognition"in window)){s&&s({errorMessage:"Speech Recognition API is not supported in this browser."});return}(t=o.current)!=null&&t.isActive()&&o.current.stop(),o.current=new ee.KendoSpeechRecognition({lang:k,continuous:v,interimResults:b,maxAlternatives:T,events:{start:U,end:D,result:G,error:J}})},R=e.useCallback(()=>{var t;n.current||(t=o.current)==null||t.start()},[]),p=e.useCallback(()=>{var t;n.current&&((t=o.current)==null||t.stop())},[]),V=e.useCallback(()=>{var t;n.current&&((t=o.current)==null||t.abort(),n.current=!1,l(!1))},[]),X=()=>n.current;e.useImperativeHandle(A,()=>({start:R,stop:p,abort:V,isActive:X})),e.useEffect(()=>(Q(),()=>{n.current&&p()}),[k,v,b,T,K]);const Y=()=>{c?p():R()},Z=r.icon!==void 0||r.iconClass!==void 0,_=e.useMemo(()=>c?M.stopSmIcon:S||M.microphoneOutlineIcon,[c,S]);return e.createElement(e.Fragment,null,e.createElement(te.Button,{id:P,className:u.classNames({"k-speech-to-text-button":!0,"k-listening":c},F),style:W,svgIcon:Z?void 0:_,iconSize:O,fillMode:E,rounded:L,size:z,themeColor:H,"aria-label":d!=null?d:h.toLanguageString(a.speechToTextAriaLabel,a.messages[a.speechToTextAriaLabel]),"aria-pressed":c,disabled:N,title:f!=null?f:h.toLanguageString(a.speechToTextTitle,a.messages[a.speechToTextTitle]),onClick:Y,...j},r.children),q&&e.createElement(u.WatermarkOverlay,{message:B}))});y.displayName="KendoSpeechToTextButton";exports.SpeechToTextButton=y;
|
|
@@ -8,17 +8,17 @@
|
|
|
8
8
|
import e from "react";
|
|
9
9
|
import { KendoSpeechRecognition as $ } from "@progress/kendo-webspeech-common";
|
|
10
10
|
import { Button as ee } from "../Button.mjs";
|
|
11
|
-
import { validatePackage as te, getLicenseMessage as ne, classNames as re, WatermarkOverlay as
|
|
12
|
-
import { stopSmIcon as
|
|
13
|
-
import {
|
|
11
|
+
import { validatePackage as te, getLicenseMessage as ne, classNames as re, WatermarkOverlay as oe } from "@progress/kendo-react-common";
|
|
12
|
+
import { stopSmIcon as se, microphoneOutlineIcon as ae } from "@progress/kendo-svg-icons";
|
|
13
|
+
import { speechToTextTitle as T, messages as x, speechToTextAriaLabel as A } from "../messages/index.mjs";
|
|
14
14
|
import { useLocalization as ce } from "@progress/kendo-react-intl";
|
|
15
15
|
import { packageMetadata as I } from "../package-metadata.mjs";
|
|
16
16
|
const ie = e.forwardRef((a, M) => {
|
|
17
17
|
const y = !te(I, { component: "SpeechToTextButton" }), E = ne(I), p = ce(), {
|
|
18
|
-
fillMode: z
|
|
19
|
-
rounded: H
|
|
20
|
-
size: L
|
|
21
|
-
themeColor: B
|
|
18
|
+
fillMode: z,
|
|
19
|
+
rounded: H,
|
|
20
|
+
size: L,
|
|
21
|
+
themeColor: B,
|
|
22
22
|
ariaLabel: l,
|
|
23
23
|
svgIcon: g,
|
|
24
24
|
disabled: N,
|
|
@@ -30,14 +30,14 @@ const ie = e.forwardRef((a, M) => {
|
|
|
30
30
|
lang: h = "en-US",
|
|
31
31
|
continuous: S = !1,
|
|
32
32
|
interimResults: v = !1,
|
|
33
|
-
maxAlternatives:
|
|
33
|
+
maxAlternatives: k = 1,
|
|
34
34
|
integrationMode: W = "webSpeech",
|
|
35
35
|
onStart: f,
|
|
36
36
|
onResult: c,
|
|
37
37
|
onEnd: m,
|
|
38
38
|
onError: r,
|
|
39
39
|
..._
|
|
40
|
-
} = a,
|
|
40
|
+
} = a, o = e.useRef(null), n = e.useRef(!1), [s, i] = e.useState(!1), U = e.useCallback(async () => {
|
|
41
41
|
n.current = !0, i(!0), f && await f();
|
|
42
42
|
}, [f]), j = e.useCallback(async () => {
|
|
43
43
|
n.current = !1, i(!1), m && await m();
|
|
@@ -66,11 +66,11 @@ const ie = e.forwardRef((a, M) => {
|
|
|
66
66
|
r && r({ errorMessage: "Speech Recognition API is not supported in this browser." });
|
|
67
67
|
return;
|
|
68
68
|
}
|
|
69
|
-
(t =
|
|
69
|
+
(t = o.current) != null && t.isActive() && o.current.stop(), o.current = new $({
|
|
70
70
|
lang: h,
|
|
71
71
|
continuous: S,
|
|
72
72
|
interimResults: v,
|
|
73
|
-
maxAlternatives:
|
|
73
|
+
maxAlternatives: k,
|
|
74
74
|
events: {
|
|
75
75
|
start: U,
|
|
76
76
|
end: j,
|
|
@@ -78,27 +78,27 @@ const ie = e.forwardRef((a, M) => {
|
|
|
78
78
|
error: D
|
|
79
79
|
}
|
|
80
80
|
});
|
|
81
|
-
},
|
|
81
|
+
}, b = e.useCallback(() => {
|
|
82
82
|
var t;
|
|
83
|
-
n.current || (t =
|
|
83
|
+
n.current || (t = o.current) == null || t.start();
|
|
84
84
|
}, []), d = e.useCallback(() => {
|
|
85
85
|
var t;
|
|
86
|
-
n.current && ((t =
|
|
86
|
+
n.current && ((t = o.current) == null || t.stop());
|
|
87
87
|
}, []), J = e.useCallback(() => {
|
|
88
88
|
var t;
|
|
89
|
-
n.current && ((t =
|
|
89
|
+
n.current && ((t = o.current) == null || t.abort(), n.current = !1, i(!1));
|
|
90
90
|
}, []), Q = () => n.current;
|
|
91
91
|
e.useImperativeHandle(M, () => ({
|
|
92
|
-
start:
|
|
92
|
+
start: b,
|
|
93
93
|
stop: d,
|
|
94
94
|
abort: J,
|
|
95
95
|
isActive: Q
|
|
96
96
|
})), e.useEffect(() => (G(), () => {
|
|
97
97
|
n.current && d();
|
|
98
|
-
}), [h, S, v,
|
|
98
|
+
}), [h, S, v, k, W]);
|
|
99
99
|
const V = () => {
|
|
100
|
-
|
|
101
|
-
}, X = a.icon !== void 0 || a.iconClass !== void 0, Y = e.useMemo(() =>
|
|
100
|
+
s ? d() : b();
|
|
101
|
+
}, X = a.icon !== void 0 || a.iconClass !== void 0, Y = e.useMemo(() => s ? se : g || ae, [s, g]);
|
|
102
102
|
return /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(
|
|
103
103
|
ee,
|
|
104
104
|
{
|
|
@@ -106,7 +106,7 @@ const ie = e.forwardRef((a, M) => {
|
|
|
106
106
|
className: re(
|
|
107
107
|
{
|
|
108
108
|
"k-speech-to-text-button": !0,
|
|
109
|
-
"k-listening":
|
|
109
|
+
"k-listening": s
|
|
110
110
|
},
|
|
111
111
|
O
|
|
112
112
|
),
|
|
@@ -117,15 +117,15 @@ const ie = e.forwardRef((a, M) => {
|
|
|
117
117
|
rounded: H,
|
|
118
118
|
size: L,
|
|
119
119
|
themeColor: B,
|
|
120
|
-
"aria-label": l != null ? l : p.toLanguageString(
|
|
121
|
-
"aria-pressed":
|
|
120
|
+
"aria-label": l != null ? l : p.toLanguageString(A, x[A]),
|
|
121
|
+
"aria-pressed": s,
|
|
122
122
|
disabled: N,
|
|
123
|
-
title: u != null ? u : p.toLanguageString(
|
|
123
|
+
title: u != null ? u : p.toLanguageString(T, x[T]),
|
|
124
124
|
onClick: V,
|
|
125
125
|
..._
|
|
126
126
|
},
|
|
127
127
|
a.children
|
|
128
|
-
), y && /* @__PURE__ */ e.createElement(
|
|
128
|
+
), y && /* @__PURE__ */ e.createElement(oe, { message: E }));
|
|
129
129
|
});
|
|
130
130
|
ie.displayName = "KendoSpeechToTextButton";
|
|
131
131
|
export {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* The SpeechToTextButton ref.
|
|
10
|
+
*/
|
|
11
|
+
export interface SpeechToTextButtonHandle {
|
|
12
|
+
/**
|
|
13
|
+
* The `start` event callback that starts the speech recognition service listening to incoming audio with intent to recognize grammars.
|
|
14
|
+
*/
|
|
15
|
+
start: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* The `stop` event callback that stops the speech recognition service from listening to incoming audio, and attempts to return a result using the audio captured so far.
|
|
18
|
+
*/
|
|
19
|
+
stop: () => void;
|
|
20
|
+
/**
|
|
21
|
+
* The `abort` event callback that stops the speech recognition service from listening to incoming audio, and doesn't attempt to return a result.
|
|
22
|
+
*/
|
|
23
|
+
abort: () => void;
|
|
24
|
+
/**
|
|
25
|
+
* The `isActive` event callback that returns boolean value if the SpeechToTextButton is in active state.
|
|
26
|
+
*/
|
|
27
|
+
isActive: () => boolean;
|
|
28
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
*-------------------------------------------------------------------------------------------
|
|
4
|
+
* Copyright © 2026 Progress Software Corporation. All rights reserved.
|
|
5
|
+
* Licensed under commercial license. See LICENSE.md in the package root for more information
|
|
6
|
+
*-------------------------------------------------------------------------------------------
|
|
7
|
+
*/
|
|
8
|
+
import { ButtonProps } from '../../Button.js';
|
|
9
|
+
/**
|
|
10
|
+
* @hidden
|
|
11
|
+
*/
|
|
12
|
+
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
|
|
13
|
+
/**
|
|
14
|
+
* Represents a single recognition alternative from the speech engine.
|
|
15
|
+
*/
|
|
16
|
+
export interface SpeechRecognitionAlternative {
|
|
17
|
+
/**
|
|
18
|
+
* The transcript of the recognized speech.
|
|
19
|
+
*/
|
|
20
|
+
transcript: string;
|
|
21
|
+
/**
|
|
22
|
+
* A confidence score for the transcript, where 0 indicates no confidence and 1 indicates complete confidence.
|
|
23
|
+
*/
|
|
24
|
+
confidence: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* The event argument for the `result` event of the SpeechToTextButton.
|
|
28
|
+
*/
|
|
29
|
+
export interface SpeechToTextResultEvent {
|
|
30
|
+
/**
|
|
31
|
+
* Indicates whether the speech recognition result is final (`true`) or interim (`false`).
|
|
32
|
+
*/
|
|
33
|
+
isFinal: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* An array of possible recognition alternatives returned by the speech engine.
|
|
36
|
+
*/
|
|
37
|
+
alternatives: SpeechRecognitionAlternative[];
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The event argument for the `error` event of the SpeechToTextButton.
|
|
41
|
+
*/
|
|
42
|
+
export interface SpeechToTextErrorEvent {
|
|
43
|
+
/**
|
|
44
|
+
* Message detailing the cause of the speech recognition error. Use this message for debugging or user feedback.
|
|
45
|
+
*/
|
|
46
|
+
errorMessage: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Represents the props of the [KendoReact SpeechToTextButton component](https://www.telerik.com/kendo-react-ui/components/buttons/speechtotextbutton).
|
|
50
|
+
*/
|
|
51
|
+
export interface SpeechToTextButtonProps extends Omit<ButtonProps, 'onError' | 'endIcon' | 'startIcon' | 'selected' | 'imageAlt' | 'imageUrl' | 'togglable'> {
|
|
52
|
+
/**
|
|
53
|
+
* The valid BCP 47 language tag to use for speech recognition.
|
|
54
|
+
*
|
|
55
|
+
* @default 'en-US'
|
|
56
|
+
*/
|
|
57
|
+
lang?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Specifies whether the speech recognition should continue until explicitly stopped.
|
|
60
|
+
*
|
|
61
|
+
* @default false
|
|
62
|
+
*/
|
|
63
|
+
continuous?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Specifies whether to return interim results.
|
|
66
|
+
*
|
|
67
|
+
* @default false
|
|
68
|
+
*/
|
|
69
|
+
interimResults?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Specifies the maximum number of alternative transcriptions to return.
|
|
72
|
+
*
|
|
73
|
+
* @default 1
|
|
74
|
+
*/
|
|
75
|
+
maxAlternatives?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Specifies which speech recognition engine or integration the component should use.
|
|
78
|
+
* This allows the component to operate in different environments or use alternative implementations.
|
|
79
|
+
*/
|
|
80
|
+
integrationMode?: 'webSpeech' | 'none';
|
|
81
|
+
/**
|
|
82
|
+
* The accessible label of the component.
|
|
83
|
+
*/
|
|
84
|
+
ariaLabel?: string;
|
|
85
|
+
/**
|
|
86
|
+
* Specifies if the SpeechToTextButton is disabled ([see example](https://www.telerik.com/kendo-react-ui/components/buttons/speechtotextbutton/disabled-state)).
|
|
87
|
+
*
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
90
|
+
disabled?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Sets additional classes to the SpeechToTextButton ([see example](https://www.telerik.com/kendo-react-ui/components/buttons/speechtotextbutton/appearance#custom-styling)).
|
|
93
|
+
*/
|
|
94
|
+
className?: string;
|
|
95
|
+
/**
|
|
96
|
+
* Sets additional CSS styles to the SpeechToTextButton ([see example](https://www.telerik.com/kendo-react-ui/components/buttons/speechtotextbutton/appearance#custom-styling)).
|
|
97
|
+
*/
|
|
98
|
+
style?: React.CSSProperties;
|
|
99
|
+
/**
|
|
100
|
+
* Callback function that is called when speech recognition starts.
|
|
101
|
+
*/
|
|
102
|
+
onStart?: () => void;
|
|
103
|
+
/**
|
|
104
|
+
* Callback function that is called when a speech recognition result is available.
|
|
105
|
+
* The event contains the `isFinal` flag and an array of alternatives.
|
|
106
|
+
*/
|
|
107
|
+
onResult?: (event: SpeechToTextResultEvent) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Callback function that is called when speech recognition ends.
|
|
110
|
+
*/
|
|
111
|
+
onEnd?: () => void;
|
|
112
|
+
/**
|
|
113
|
+
* Callback function that is called when an error occurs during speech recognition.
|
|
114
|
+
*/
|
|
115
|
+
onError?: (event: SpeechToTextErrorEvent) => void;
|
|
116
|
+
}
|
|
117
|
+
export {};
|