-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into RHCLOUD-31243
- Loading branch information
Showing
6 changed files
with
240 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 11 additions & 0 deletions
11
...extensions/virtual-assistant/examples/VirtualAssistant/VirtualAssistantLoadingMessage.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import React from 'react'; | ||
import VirtualAssistant from '@patternfly/virtual-assistant/dist/dynamic/VirtualAssistant'; | ||
import LoadingMessage from '@patternfly/virtual-assistant/dist/esm/LoadingMessage' | ||
import GrinIcon from '@patternfly/react-icons/dist/js/icons/bacon-icon'; | ||
|
||
export const BasicExample: React.FunctionComponent = () => ( | ||
<VirtualAssistant > | ||
<LoadingMessage /> | ||
<LoadingMessage icon={GrinIcon} /> | ||
</VirtualAssistant> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
import React from 'react'; | ||
import { Icon, Split, SplitItem } from '@patternfly/react-core'; | ||
import { createUseStyles } from 'react-jss'; | ||
import classnames from "clsx"; | ||
|
||
import RobotIcon from '@patternfly/react-icons/dist/js/icons/robot-icon'; | ||
|
||
const useStyles = createUseStyles({ | ||
chatbot: { | ||
marginBottom: "var(--pf-v5-global--spacer--md)", | ||
marginRight: "40px", | ||
}, | ||
bubble: { | ||
border: "1px solid var(--pf-v5-global--BackgroundColor--dark-400)", | ||
borderRadius: "14px", | ||
padding: "var(--pf-v5-global--spacer--sm) var(--pf-v5-global--spacer--md) var(--pf-v5-global--spacer--sm) var(--pf-v5-global--spacer--md)", | ||
maxWidth: "100%", | ||
wordWrap: "break-word", | ||
}, | ||
"@keyframes mercuryTypingAnimation": { | ||
"0%": { | ||
transform: "translateY(0px)", | ||
backgroundColor: "var(--pf-v5-global--palette--black-600)", | ||
}, | ||
"28%": { | ||
transform: "translateY(-7px)", | ||
backgroundColor: "var(--pf-v5-global--palette--black-400)", | ||
}, | ||
"44%": { | ||
transform: "translateY(0px)", | ||
backgroundColor: "var(--pf-v5-global--palette--black-200)", | ||
} | ||
}, | ||
dot: {}, | ||
typing: { | ||
height: "17px", | ||
"& $dot": { | ||
animation: "$mercuryTypingAnimation 1.8s infinite ease-in-out", | ||
borderRadius: "50%", | ||
display: "inline-block", | ||
height: "7px", | ||
marginRight: "4px", | ||
marginTop: "6px", | ||
verticalAlign: "middle", | ||
width: "7px", | ||
"&:nth-child(1)": { | ||
animationDelay: "200ms", | ||
}, | ||
"&:nth-child(2)": { | ||
animationDelay: "300ms", | ||
}, | ||
"&:nth-child(3)": { | ||
animationDelay: "400ms", | ||
}, | ||
"&:last-child": { | ||
marginRight: "0", | ||
}, | ||
} | ||
} | ||
}) | ||
|
||
export interface LoadingMessageProps { | ||
icon?: React.ComponentClass; | ||
} | ||
|
||
export const LoadingMessage: React.FunctionComponent<LoadingMessageProps> = ({ icon: IconComponent = RobotIcon }) => { | ||
const classes = useStyles(); | ||
return ( | ||
<Split className={classes.chatbot}> | ||
<SplitItem> | ||
<Icon size="lg" className="pf-v5-u-mr-sm pf-v5-u-pt-md"> | ||
<IconComponent /> | ||
</Icon> | ||
</SplitItem> | ||
<SplitItem className={classnames(classes.bubble," pf-u-background-color-200")} > | ||
<div className={classnames(classes.typing,"pf-v5-u-display-flex pf-u-align-items-center")}> | ||
<div className={classes.dot}></div> | ||
<div className={classes.dot}></div> | ||
<div className={classes.dot}></div> | ||
</div> | ||
</SplitItem> | ||
</Split> | ||
); | ||
}; | ||
|
||
export default LoadingMessage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export { default } from './LoadingMessage'; | ||
|
||
export * from './LoadingMessage'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters