-
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.
feat(footer): migrate messager bar components
- Loading branch information
1 parent
935c892
commit bd862d2
Showing
15 changed files
with
617 additions
and
14 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
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,35 @@ | ||
// ============================================================================ | ||
// Chatbot Footer - Message Bar - Attach | ||
// ============================================================================ | ||
.pf-v6-c-button.pf-chatbot__button--attach { | ||
width: 48px; | ||
height: 48px; | ||
border-radius: var(--pf-t--global--border--radius--pill); | ||
|
||
.pf-v6-c-button__text { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
color: var(--pf-t--chatbot--message-bar--icon--fill); | ||
} | ||
|
||
svg { height: 20px; } | ||
|
||
// Interactive states | ||
&:hover, &:focus { | ||
.pf-v6-c-button__text { color: var(--pf-t--chatbot--message-bar--icon--fill--hover); } | ||
} | ||
|
||
// Active state | ||
&--active { | ||
background-color: var(--pf-t--color--blue--50); | ||
|
||
.pf-v6-c-button__text { | ||
color: var(--pf-t--color--white); | ||
} | ||
|
||
&:hover, &:focus { | ||
.pf-v6-c-button__text { color: var(--pf-t--color--white); } | ||
} | ||
} | ||
} |
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,61 @@ | ||
// ============================================================================ | ||
// Chatbot Footer - Message Bar - Attach | ||
// ============================================================================ | ||
import React from 'react'; | ||
|
||
// Import PatternFly components | ||
import { Button, ButtonProps, Tooltip, TooltipProps } from '@patternfly/react-core'; | ||
|
||
import { PaperclipIcon } from '@patternfly/react-icons/dist/esm/icons/paperclip-icon'; | ||
|
||
export interface AttachButtonProps extends ButtonProps { | ||
/** OnClick Handler for the Attach Button */ | ||
onClick: () => void; | ||
/** Class Name for the Attach button */ | ||
className?: string; | ||
/** Props to control is the attach button should be disabled */ | ||
isDisabled?: boolean; | ||
/** Props to control the PF Tooltip component */ | ||
tooltipProps?: TooltipProps; | ||
} | ||
|
||
export const AttachButton: React.FunctionComponent<AttachButtonProps> = ({ | ||
onClick, | ||
isDisabled, | ||
className, | ||
tooltipProps, | ||
...props | ||
}: AttachButtonProps) => { | ||
// Configure tooltip | ||
const tooltipAttachRef = React.useRef(); | ||
|
||
return ( | ||
<> | ||
<Button | ||
ref={tooltipAttachRef} | ||
variant="plain" | ||
className={`pf-chatbot__button--attach ${className}`} | ||
aria-describedby="pf-chatbot__tooltip--attach" | ||
aria-label={props['aria-label'] || 'Attach Button'} | ||
isDisabled={isDisabled} | ||
onClick={onClick} | ||
{...props} | ||
> | ||
<PaperclipIcon /> | ||
</Button> | ||
<Tooltip | ||
id="pf-chatbot__tooltip--attach" | ||
content="Attach" | ||
position="top" | ||
triggerRef={tooltipAttachRef} | ||
entryDelay={tooltipProps?.entryDelay || 0} | ||
exitDelay={tooltipProps?.exitDelay || 0} | ||
distance={tooltipProps?.distance || 8} | ||
animationDuration={tooltipProps?.animationDuration || 0} | ||
{...tooltipProps} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default AttachButton; |
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,113 @@ | ||
// ============================================================================ | ||
// Chatbot Footer - Message Bar | ||
// ============================================================================ | ||
.pf-chatbot__message-bar { | ||
--pf-t--chatbot--message-bar--BackgroundColor: var(--pf-t--color--white); | ||
--pf-t--chatbot--message-bar--BoxShadow--color--hover: var(--pf-t--color--gray--30); | ||
--pf-t--chatbot--message-bar--BoxShadow--color--focus: var(--pf-t--color--blue--50); | ||
|
||
--pf-t--chatbot--message-bar--icon--fill: var(--pf-t--color--gray--50); | ||
--pf-t--chatbot--message-bar--icon--fill--hover: var(--pf-t--color--gray--70); | ||
--pf-t--chatbot--message-bar--icon--fill--active: var(--pf-t--color--white); | ||
|
||
--pf-t--chatbot--message-bar--send-icon--fill: var(--pf-t--color--blue--50); | ||
--pf-t--chatbot--message-bar--send-icon--fill--hover: var(--pf-t--color--blue--50); | ||
--pf-t--chatbot--message-bar--send-icon--background--color--hover: rgba( | ||
224, | ||
240, | ||
255, | ||
0.5 | ||
); // --pf-t--color--blue--10 @ 50% | ||
|
||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
justify-content: flex-end; | ||
flex-wrap: wrap; | ||
min-height: 64px; | ||
background-color: var(--pf-t--chatbot--message-bar--BackgroundColor); | ||
border-radius: calc( | ||
var(--pf-t--global--border--radius--medium) * 2 | ||
); // 32px corners - universal for single and multi-line height | ||
transition: box-shadow var(--pf-t--chatbot--timing-function) var(--pf-t--global--duration--100); | ||
|
||
&:hover { | ||
box-shadow: inset 0 0 0 1px var(--pf-t--chatbot--message-bar--BoxShadow--color--hover); | ||
} | ||
|
||
&:focus-within { | ||
box-shadow: inset 0 0 0 2px var(--pf-t--chatbot--message-bar--BoxShadow--color--focus); | ||
} | ||
|
||
// Input | ||
// -------------------------------------------------------------------------- | ||
&-input { | ||
align-self: stretch; | ||
display: flex; | ||
// align-items: center; | ||
flex-grow: 1; | ||
padding: calc(var(--pf-t--global--spacer--100) + var(--pf-t--global--spacer--300)) var(--pf-t--global--spacer--400); | ||
} | ||
.pf-chatbot__message-textarea { | ||
align-self: stretch; | ||
display: flex; | ||
// align-items: center; | ||
flex-grow: 1; | ||
max-width: 100%; | ||
max-height: 232px; // 8 rows + padding | ||
font-size: var(--pf-t--global--font--size--md); | ||
line-height: 24px; | ||
} | ||
|
||
// Actions | ||
// -------------------------------------------------------------------------- | ||
&-actions { | ||
display: flex; | ||
align-self: flex-end; | ||
margin: 0 var(--pf-t--global--spacer--200) var(--pf-t--global--spacer--200) 0; | ||
} | ||
|
||
// Standard Buttons | ||
// -------------------------------------------------------------------------- | ||
// .pf-v6-c-button { | ||
// width: 48px; | ||
// height: 48px; | ||
// border-radius: var(--pf-t--global--border--radius--pill); | ||
|
||
// .pf-v6-c-button__text { | ||
// display: flex; | ||
// align-items: center; | ||
// justify-content: center; | ||
// color: var(--pf-t--chatbot--message-bar--icon--fill); | ||
// } | ||
|
||
// svg { height: 20px; } | ||
|
||
// // Interactive states | ||
// &:hover, &:focus { | ||
// .pf-v6-c-button__text { color: var(--pf-t--chatbot--message-bar--icon--fill--hover); } | ||
// } | ||
// } | ||
|
||
// Send Button | ||
// -------------------------------------------------------------------------- | ||
} | ||
|
||
// ============================================================================ | ||
// Chatbot Dark Theme | ||
// ============================================================================ | ||
.pf-v6-theme-dark { | ||
.pf-chatbot__message-bar { | ||
--pf-t--chatbot--message-bar--BackgroundColor: var(--pf-t--color--gray--80); | ||
--pf-t--chatbot--message-bar--BoxShadow--color--hover: var(--pf-t--color--gray--50); | ||
--pf-t--chatbot--message-bar--BoxShadow--color--focus: var(--pf-t--color--blue--30); | ||
|
||
--pf-t--chatbot--message-bar--icon--fill: var(--pf-t--color--gray--30); | ||
--pf-t--chatbot--message-bar--icon--fill--hover: var(--pf-t--color--white); | ||
--pf-t--chatbot--message-bar--icon--fill--active: var(--pf-t--color--white); | ||
|
||
--pf-t--chatbot--message-bar--send-icon--fill: var(--pf-t--color--blue--30); | ||
--pf-t--chatbot--message-bar--send-icon--fill--hover: var(--pf-t--color--white); | ||
--pf-t--chatbot--message-bar--send-icon--background--color--hover: var(--pf-t--color--blue--50); | ||
} | ||
} |
Oops, something went wrong.