Skip to content

Commit 779ba8a

Browse files
Ruslan FarkhutdinovRuslan Farkhutdinov
andauthored
STT: Apply listening animation to icon only & update mic icon (#32478)
Co-authored-by: Ruslan Farkhutdinov <ruslan.farkhutdinov@devexpress.com>
1 parent 9e438f9 commit 779ba8a

7 files changed

Lines changed: 11 additions & 10 deletions

File tree

apps/react-storybook/stories/speech_to_text/SpeechToText.stories.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ type Story = StoryObj<typeof SpeechToText>;
1818
export const DefaultSpeechToText: Story = {
1919
args: {
2020
width: 'auto',
21-
startIcon: 'micoutline',
21+
startIcon: 'micfilled',
2222
stopIcon: 'stopfilled',
2323
startText: '',
2424
stopText: '',
@@ -34,11 +34,11 @@ export const DefaultSpeechToText: Story = {
3434
control: { type: 'radio' }
3535
},
3636
startIcon: {
37-
options: ['micoutline', 'video', 'isnotblank', undefined],
37+
options: ['micfilled', 'video', 'isnotblank', undefined],
3838
control: { type: 'select' }
3939
},
4040
stopIcon: {
41-
options: ['stopfilled', 'square', 'indeterminatestate', undefined],
41+
options: ['micfilled', 'stopfilled', 'square', 'indeterminatestate', undefined],
4242
control: { type: 'select' }
4343
},
4444
startText: {

packages/devextreme-scss/scss/widgets/base/speechToText/_index.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.dx-speech-to-text-listening {
1+
.dx-speech-to-text-listening .dx-icon {
22
animation: dx-speech-to-text-listening-animation 1.5s ease-in-out 0.5s infinite;
33
}
44

packages/devextreme/js/__internal/ui/speech_to_text/speech_to_text.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type { ButtonProps as ButtonProperties } from '@ts/ui/button/button';
1818
export const SPEECH_TO_TEXT_CLASS = 'dx-speech-to-text';
1919
export const SPEECH_TO_TEXT_LISTENING_CLASS = 'dx-speech-to-text-listening';
2020

21-
const DEFAULT_INITIAL_ICON = 'micoutline';
21+
const DEFAULT_INITIAL_ICON = 'micfilled';
2222
const DEFAULT_LISTENING_ICON = 'stopfilled';
2323

2424
enum SpeechToTextState {

packages/devextreme/js/ui/speech_to_text.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ export interface Properties extends WidgetOptions<dxSpeechToText> {
174174

175175
/**
176176
* @docid dxSpeechToTextOptions.startIcon
177-
* @default 'micoutline'
177+
* @default 'micfilled'
178178
* @public
179179
*/
180180
startIcon?: string;

packages/devextreme/testing/tests/DevExpress.ui.widgets/speechToText.markup.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ QUnit.module('Button Rendering', moduleConfig, () => {
7575
QUnit.test('should update button icon and text based on state', function(assert) {
7676
const getIcon = () => this.$element.find(`.${ICON_CLASS}`);
7777

78-
assert.ok(getIcon().hasClass(`${ICON_CLASS}-micoutline`), 'initial icon displayed');
78+
assert.ok(getIcon().hasClass(`${ICON_CLASS}-micfilled`), 'initial icon displayed');
7979

8080
this.$element.trigger('dxclick');
8181

packages/devextreme/testing/tests/DevExpress.ui.widgets/speechToText.tests.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ const BUTTON_MODE_TEXT_CLASS = 'dx-button-mode-text';
1717
const BUTTON_MODE_OUTLINED_CLASS = 'dx-button-mode-outlined';
1818
const BUTTON_TYPE_DANGER_CLASS = 'dx-button-danger';
1919
const BUTTON_TYPE_PRIMARY_CLASS = 'dx-button-primary';
20+
const ICON_CLASS = 'dx-icon';
2021

2122
const INKRIPPLE_CLASS = 'dx-inkripple';
2223
const INKRIPPLE_WAVE_CLASS = 'dx-inkripple-wave';
@@ -279,7 +280,7 @@ QUnit.module('State Management', moduleConfig, () => {
279280
});
280281

281282
QUnit.test('INITIAL state should not have animation by default', function(assert) {
282-
const animation = this.$element.css('animation');
283+
const animation = this.$element.find(`.${ICON_CLASS}`).css('animation');
283284

284285
assert.strictEqual(animation, 'none 0s ease 0s 1 normal none running');
285286
});
@@ -289,7 +290,7 @@ QUnit.module('State Management', moduleConfig, () => {
289290

290291
$button.trigger('dxclick');
291292

292-
const animation = this.$element.css('animation');
293+
const animation = this.$element.find(`.${ICON_CLASS}`).css('animation');
293294
const easeInOutAnimationEnabled = animation.includes('1.5s ease-in-out 0.5s infinite normal none running');
294295

295296
assert.strictEqual(easeInOutAnimationEnabled, true);

packages/devextreme/testing/tests/DevExpress.ui/defaultOptions.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1482,7 +1482,7 @@ testComponentDefaults(SpeechToText,
14821482
isListening: false,
14831483
},
14841484
hoverStateEnabled: true,
1485-
startIcon: 'micoutline',
1485+
startIcon: 'micfilled',
14861486
stopIcon: 'stopfilled',
14871487
startText: '',
14881488
stopText: '',

0 commit comments

Comments
 (0)