From b4f46709ca94c48a79b302c6ab7429efdbe4767f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnora?= Date: Tue, 23 Jul 2024 12:04:17 -0400 Subject: [PATCH 1/9] chore(ai-chat-log): remove padding-x from log --- .changeset/new-fans-call.md | 6 ++++++ .../paste-core/components/ai-chat-log/src/AIChatLog.tsx | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .changeset/new-fans-call.md diff --git a/.changeset/new-fans-call.md b/.changeset/new-fans-call.md new file mode 100644 index 0000000000..ca687989d9 --- /dev/null +++ b/.changeset/new-fans-call.md @@ -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. diff --git a/packages/paste-core/components/ai-chat-log/src/AIChatLog.tsx b/packages/paste-core/components/ai-chat-log/src/AIChatLog.tsx index d799912690..be3fded243 100644 --- a/packages/paste-core/components/ai-chat-log/src/AIChatLog.tsx +++ b/packages/paste-core/components/ai-chat-log/src/AIChatLog.tsx @@ -17,7 +17,7 @@ export interface AIChatLogProps extends HTMLPasteProps<"div"> { export const AIChatLog = React.forwardRef( ({ element = "AI_CHAT_LOG", children, ...props }, ref) => { return ( - + Date: Tue, 23 Jul 2024 16:43:55 -0400 Subject: [PATCH 2/9] feat(side-panel): create SidePanelFooter --- .changeset/tiny-badgers-rush.md | 6 + .../side-panel/src/SidePanelBody.tsx | 1 + .../side-panel/src/SidePanelFooter.tsx | 31 +++++ .../side-panel/src/SidePanelHeader.tsx | 2 +- .../side-panel/src/SidePanelHeaderActions.tsx | 2 +- .../components/side-panel/src/index.tsx | 2 + .../components/side-panel/src/types.ts | 11 ++ .../components/SidePanelWithAIContent.tsx | 95 +++++++++++++++ .../components/SidePanelWithContent.tsx | 89 -------------- .../components/SidePanelWithFilterContent.tsx | 115 ++++++++++++++++++ .../side-panel/stories/index.stories.tsx | 83 ++++++++++++- 11 files changed, 342 insertions(+), 95 deletions(-) create mode 100644 .changeset/tiny-badgers-rush.md create mode 100644 packages/paste-core/components/side-panel/src/SidePanelFooter.tsx create mode 100644 packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.tsx delete mode 100644 packages/paste-core/components/side-panel/stories/components/SidePanelWithContent.tsx create mode 100644 packages/paste-core/components/side-panel/stories/components/SidePanelWithFilterContent.tsx diff --git a/.changeset/tiny-badgers-rush.md b/.changeset/tiny-badgers-rush.md new file mode 100644 index 0000000000..b506c45b99 --- /dev/null +++ b/.changeset/tiny-badgers-rush.md @@ -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. diff --git a/packages/paste-core/components/side-panel/src/SidePanelBody.tsx b/packages/paste-core/components/side-panel/src/SidePanelBody.tsx index 08003dc977..b44f6fe516 100644 --- a/packages/paste-core/components/side-panel/src/SidePanelBody.tsx +++ b/packages/paste-core/components/side-panel/src/SidePanelBody.tsx @@ -17,6 +17,7 @@ const SidePanelBodyWrapper = styled.div(({ theme }: { theme: ThemeShape }) => { // Track "::-webkit-scrollbar-track": { marginTop: "8px", + marginBottom: "8px", background: colorBackgroundBody, borderRadius: "10px", }, diff --git a/packages/paste-core/components/side-panel/src/SidePanelFooter.tsx b/packages/paste-core/components/side-panel/src/SidePanelFooter.tsx new file mode 100644 index 0000000000..bb47dbeabd --- /dev/null +++ b/packages/paste-core/components/side-panel/src/SidePanelFooter.tsx @@ -0,0 +1,31 @@ +import { Box, safelySpreadBoxProps } from "@twilio-paste/box"; +import * as React from "react"; + +import type { SidePanelFooterProps } from "./types"; + +const SidePanelFooter = React.forwardRef( + ({ element = "SIDE_PANEL_FOOTER", children, ...props }, ref) => { + return ( + + {children} + + ); + }, +); + +SidePanelFooter.displayName = "SidePanelFooter"; + +export { SidePanelFooter }; diff --git a/packages/paste-core/components/side-panel/src/SidePanelHeader.tsx b/packages/paste-core/components/side-panel/src/SidePanelHeader.tsx index 1ffba020b1..d92a6b2528 100644 --- a/packages/paste-core/components/side-panel/src/SidePanelHeader.tsx +++ b/packages/paste-core/components/side-panel/src/SidePanelHeader.tsx @@ -55,7 +55,7 @@ const SidePanelHeader = React.forwardRef( padding="space70" display="flex" columnGap="space30" - alignItems="center" + alignItems="flex-start" justifyContent="space-between" {...safelySpreadBoxProps(props)} ref={ref} diff --git a/packages/paste-core/components/side-panel/src/SidePanelHeaderActions.tsx b/packages/paste-core/components/side-panel/src/SidePanelHeaderActions.tsx index c6dd27202b..ec175dbbd4 100644 --- a/packages/paste-core/components/side-panel/src/SidePanelHeaderActions.tsx +++ b/packages/paste-core/components/side-panel/src/SidePanelHeaderActions.tsx @@ -7,7 +7,7 @@ const SidePanelHeaderActions = React.forwardRef { return ( { element?: BoxProps["element"]; } +export interface SidePanelFooterProps extends HTMLPasteProps<"div"> { + children?: React.ReactNode; + /** + * Overrides the default element name to apply unique styles with the Customization Provider + * @default "SIDE_PANEL_FOOTER" + * @type {BoxProps['element']} + * @memberof SidePanelFooterProps + */ + element?: BoxProps["element"]; +} + export interface SidePanelHeaderActionsProps extends HTMLPasteProps<"div"> { children?: React.ReactNode; /** diff --git a/packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.tsx b/packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.tsx new file mode 100644 index 0000000000..e71544c56b --- /dev/null +++ b/packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.tsx @@ -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 = () => { + return ( + + + + + Assistant + + + + + + + + + + + Good Bot + Hello, what can I help you with? + + + Gibby Radki + Hi! Can you help me with my user interface? + + + Good Bot + Of course! What do you need help with? + + + Good Bot + + I'm happy to help with any questions you have about user interfaces, accessibility, or the Twilio + Paste design system. Just ask! + + + + Gibby Radki + My question is about the Switch component. + + + Good Bot + + A Switch is an interactive binary + control. What other information about the Paste Switch component can I help with? + + + + + + + + { + throw e; + }, + }} + initialValue="Are switch labels required? What about " + placeholder="Chat text" + ariaLabel="A basic chat composer" + /> + + + + + + + + ); +}; diff --git a/packages/paste-core/components/side-panel/stories/components/SidePanelWithContent.tsx b/packages/paste-core/components/side-panel/stories/components/SidePanelWithContent.tsx deleted file mode 100644 index 350bd7e338..0000000000 --- a/packages/paste-core/components/side-panel/stories/components/SidePanelWithContent.tsx +++ /dev/null @@ -1,89 +0,0 @@ -// eslint-disable-next-line eslint-comments/disable-enable-pair -/* eslint-disable import/no-extraneous-dependencies */ -import { Anchor } from "@twilio-paste/anchor"; -import { Avatar } from "@twilio-paste/avatar"; -import { Box } from "@twilio-paste/box"; -import { Button } from "@twilio-paste/button"; -import { ChatComposer } from "@twilio-paste/chat-composer"; -import { ChatBubble, ChatLog, ChatMessage, ChatMessageMeta, ChatMessageMetaItem } from "@twilio-paste/chat-log"; -import { DetailText } from "@twilio-paste/detail-text"; -import { Heading } from "@twilio-paste/heading"; -import { ArtificialIntelligenceIcon } from "@twilio-paste/icons/esm/ArtificialIntelligenceIcon"; -import { MoreIcon } from "@twilio-paste/icons/esm/MoreIcon"; -import { Separator } from "@twilio-paste/separator"; -import * as React from "react"; - -import { SidePanel, SidePanelBody, SidePanelHeader, SidePanelHeaderActions } from "../../src"; - -export const SidePanelWithContent: React.FC = () => { - return ( - - - - - Assistant - - - - - - - - - - - Hello, what can I help you with? - - - - Gibby Radki ・ 3:35 PM - - - - - Hi! What is your return policy? - - 3:35 PM - - - - Hello, what can I help you with? - - - - Gibby Radki ・ 3:35 PM - - - - - Hi! What is your return policy? - - 3:35 PM - - - - { - throw e; - }, - }} - initialValue="Are switch labels required in the context of a data grid? I'm exploring a UI that allows users to make the same configuration to every row in that data grid, and i'm wondering if there are any accessibility issues with having the column header in the top row with just the switch component in each of the row cells? the label gets pretty repetitive and we're expecting the table to have 20+ rows in this table, so trying to find ways to make it less visually crowded" - placeholder="Chat text" - ariaLabel="A basic chat composer" - /> - - - This chatbot is powered by OpenAI. For more information, see the{" "} - Customer AI Trust Principles and{" "} - Twilio Privacy Notice. - - - - - - ); -}; diff --git a/packages/paste-core/components/side-panel/stories/components/SidePanelWithFilterContent.tsx b/packages/paste-core/components/side-panel/stories/components/SidePanelWithFilterContent.tsx new file mode 100644 index 0000000000..46fbb078e2 --- /dev/null +++ b/packages/paste-core/components/side-panel/stories/components/SidePanelWithFilterContent.tsx @@ -0,0 +1,115 @@ +// eslint-disable-next-line eslint-comments/disable-enable-pair +/* eslint-disable import/no-extraneous-dependencies */ +import { Badge } from "@twilio-paste/badge"; +import { Box } from "@twilio-paste/box"; +import { Button } from "@twilio-paste/button"; +import { Disclosure, DisclosureContent, DisclosureHeading } from "@twilio-paste/disclosure"; +import { Heading } from "@twilio-paste/heading"; +import { Radio, RadioGroup } from "@twilio-paste/radio-group"; +import * as React from "react"; + +import { SidePanel, SidePanelBody, SidePanelFooter, SidePanelHeader } from "../../src"; + +export const SidePanelWithFilterContent: React.FC = () => { + return ( + + + + More filters + + + + + + + + Label + + Selected: 1 + + + + + + + + Label + + + Label + + + Label + + + Label + + + Label + + + Label + + + + + + + + + + + + + Label + + Selected: 1 + + + + + + + + Label + + + Label + + + Label + + + Label + + + Label + + + Label + + + + + + + + + + + + + + + + + ); +}; diff --git a/packages/paste-core/components/side-panel/stories/index.stories.tsx b/packages/paste-core/components/side-panel/stories/index.stories.tsx index fa7aff5237..a80e024291 100644 --- a/packages/paste-core/components/side-panel/stories/index.stories.tsx +++ b/packages/paste-core/components/side-panel/stories/index.stories.tsx @@ -2,6 +2,7 @@ /* eslint-disable react/jsx-max-depth */ /* eslint-disable import/no-extraneous-dependencies */ import type { StoryFn } from "@storybook/react"; +import { Badge } from "@twilio-paste/badge"; import { Box } from "@twilio-paste/box"; import { Button } from "@twilio-paste/button"; import { CustomizationProvider } from "@twilio-paste/customization"; @@ -19,6 +20,7 @@ import * as React from "react"; import { SidePanel, + SidePanelBadgeButton, SidePanelBody, SidePanelButton, SidePanelContainer, @@ -28,7 +30,8 @@ import { SidePanelPushContentWrapper, } from "../src"; import { MessagingInsightsContent } from "./components/MessagingInsightsContent"; -import { SidePanelWithContent } from "./components/SidePanelWithContent"; +import { SidePanelWithAIContent } from "./components/SidePanelWithAIContent"; +import { SidePanelWithFilterContent } from "./components/SidePanelWithFilterContent"; import { SidebarWithContent } from "./components/SidebarWithContent"; // eslint-disable-next-line import/no-default-export @@ -41,7 +44,7 @@ export const Default: StoryFn = () => { const [isOpen, setIsOpen] = React.useState(true); return ( - + @@ -83,7 +86,7 @@ export const Basic: StoryFn = () => { - + Toggle Side Panel @@ -112,6 +115,78 @@ Basic.parameters = { }, }; +export const AI: StoryFn = () => { + const [isOpen, setIsOpen] = React.useState(true); + const sidePanelId = useUID(); + return ( + + + + + + + Ask an assistant + + + + + ); +}; +AI.parameters = { + padding: false, + a11y: { + config: { + rules: [ + { + /* + * Using position="relative" on SidePanel causes it to overflow other themes in stacked and side-by-side views, and therefore fail color contrast checks based on SidePanelBody's content. + * The DefaultVRT test below serves to test color contrast on the Side Panel component without this issue causing false failures. + */ + id: "color-contrast", + selector: "*:not(*)", + }, + ], + }, + }, +}; + +export const Filter: StoryFn = () => { + const [isOpen, setIsOpen] = React.useState(true); + const sidePanelId = useUID(); + return ( + + + + + + More filters + + 2 + + + + + + ); +}; +Filter.parameters = { + padding: false, + a11y: { + config: { + rules: [ + { + /* + * Using position="relative" on SidePanel causes it to overflow other themes in stacked and side-by-side views, and therefore fail color contrast checks based on SidePanelBody's content. + * The DefaultVRT test below serves to test color contrast on the Side Panel component without this issue causing false failures. + */ + id: "color-contrast", + selector: "*:not(*)", + }, + ], + }, + }, +}; + export const I18n: StoryFn = () => { const [isOpen, setIsOpen] = React.useState(true); @@ -274,7 +349,7 @@ export const Composed: StoryFn = () => { {/* Side Panel can be placed anywhere - position fixed */} - + From c3be3f075e23e1292ab21b873b7b9192ec584120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnora?= Date: Tue, 23 Jul 2024 16:56:37 -0400 Subject: [PATCH 3/9] chore(side-modal): align design with side panel design --- .changeset/real-flowers-turn.md | 6 ++++++ .../components/side-modal/src/SideModalFooterActions.tsx | 2 +- .../components/side-modal/src/SideModalHeader.tsx | 5 +++-- .../components/side-modal/stories/customization.stories.tsx | 2 +- .../components/side-modal/stories/index.stories.tsx | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) create mode 100644 .changeset/real-flowers-turn.md diff --git a/.changeset/real-flowers-turn.md b/.changeset/real-flowers-turn.md new file mode 100644 index 0000000000..e77a82c5c0 --- /dev/null +++ b/.changeset/real-flowers-turn.md @@ -0,0 +1,6 @@ +--- +"@twilio-paste/side-modal": patch +"@twilio-paste/core": patch +--- + +[Side Modal] Increase size of close icon and left-align footer actions by default. diff --git a/packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx b/packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx index 644c9e26ea..e08ca487cc 100644 --- a/packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx +++ b/packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx @@ -31,7 +31,7 @@ export interface SideModalFooterActionsProps extends HTMLPasteProps<"div"> { } const SideModalFooterActions = React.forwardRef( - ({ children, element = "SIDE_MODAL_FOOTER_ACTIONS", justifyContent = "flex-end", ...props }, ref) => { + ({ children, element = "SIDE_MODAL_FOOTER_ACTIONS", justifyContent = "flex-start", ...props }, ref) => { return ( ( element={element} display="flex" flexDirection="row" + alignItems="flex-start" > - + {children} diff --git a/packages/paste-core/components/side-modal/stories/customization.stories.tsx b/packages/paste-core/components/side-modal/stories/customization.stories.tsx index 0ecd1784d5..726b81aaf2 100644 --- a/packages/paste-core/components/side-modal/stories/customization.stories.tsx +++ b/packages/paste-core/components/side-modal/stories/customization.stories.tsx @@ -85,8 +85,8 @@ export const CustomizedDialog: StoryFn = (_args, { parameters: { isTestEnvironme - + diff --git a/packages/paste-core/components/side-modal/stories/index.stories.tsx b/packages/paste-core/components/side-modal/stories/index.stories.tsx index 8b6a5f087f..bc41d35b6e 100644 --- a/packages/paste-core/components/side-modal/stories/index.stories.tsx +++ b/packages/paste-core/components/side-modal/stories/index.stories.tsx @@ -64,8 +64,8 @@ export const Default: StoryFn = () => { - + From c13e16f96543fc7909660bc42e3348b13aa08c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnora?= Date: Tue, 23 Jul 2024 17:27:31 -0400 Subject: [PATCH 4/9] docs(side-panel, side-modal): add footer examples to docs --- packages/paste-codemods/tools/.cache/mappings.json | 1 + .../src/component-examples/SideModalExamples.ts | 4 ++-- .../src/pages/components/side-panel/index.mdx | 13 +++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/packages/paste-codemods/tools/.cache/mappings.json b/packages/paste-codemods/tools/.cache/mappings.json index 71f732680f..eadc2c00d9 100644 --- a/packages/paste-codemods/tools/.cache/mappings.json +++ b/packages/paste-codemods/tools/.cache/mappings.json @@ -246,6 +246,7 @@ "SidePanelButton": "@twilio-paste/core/side-panel", "SidePanelContainer": "@twilio-paste/core/side-panel", "SidePanelContext": "@twilio-paste/core/side-panel", + "SidePanelFooter": "@twilio-paste/core/side-panel", "SidePanelHeader": "@twilio-paste/core/side-panel", "SidePanelHeaderActions": "@twilio-paste/core/side-panel", "SidePanelPushContentWrapper": "@twilio-paste/core/side-panel", diff --git a/packages/paste-website/src/component-examples/SideModalExamples.ts b/packages/paste-website/src/component-examples/SideModalExamples.ts index b412eef42f..fffd978651 100644 --- a/packages/paste-website/src/component-examples/SideModalExamples.ts +++ b/packages/paste-website/src/component-examples/SideModalExamples.ts @@ -52,8 +52,8 @@ const SideModalFooterExample = () => { - - + + diff --git a/packages/paste-website/src/pages/components/side-panel/index.mdx b/packages/paste-website/src/pages/components/side-panel/index.mdx index c8e2f0240e..14b351af12 100644 --- a/packages/paste-website/src/pages/components/side-panel/index.mdx +++ b/packages/paste-website/src/pages/components/side-panel/index.mdx @@ -45,6 +45,7 @@ export const getStaticProps = async () => { { const [isOpen, setIsOpen] = React.useState(true); @@ -64,6 +65,9 @@ export const SidePanelExample = (): React.ReactNode => { Side Panel content goes here. + + Chat composer goes here. + @@ -112,6 +116,7 @@ Pass the `isOpen` and `setIsOpen` props to the `SidePanelContainer` component to { const [isOpen, setIsOpen] = React.useState(true); @@ -131,6 +136,9 @@ export const SidePanelExample = (): React.ReactNode => { Side Panel content goes here. + + Chat composer goes here. + @@ -148,6 +156,7 @@ To internationalize Side Panel, simply pass different text as children to the Si { const [isOpen, setIsOpen] = React.useState(true); @@ -191,6 +200,10 @@ The Side Panel Header Actions component is a container for action buttons that a The Side Panel Body is a container for the main content of the Side Panel. This is where the majority of the content will be placed. +#### Side Panel Footer + +The Side Panel Footer is a container for the Side Panel's overall actions, such as a [Chat Composer](/components/chat-composer) or [Button(s)](/components/button). + ### Side Panel Push Content Wrapper The Side Panel Push Content Wrapper is a container for the main page content that is pushed to the side when the Side Panel is open. This wrapper is used to control the positioning of the main page content when the Side Panel is open. Ensuring that the content of this component is fully responsive is important to prevent the page from jumping or shifting when the Side Panel is opened or closed. From 875fadf98abd9e9936c22e9463a977f1c5fe7879 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnora?= Date: Wed, 24 Jul 2024 12:58:05 -0400 Subject: [PATCH 5/9] chore(chat-composer): make container 100% width --- .changeset/nine-geese-end.md | 6 ++++++ .../components/chat-composer/src/ChatComposerContainer.tsx | 1 + 2 files changed, 7 insertions(+) create mode 100644 .changeset/nine-geese-end.md diff --git a/.changeset/nine-geese-end.md b/.changeset/nine-geese-end.md new file mode 100644 index 0000000000..94b53d429f --- /dev/null +++ b/.changeset/nine-geese-end.md @@ -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 diff --git a/packages/paste-core/components/chat-composer/src/ChatComposerContainer.tsx b/packages/paste-core/components/chat-composer/src/ChatComposerContainer.tsx index dc31b1d14d..5c2952719e 100644 --- a/packages/paste-core/components/chat-composer/src/ChatComposerContainer.tsx +++ b/packages/paste-core/components/chat-composer/src/ChatComposerContainer.tsx @@ -64,6 +64,7 @@ export const ChatComposerContainer = React.forwardRef {children} From 36924e8a1e6f08b752559040355e56d89d038f99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnora?= Date: Wed, 24 Jul 2024 13:08:51 -0400 Subject: [PATCH 6/9] chore(side-modal): remove changes to footer actions alignment --- .changeset/real-flowers-turn.md | 2 +- .../components/side-modal/src/SideModalFooterActions.tsx | 2 +- .../components/side-modal/stories/customization.stories.tsx | 2 +- .../paste-core/components/side-modal/stories/index.stories.tsx | 2 +- .../paste-website/src/component-examples/SideModalExamples.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.changeset/real-flowers-turn.md b/.changeset/real-flowers-turn.md index e77a82c5c0..76a185e762 100644 --- a/.changeset/real-flowers-turn.md +++ b/.changeset/real-flowers-turn.md @@ -3,4 +3,4 @@ "@twilio-paste/core": patch --- -[Side Modal] Increase size of close icon and left-align footer actions by default. +[Side Modal] Increase size of close icon. diff --git a/packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx b/packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx index e08ca487cc..644c9e26ea 100644 --- a/packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx +++ b/packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx @@ -31,7 +31,7 @@ export interface SideModalFooterActionsProps extends HTMLPasteProps<"div"> { } const SideModalFooterActions = React.forwardRef( - ({ children, element = "SIDE_MODAL_FOOTER_ACTIONS", justifyContent = "flex-start", ...props }, ref) => { + ({ children, element = "SIDE_MODAL_FOOTER_ACTIONS", justifyContent = "flex-end", ...props }, ref) => { return ( - + diff --git a/packages/paste-core/components/side-modal/stories/index.stories.tsx b/packages/paste-core/components/side-modal/stories/index.stories.tsx index bc41d35b6e..8b6a5f087f 100644 --- a/packages/paste-core/components/side-modal/stories/index.stories.tsx +++ b/packages/paste-core/components/side-modal/stories/index.stories.tsx @@ -64,8 +64,8 @@ export const Default: StoryFn = () => { - + diff --git a/packages/paste-website/src/component-examples/SideModalExamples.ts b/packages/paste-website/src/component-examples/SideModalExamples.ts index fffd978651..cdf63eda78 100644 --- a/packages/paste-website/src/component-examples/SideModalExamples.ts +++ b/packages/paste-website/src/component-examples/SideModalExamples.ts @@ -52,8 +52,8 @@ const SideModalFooterExample = () => { - + From 20b666e975ec0eeeb16312bd10a49d294d2f40c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnora?= Date: Wed, 24 Jul 2024 13:18:24 -0400 Subject: [PATCH 7/9] chore(side-panel): allow justification of footer content --- .changeset/tiny-badgers-rush.md | 2 +- .../components/side-panel/src/SidePanelBody.tsx | 6 +++--- .../components/side-panel/src/SidePanelFooter.tsx | 13 ++++++++----- .../paste-core/components/side-panel/src/types.ts | 14 ++++++++++++++ .../stories/components/SidePanelWithAIContent.tsx | 4 ++-- .../side-panel/stories/index.stories.tsx | 2 +- 6 files changed, 29 insertions(+), 12 deletions(-) diff --git a/.changeset/tiny-badgers-rush.md b/.changeset/tiny-badgers-rush.md index b506c45b99..a893d6dcd6 100644 --- a/.changeset/tiny-badgers-rush.md +++ b/.changeset/tiny-badgers-rush.md @@ -3,4 +3,4 @@ "@twilio-paste/core": minor --- -[Side Panel] Create SidePanelFooter exported from the Side Panel package for actions or chat composers. +[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. diff --git a/packages/paste-core/components/side-panel/src/SidePanelBody.tsx b/packages/paste-core/components/side-panel/src/SidePanelBody.tsx index b44f6fe516..da5b7a1763 100644 --- a/packages/paste-core/components/side-panel/src/SidePanelBody.tsx +++ b/packages/paste-core/components/side-panel/src/SidePanelBody.tsx @@ -7,7 +7,7 @@ import type { SidePanelBodyProps } from "./types"; // This wrapper applies styles that customize the scrollbar and its track const SidePanelBodyWrapper = styled.div(({ theme }: { theme: ThemeShape }) => { - const { colorBackgroundBody, colorBackground, colorBackgroundStrong } = theme.backgroundColors; + const { colorBackgroundBody, colorBackgroundStrong, colorBackgroundStronger } = theme.backgroundColors; return css({ // Scrollbar @@ -23,12 +23,12 @@ const SidePanelBodyWrapper = styled.div(({ theme }: { theme: ThemeShape }) => { }, // Handle "::-webkit-scrollbar-thumb": { - background: colorBackground, + background: colorBackgroundStrong, borderRadius: "10px", }, // Handle on hover "::-webkit-scrollbar-thumb:hover": { - background: colorBackgroundStrong, + background: colorBackgroundStronger, }, }); }); diff --git a/packages/paste-core/components/side-panel/src/SidePanelFooter.tsx b/packages/paste-core/components/side-panel/src/SidePanelFooter.tsx index bb47dbeabd..248ecee702 100644 --- a/packages/paste-core/components/side-panel/src/SidePanelFooter.tsx +++ b/packages/paste-core/components/side-panel/src/SidePanelFooter.tsx @@ -4,18 +4,21 @@ import * as React from "react"; import type { SidePanelFooterProps } from "./types"; const SidePanelFooter = React.forwardRef( - ({ element = "SIDE_PANEL_FOOTER", children, ...props }, ref) => { + ({ element = "SIDE_PANEL_FOOTER", variant = "default", children, justifyContent = "flex-start", ...props }, ref) => { return ( { export interface SidePanelFooterProps extends HTMLPasteProps<"div"> { children?: React.ReactNode; + /** + * Variant of the Side Panel Footer. When using Side Panel in an AI Chat context, use the "chat" variant to wrap the Chat Composer component. + * @default "default" + * @type {"default" | "chat"} + * @memberof SidePanelFooterProps + */ + variant?: "default" | "chat"; + /** + * Sets the `justify-content` CSS property. + * @default "flex-start" + * @type {"flex-start" | "flex-end" | "space-between"} + * @memberof SidePanelFooterProps + */ + justifyContent?: "flex-start" | "flex-end" | "space-between"; /** * Overrides the default element name to apply unique styles with the Customization Provider * @default "SIDE_PANEL_FOOTER" diff --git a/packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.tsx b/packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.tsx index e71544c56b..8c792ac365 100644 --- a/packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.tsx +++ b/packages/paste-core/components/side-panel/stories/components/SidePanelWithAIContent.tsx @@ -66,8 +66,8 @@ export const SidePanelWithAIContent: React.FC = () => { - - + + { - + More filters 2 From 215c0bc1eab88e37947297d815e523d4682be3cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnora?= Date: Wed, 24 Jul 2024 13:27:26 -0400 Subject: [PATCH 8/9] chore: typedocs --- .../components/side-panel/type-docs.json | 1597 +++++++++++++++++ 1 file changed, 1597 insertions(+) diff --git a/packages/paste-core/components/side-panel/type-docs.json b/packages/paste-core/components/side-panel/type-docs.json index e072bdef9b..f5bb0fb891 100644 --- a/packages/paste-core/components/side-panel/type-docs.json +++ b/packages/paste-core/components/side-panel/type-docs.json @@ -12922,5 +12922,1602 @@ "required": false, "externalProp": true } + }, + "SidePanelFooter": { + "about": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "accessKey": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "aria-activedescendant": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Identifies the currently active element when DOM focus is on a composite widget, textbox, group, or application." + }, + "aria-atomic": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates whether assistive technologies will present all, or only parts of, the changed region based on the change notifications defined by the aria-relevant attribute." + }, + "aria-autocomplete": { + "type": "\"list\" | \"none\" | \"inline\" | \"both\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates whether inputting text could trigger display of one or more predictions of the user's intended value for an input and specifies how predictions would be\npresented if they are made." + }, + "aria-busy": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates an element is being modified and that assistive technologies MAY want to wait until the modifications are complete before exposing them to the user." + }, + "aria-checked": { + "type": "boolean | \"true\" | \"false\" | \"mixed\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates the current \"checked\" state of checkboxes, radio buttons, and other widgets." + }, + "aria-colcount": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the total number of columns in a table, grid, or treegrid." + }, + "aria-colindex": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines an element's column index or position with respect to the total number of columns within a table, grid, or treegrid." + }, + "aria-colspan": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the number of columns spanned by a cell or gridcell within a table, grid, or treegrid." + }, + "aria-controls": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Identifies the element (or elements) whose contents or presence are controlled by the current element." + }, + "aria-current": { + "type": "| boolean\n | \"time\"\n | \"true\"\n | \"false\"\n | \"page\"\n | \"step\"\n | \"location\"\n | \"date\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates the element that represents the current item within a container or set of related elements." + }, + "aria-describedby": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Identifies the element (or elements) that describes the object." + }, + "aria-details": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Identifies the element that provides a detailed, extended description for the object." + }, + "aria-disabled": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates that the element is perceivable but disabled, so it is not editable or otherwise operable." + }, + "aria-dropeffect": { + "type": "\"link\" | \"none\" | \"copy\" | \"execute\" | \"move\" | \"popup\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates what functions can be performed when a dragged object is released on the drop target." + }, + "aria-errormessage": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Identifies the element that provides an error message for the object." + }, + "aria-expanded": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates whether the element, or another grouping element it controls, is currently expanded or collapsed." + }, + "aria-flowto": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Identifies the next element (or elements) in an alternate reading order of content which, at the user's discretion,\nallows assistive technology to override the general default of reading in document source order." + }, + "aria-grabbed": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates an element's \"grabbed\" state in a drag-and-drop operation." + }, + "aria-haspopup": { + "type": "| boolean\n | \"dialog\"\n | \"menu\"\n | \"true\"\n | \"false\"\n | \"grid\"\n | \"listbox\"\n | \"tree\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates the availability and type of interactive popup element, such as menu or dialog, that can be triggered by an element." + }, + "aria-hidden": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates whether the element is exposed to an accessibility API." + }, + "aria-invalid": { + "type": "boolean | \"true\" | \"false\" | \"grammar\" | \"spelling\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates the entered value does not conform to the format expected by the application." + }, + "aria-keyshortcuts": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates keyboard shortcuts that an author has implemented to activate or give focus to an element." + }, + "aria-label": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines a string value that labels the current element." + }, + "aria-labelledby": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Identifies the element (or elements) that labels the current element." + }, + "aria-level": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the hierarchical level of an element within a structure." + }, + "aria-live": { + "type": "\"off\" | \"assertive\" | \"polite\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates that an element will be updated, and describes the types of updates the user agents, assistive technologies, and user can expect from the live region." + }, + "aria-modal": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates whether an element is modal when displayed." + }, + "aria-multiline": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates whether a text box accepts multiple lines of input or only a single line." + }, + "aria-multiselectable": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates that the user may select more than one item from the current selectable descendants." + }, + "aria-orientation": { + "type": "\"horizontal\" | \"vertical\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates whether the element's orientation is horizontal, vertical, or unknown/ambiguous." + }, + "aria-owns": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Identifies an element (or elements) in order to define a visual, functional, or contextual parent/child relationship\nbetween DOM elements where the DOM hierarchy cannot be used to represent the relationship." + }, + "aria-placeholder": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value.\nA hint could be a sample value or a brief description of the expected format." + }, + "aria-posinset": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines an element's number or position in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM." + }, + "aria-pressed": { + "type": "boolean | \"true\" | \"false\" | \"mixed\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates the current \"pressed\" state of toggle buttons." + }, + "aria-readonly": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates that the element is not editable, but is otherwise operable." + }, + "aria-relevant": { + "type": "| \"text\"\n | \"additions\"\n | \"additions removals\"\n | \"additions text\"\n | \"all\"\n | \"removals\"\n | \"removals additions\"\n | \"removals text\"\n | \"text additions\"\n | \"text removals\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates what notifications the user agent will trigger when the accessibility tree within a live region is modified." + }, + "aria-required": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates that user input is required on the element before a form may be submitted." + }, + "aria-roledescription": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines a human-readable, author-localized description for the role of an element." + }, + "aria-rowcount": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the total number of rows in a table, grid, or treegrid." + }, + "aria-rowindex": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines an element's row index or position with respect to the total number of rows within a table, grid, or treegrid." + }, + "aria-rowspan": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the number of rows spanned by a cell or gridcell within a table, grid, or treegrid." + }, + "aria-selected": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates the current \"selected\" state of various widgets." + }, + "aria-setsize": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the number of items in the current set of listitems or treeitems. Not required if all elements in the set are present in the DOM." + }, + "aria-sort": { + "type": "\"none\" | \"ascending\" | \"descending\" | \"other\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Indicates if items in a table or grid are sorted in ascending or descending order." + }, + "aria-valuemax": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the maximum allowed value for a range widget." + }, + "aria-valuemin": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the minimum allowed value for a range widget." + }, + "aria-valuenow": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the current value for a range widget." + }, + "aria-valuetext": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Defines the human readable text alternative of aria-valuenow for a range widget." + }, + "autoCapitalize": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "autoCorrect": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "autoSave": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "contentEditable": { + "type": "Booleanish | \"inherit\"", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "contextMenu": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "dangerouslySetInnerHTML": { + "type": "{ __html: string }", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "datatype": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "defaultChecked": { + "type": "boolean", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "defaultValue": { + "type": "string | number | readonly string[]", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "dir": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "draggable": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "element": { + "type": "string", + "defaultValue": "SIDE_PANEL_FOOTER", + "required": false, + "externalProp": false, + "description": "Overrides the default element name to apply unique styles with the Customization Provider" + }, + "hidden": { + "type": "boolean", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "id": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "inlist": { + "type": "any", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "inputMode": { + "type": "| \"text\"\n | \"none\"\n | \"search\"\n | \"tel\"\n | \"url\"\n | \"email\"\n | \"numeric\"\n | \"decimal\"", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Hints at the type of data that might be entered by the user while editing the element or its contents" + }, + "is": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true, + "description": "Specify that a standard HTML element should behave like a defined custom built-in element" + }, + "itemID": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "itemProp": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "itemRef": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "itemScope": { + "type": "boolean", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "itemType": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "justifyContent": { + "type": "\"flex-start\" | \"flex-end\" | \"space-between\"", + "defaultValue": "flex-start", + "required": false, + "externalProp": false, + "description": "Sets the `justify-content` CSS property." + }, + "key": { + "type": "Key", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "lang": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "nonce": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAbort": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAbortCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAnimationEnd": { + "type": "AnimationEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAnimationEndCapture": { + "type": "AnimationEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAnimationIteration": { + "type": "AnimationEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAnimationIterationCapture": { + "type": "AnimationEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAnimationStart": { + "type": "AnimationEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAnimationStartCapture": { + "type": "AnimationEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAuxClick": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onAuxClickCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onBeforeInput": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onBeforeInputCapture": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onBlur": { + "type": "FocusEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onBlurCapture": { + "type": "FocusEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCanPlay": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCanPlayCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCanPlayThrough": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCanPlayThroughCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onChange": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onChangeCapture": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onClick": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onClickCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCompositionEnd": { + "type": "CompositionEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCompositionEndCapture": { + "type": "CompositionEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCompositionStart": { + "type": "CompositionEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCompositionStartCapture": { + "type": "CompositionEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCompositionUpdate": { + "type": "CompositionEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCompositionUpdateCapture": { + "type": "CompositionEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onContextMenu": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onContextMenuCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCopy": { + "type": "ClipboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCopyCapture": { + "type": "ClipboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCut": { + "type": "ClipboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onCutCapture": { + "type": "ClipboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDoubleClick": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDoubleClickCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDrag": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragCapture": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragEnd": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragEndCapture": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragEnter": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragEnterCapture": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragExit": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragExitCapture": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragLeave": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragLeaveCapture": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragOver": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragOverCapture": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragStart": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDragStartCapture": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDrop": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDropCapture": { + "type": "DragEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDurationChange": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onDurationChangeCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onEmptied": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onEmptiedCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onEncrypted": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onEncryptedCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onEnded": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onEndedCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onError": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onErrorCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onFocus": { + "type": "FocusEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onFocusCapture": { + "type": "FocusEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onGotPointerCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onGotPointerCaptureCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onInput": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onInputCapture": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onInvalid": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onInvalidCapture": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onKeyDown": { + "type": "KeyboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onKeyDownCapture": { + "type": "KeyboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onKeyPress": { + "type": "KeyboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onKeyPressCapture": { + "type": "KeyboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onKeyUp": { + "type": "KeyboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onKeyUpCapture": { + "type": "KeyboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLoad": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLoadCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLoadedData": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLoadedDataCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLoadedMetadata": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLoadedMetadataCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLoadStart": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLoadStartCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLostPointerCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onLostPointerCaptureCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseDown": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseDownCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseEnter": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseLeave": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseMove": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseMoveCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseOut": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseOutCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseOver": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseOverCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseUp": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onMouseUpCapture": { + "type": "MouseEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPaste": { + "type": "ClipboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPasteCapture": { + "type": "ClipboardEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPause": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPauseCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPlay": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPlayCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPlaying": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPlayingCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerCancel": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerCancelCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerDown": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerDownCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerEnter": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerEnterCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerLeave": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerLeaveCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerMove": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerMoveCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerOut": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerOutCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerOver": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerOverCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerUp": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onPointerUpCapture": { + "type": "PointerEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onProgress": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onProgressCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onRateChange": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onRateChangeCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onReset": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onResetCapture": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onResize": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onResizeCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onScroll": { + "type": "UIEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onScrollCapture": { + "type": "UIEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSeeked": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSeekedCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSeeking": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSeekingCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSelect": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSelectCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onStalled": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onStalledCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSubmit": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSubmitCapture": { + "type": "FormEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSuspend": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onSuspendCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTimeUpdate": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTimeUpdateCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTouchCancel": { + "type": "TouchEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTouchCancelCapture": { + "type": "TouchEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTouchEnd": { + "type": "TouchEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTouchEndCapture": { + "type": "TouchEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTouchMove": { + "type": "TouchEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTouchMoveCapture": { + "type": "TouchEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTouchStart": { + "type": "TouchEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTouchStartCapture": { + "type": "TouchEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTransitionEnd": { + "type": "TransitionEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onTransitionEndCapture": { + "type": "TransitionEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onVolumeChange": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onVolumeChangeCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onWaiting": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onWaitingCapture": { + "type": "ReactEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onWheel": { + "type": "WheelEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "onWheelCapture": { + "type": "WheelEventHandler", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "placeholder": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "prefix": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "property": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "radioGroup": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "resource": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "results": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "role": { + "type": "AriaRole", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "security": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "slot": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "spellCheck": { + "type": "Booleanish", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "suppressContentEditableWarning": { + "type": "boolean", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "suppressHydrationWarning": { + "type": "boolean", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "tabIndex": { + "type": "number", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "title": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "translate": { + "type": "\"yes\" | \"no\"", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "typeof": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "unselectable": { + "type": "\"on\" | \"off\"", + "defaultValue": null, + "required": false, + "externalProp": true + }, + "variant": { + "type": "\"default\" | \"chat\"", + "defaultValue": "default", + "required": false, + "externalProp": false, + "description": "Variant of the Side Panel Footer. When using Side Panel in an AI Chat context, use the \"chat\" variant to wrap the Chat Composer component." + }, + "vocab": { + "type": "string", + "defaultValue": null, + "required": false, + "externalProp": true + } } } From a2146bb7aae2c477ff00f1b19a7f45b7ec3180a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9Cnora?= Date: Wed, 24 Jul 2024 16:11:16 -0400 Subject: [PATCH 9/9] chore: pr feedback --- .changeset/tasty-rats-sniff.md | 5 +++++ .../ai-chat-log/stories/composer.stories.tsx | 19 +------------------ .../components/SidePanelWithFilterContent.tsx | 4 +++- .../src/pages/components/side-panel/index.mdx | 8 +++++--- 4 files changed, 14 insertions(+), 22 deletions(-) create mode 100644 .changeset/tasty-rats-sniff.md diff --git a/.changeset/tasty-rats-sniff.md b/.changeset/tasty-rats-sniff.md new file mode 100644 index 0000000000..aaecb90aa2 --- /dev/null +++ b/.changeset/tasty-rats-sniff.md @@ -0,0 +1,5 @@ +--- +"@twilio-paste/codemods": patch +--- + +[Codemods] New export from side-panel package diff --git a/packages/paste-core/components/ai-chat-log/stories/composer.stories.tsx b/packages/paste-core/components/ai-chat-log/stories/composer.stories.tsx index 5377f69d63..f1883b2d1a 100644 --- a/packages/paste-core/components/ai-chat-log/stories/composer.stories.tsx +++ b/packages/paste-core/components/ai-chat-log/stories/composer.stories.tsx @@ -84,23 +84,6 @@ const createNewMessage = (message: string): Omit => { }; }; -const SendButtonPlugin = ({ onClick }: { onClick: () => void }): JSX.Element => { - const [editor] = useLexicalComposerContext(); - - const handleSend = (): void => { - onClick(); - editor.dispatchCommand(CLEAR_EDITOR_COMMAND, undefined); - }; - - return ( - - - - ); -}; - const EnterKeySubmitPlugin = ({ onKeyDown }: { onKeyDown: () => void }): null => { const [editor] = useLexicalComposerContext(); @@ -203,7 +186,7 @@ export const AIChatLogComposer = (): React.ReactNode => { return ( - + diff --git a/packages/paste-core/components/side-panel/stories/components/SidePanelWithFilterContent.tsx b/packages/paste-core/components/side-panel/stories/components/SidePanelWithFilterContent.tsx index 46fbb078e2..cd4f60cd80 100644 --- a/packages/paste-core/components/side-panel/stories/components/SidePanelWithFilterContent.tsx +++ b/packages/paste-core/components/side-panel/stories/components/SidePanelWithFilterContent.tsx @@ -6,6 +6,7 @@ import { Button } from "@twilio-paste/button"; import { Disclosure, DisclosureContent, DisclosureHeading } from "@twilio-paste/disclosure"; import { Heading } from "@twilio-paste/heading"; import { Radio, RadioGroup } from "@twilio-paste/radio-group"; +import { Separator } from "@twilio-paste/separator"; import * as React from "react"; import { SidePanel, SidePanelBody, SidePanelFooter, SidePanelHeader } from "../../src"; @@ -18,8 +19,9 @@ export const SidePanelWithFilterContent: React.FC = () More filters + - + diff --git a/packages/paste-website/src/pages/components/side-panel/index.mdx b/packages/paste-website/src/pages/components/side-panel/index.mdx index 14b351af12..c933eeb5db 100644 --- a/packages/paste-website/src/pages/components/side-panel/index.mdx +++ b/packages/paste-website/src/pages/components/side-panel/index.mdx @@ -61,12 +61,13 @@ export const SidePanelExample = (): React.ReactNode => { + Side Panel content goes here. - Chat composer goes here. + Footer content goes here. @@ -132,12 +133,13 @@ export const SidePanelExample = (): React.ReactNode => { + Side Panel content goes here. - Chat composer goes here. + Footer content goes here. @@ -168,7 +170,7 @@ export const SidePanelExample = (): React.ReactNode => { Título - ... + Side Panel content goes here.