Skip to content
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

[Side Modal]!: Align Side Modal footer actions to left #4140

Merged
merged 6 commits into from
Nov 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/smooth-ads-admire.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@twilio-paste/side-modal": minor
"@twilio-paste/core": minor
---

[Side Modal]: Align `SideModalFooterActions` to left. This change is to make `Side Modal` more aligned with `Side Panel` component. If you want to keep the actions on the right, you can use the `justifyContent` prop to align them to the right. If you are keeping them on the left, it's recommended to move the primary action to the left and the secondary action to the right.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export interface SideModalFooterActionsProps extends HTMLPasteProps<"div"> {
}

const SideModalFooterActions = React.forwardRef<HTMLDivElement, SideModalFooterActionsProps>(
({ children, element = "SIDE_MODAL_FOOTER_ACTIONS", justifyContent = "flex-end", ...props }, ref) => {
({ children, element = "SIDE_MODAL_FOOTER_ACTIONS", justifyContent = "flex-start", ...props }, ref) => {
return (
<Box
{...safelySpreadBoxProps(props)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ export const CustomizedDialog: StoryFn = (_args, { parameters: { isTestEnvironme
</SideModalBody>
<SideModalFooter>
<SideModalFooterActions>
<Button variant="secondary">Cancel</Button>
<Button variant="primary">Save</Button>
<Button variant="secondary">Cancel</Button>
</SideModalFooterActions>
</SideModalFooter>
</SideModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ export const Default: StoryFn = () => {
</SideModalBody>
<SideModalFooter>
<SideModalFooterActions>
<Button variant="secondary">Cancel</Button>
<Button variant="primary">Start chat</Button>
<Button variant="secondary">Cancel</Button>
</SideModalFooterActions>
</SideModalFooter>
</SideModal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ const SideModalFooterExample = () => {
</SideModalBody>
<SideModalFooter>
<SideModalFooterActions>
<Button variant="secondary">Secondary action</Button>
<Button variant="primary">Primary action</Button>
<Button variant="secondary">Secondary action</Button>
</SideModalFooterActions>
</SideModalFooter>
</SideModal>
Expand Down
Loading