Skip to content

Commit

Permalink
[Side Modal]!: Align Side Modal footer actions to left (#4140)
Browse files Browse the repository at this point in the history
* feat(side-modal)!: update alignment of Side Modal footer actions to left

* feat(side-modal)!: add changeset

* feat(side-modal)!: update position on docs site

* feat(side-modal): update changeset

* feat(side-modal): update changeset

---------

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
PixeledCode and kodiakhq[bot] authored Nov 6, 2024
1 parent e9586bd commit 7c93daf
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 4 deletions.
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

0 comments on commit 7c93daf

Please sign in to comment.