-
Notifications
You must be signed in to change notification settings - Fork 117
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(side-panel): add SidePanelFooter #4002
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
b4f4670
chore(ai-chat-log): remove padding-x from log
nkrantz 4ccb2c0
feat(side-panel): create SidePanelFooter
nkrantz c3be3f0
chore(side-modal): align design with side panel design
nkrantz c13e16f
docs(side-panel, side-modal): add footer examples to docs
nkrantz 875fadf
chore(chat-composer): make container 100% width
nkrantz 36924e8
chore(side-modal): remove changes to footer actions alignment
nkrantz 20b666e
chore(side-panel): allow justification of footer content
nkrantz 215c0bc
chore: typedocs
nkrantz a2146bb
chore: pr feedback
nkrantz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@twilio-paste/ai-chat-log": patch | ||
"@twilio-paste/core": patch | ||
--- | ||
|
||
[AI Chat Log] Remove padding-x on AI Chat Log to prevent double padding when log is used within a Side Panel container. |
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,6 @@ | ||
--- | ||
"@twilio-paste/chat-composer": patch | ||
"@twilio-paste/core": patch | ||
--- | ||
|
||
[Chat Composer] Add width="100%" to ChatComposerContainer to prevent composer from shrinking when no value |
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,6 @@ | ||
--- | ||
"@twilio-paste/side-modal": patch | ||
"@twilio-paste/core": patch | ||
--- | ||
|
||
[Side Modal] Increase size of close icon. |
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,5 @@ | ||
--- | ||
"@twilio-paste/codemods": patch | ||
--- | ||
|
||
[Codemods] New export from side-panel package |
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,6 @@ | ||
--- | ||
"@twilio-paste/side-panel": minor | ||
"@twilio-paste/core": minor | ||
--- | ||
|
||
[Side Panel] Create SidePanelFooter exported from the Side Panel package for actions or chat composers. Make scrollbar color of SidePanelBody slightly darker for better visibility. Small improvements to spacing and alignment of SidePanelHeader. |
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
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
34 changes: 34 additions & 0 deletions
34
packages/paste-core/components/side-panel/src/SidePanelFooter.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,34 @@ | ||
import { Box, safelySpreadBoxProps } from "@twilio-paste/box"; | ||
import * as React from "react"; | ||
|
||
import type { SidePanelFooterProps } from "./types"; | ||
|
||
const SidePanelFooter = React.forwardRef<HTMLDivElement, SidePanelFooterProps>( | ||
({ element = "SIDE_PANEL_FOOTER", variant = "default", children, justifyContent = "flex-start", ...props }, ref) => { | ||
return ( | ||
<Box | ||
width="100%" | ||
paddingX={variant === "chat" ? "space50" : "space70"} | ||
paddingBottom="space50" | ||
paddingTop={variant === "chat" ? "space0" : "space50"} | ||
boxShadow={variant === "chat" ? "none" : "shadow"} | ||
marginBottom="spaceNegative70" | ||
zIndex="zIndex20" | ||
display="flex" | ||
columnGap="space40" | ||
rowGap="space40" | ||
justifyContent={justifyContent} | ||
flexWrap="wrap" | ||
{...safelySpreadBoxProps(props)} | ||
ref={ref} | ||
element={element} | ||
> | ||
{children} | ||
</Box> | ||
); | ||
}, | ||
); | ||
|
||
SidePanelFooter.displayName = "SidePanelFooter"; | ||
|
||
export { SidePanelFooter }; |
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
95 changes: 95 additions & 0 deletions
95
packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.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,95 @@ | ||
// eslint-disable-next-line eslint-comments/disable-enable-pair | ||
/* eslint-disable import/no-extraneous-dependencies */ | ||
import { AIChatLog, AIChatMessage, AIChatMessageAuthor, AIChatMessageBody } from "@twilio-paste/ai-chat-log"; | ||
import { Anchor } from "@twilio-paste/anchor"; | ||
import { Box } from "@twilio-paste/box"; | ||
import { Button } from "@twilio-paste/button"; | ||
import { ChatComposer, ChatComposerActionGroup, ChatComposerContainer } from "@twilio-paste/chat-composer"; | ||
import { Heading } from "@twilio-paste/heading"; | ||
import { ArtificialIntelligenceIcon } from "@twilio-paste/icons/esm/ArtificialIntelligenceIcon"; | ||
import { AttachIcon } from "@twilio-paste/icons/esm/AttachIcon"; | ||
import { MoreIcon } from "@twilio-paste/icons/esm/MoreIcon"; | ||
import { SendIcon } from "@twilio-paste/icons/esm/SendIcon"; | ||
import { Separator } from "@twilio-paste/separator"; | ||
import * as React from "react"; | ||
|
||
import { SidePanel, SidePanelBody, SidePanelFooter, SidePanelHeader, SidePanelHeaderActions } from "../../src"; | ||
|
||
export const SidePanelWithAIContent: React.FC<React.PropsWithChildren> = () => { | ||
return ( | ||
<SidePanel label="intelligent assistant ai bot side panel"> | ||
<SidePanelHeader> | ||
<ArtificialIntelligenceIcon decorative size="sizeIcon50" color="colorTextIcon" /> | ||
<Heading as="h3" variant="heading30" marginBottom="space0"> | ||
Assistant | ||
</Heading> | ||
<SidePanelHeaderActions> | ||
<Button variant="secondary_icon" size="reset" onClick={() => {}}> | ||
<MoreIcon decorative={false} title="open menu" size="sizeIcon50" /> | ||
</Button> | ||
</SidePanelHeaderActions> | ||
</SidePanelHeader> | ||
<Separator orientation="horizontal" verticalSpacing="space0" /> | ||
<SidePanelBody> | ||
<Box width="100%"> | ||
<AIChatLog> | ||
<AIChatMessage variant="bot"> | ||
<AIChatMessageAuthor aria-label="ai said">Good Bot</AIChatMessageAuthor> | ||
<AIChatMessageBody>Hello, what can I help you with?</AIChatMessageBody> | ||
</AIChatMessage> | ||
<AIChatMessage variant="user"> | ||
<AIChatMessageAuthor aria-label="You said at 2:36pm">Gibby Radki</AIChatMessageAuthor> | ||
<AIChatMessageBody>Hi! Can you help me with my user interface?</AIChatMessageBody> | ||
</AIChatMessage> | ||
<AIChatMessage variant="bot"> | ||
<AIChatMessageAuthor aria-label="ai said">Good Bot</AIChatMessageAuthor> | ||
Of course! What do you need help with? | ||
</AIChatMessage> | ||
<AIChatMessage variant="bot"> | ||
<AIChatMessageAuthor aria-label="ai said">Good Bot</AIChatMessageAuthor> | ||
<AIChatMessageBody> | ||
I'm happy to help with any questions you have about user interfaces, accessibility, or the Twilio | ||
Paste design system. Just ask! | ||
</AIChatMessageBody> | ||
</AIChatMessage> | ||
<AIChatMessage variant="user"> | ||
<AIChatMessageAuthor aria-label="You said at 2:39pm">Gibby Radki</AIChatMessageAuthor> | ||
<AIChatMessageBody>My question is about the Switch component.</AIChatMessageBody> | ||
</AIChatMessage> | ||
<AIChatMessage variant="bot"> | ||
<AIChatMessageAuthor aria-label="ai said">Good Bot</AIChatMessageAuthor> | ||
<AIChatMessageBody> | ||
A <Anchor href="https://paste.twilio.design/components/switch">Switch</Anchor> is an interactive binary | ||
control. What other information about the Paste Switch component can I help with? | ||
</AIChatMessageBody> | ||
</AIChatMessage> | ||
</AIChatLog> | ||
</Box> | ||
</SidePanelBody> | ||
<SidePanelFooter variant="chat"> | ||
<ChatComposerContainer variant="contained"> | ||
<ChatComposer | ||
maxHeight="size10" | ||
config={{ | ||
namespace: "customer-chat", | ||
onError: (e) => { | ||
throw e; | ||
}, | ||
}} | ||
initialValue="Are switch labels required? What about " | ||
placeholder="Chat text" | ||
ariaLabel="A basic chat composer" | ||
/> | ||
<ChatComposerActionGroup> | ||
<Button variant="secondary_icon" size="reset"> | ||
<AttachIcon decorative={false} title="attach files to the message" /> | ||
</Button> | ||
<Button variant="primary_icon" size="reset"> | ||
<SendIcon decorative={false} title="Send" /> | ||
</Button> | ||
</ChatComposerActionGroup> | ||
</ChatComposerContainer> | ||
</SidePanelFooter> | ||
</SidePanel> | ||
); | ||
}; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏