File tree Expand file tree Collapse file tree 4 files changed +646
-153
lines changed Expand file tree Collapse file tree 4 files changed +646
-153
lines changed Original file line number Diff line number Diff line change 11// Copyright 2024, Command Line Inc.
22// SPDX-License-Identifier: Apache-2.0
33
4- $dot-width : 11px ;
5- $dot-color : var (--success-color );
6- $speed : 1.5s ;
4+ .typing-indicator {
5+ display : inline-flex ;
6+ align-items : center ;
7+ gap : 8px ;
8+ margin : 0 ;
9+ padding : 0 ;
710
8- .typing {
9- position : relative ;
10- height : $dot-width ;
11+ & -bubble {
12+ display : flex ;
13+ align-items : center ;
14+ justify-content : center ;
15+ background-color : rgba (from var (--accent-color ) r g b / 0.1 );
16+ border-radius : 20px ;
17+ padding : 6px 12px ;
18+ gap : 4px ;
19+ }
1120
12- span {
13- content : " " ;
14- animation : blink $speed infinite ;
15- animation-fill-mode : both ;
16- height : $dot-width ;
17- width : $dot-width ;
18- background : $dot-color ;
19- position : absolute ;
20- left : 0 ;
21- top : 0 ;
21+ & -dot {
22+ width : 6px ;
23+ height : 6px ;
2224 border-radius : 50% ;
25+ background-color : var (--accent-color );
26+ opacity : 0.7 ;
27+
28+ & :nth-child (1 ) {
29+ animation : typing- animation 1.4s infinite ease-in-out ;
30+ animation-delay : 0s ;
31+ }
2332
2433 & :nth-child (2 ) {
34+ animation : typing- animation 1.4s infinite ease-in-out ;
2535 animation-delay : 0.2s ;
26- margin-left : $dot-width * 1.5 ;
2736 }
2837
2938 & :nth-child (3 ) {
39+ animation : typing- animation 1.4s infinite ease-in-out ;
3040 animation-delay : 0.4s ;
31- margin-left : $dot-width * 3 ;
3241 }
3342 }
3443}
3544
36- @keyframes blink {
37- 0% {
38- opacity : 0.1 ;
45+ @keyframes typing-animation {
46+ 0%,
47+ 100% {
48+ transform : translateY (0 );
3949 }
40- 20% {
50+ 50% {
51+ transform : translateY (-5px );
4152 opacity : 1 ;
4253 }
43- 100% {
44- opacity : 0.1 ;
45- }
4654}
Original file line number Diff line number Diff line change 11// Copyright 2025, Command Line Inc.
22// SPDX-License-Identifier: Apache-2.0
33
4- import { clsx } from "clsx" ;
5-
4+ import React from "react" ;
65import "./typingindicator.scss" ;
76
8- type TypingIndicatorProps = {
7+ export interface TypingIndicatorProps {
8+ style ?: React . CSSProperties ;
99 className ?: string ;
10- } ;
11- const TypingIndicator = ( { className } : TypingIndicatorProps ) => {
10+ }
11+
12+ export const TypingIndicator : React . FC < TypingIndicatorProps > = ( { style, className } ) => {
1213 return (
13- < div className = { clsx ( "typing" , className ) } >
14- < span > </ span >
15- < span > </ span >
16- < span > </ span >
14+ < div className = { `typing-indicator ${ className || "" } ` } style = { style } >
15+ < div className = "typing-indicator-bubble" >
16+ < div className = "typing-indicator-dot" > </ div >
17+ < div className = "typing-indicator-dot" > </ div >
18+ < div className = "typing-indicator-dot" > </ div >
19+ </ div >
1720 </ div >
1821 ) ;
1922} ;
20-
21- export { TypingIndicator } ;
You can’t perform that action at this time.
0 commit comments