Skip to content

Commit 7c93daf

Browse files
[Side Modal]!: Align Side Modal footer actions to left (#4140)
* 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>
1 parent e9586bd commit 7c93daf

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

.changeset/smooth-ads-admire.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@twilio-paste/side-modal": minor
3+
"@twilio-paste/core": minor
4+
---
5+
6+
[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.

packages/paste-core/components/side-modal/src/SideModalFooterActions.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface SideModalFooterActionsProps extends HTMLPasteProps<"div"> {
3131
}
3232

3333
const SideModalFooterActions = React.forwardRef<HTMLDivElement, SideModalFooterActionsProps>(
34-
({ children, element = "SIDE_MODAL_FOOTER_ACTIONS", justifyContent = "flex-end", ...props }, ref) => {
34+
({ children, element = "SIDE_MODAL_FOOTER_ACTIONS", justifyContent = "flex-start", ...props }, ref) => {
3535
return (
3636
<Box
3737
{...safelySpreadBoxProps(props)}

packages/paste-core/components/side-modal/stories/customization.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ export const CustomizedDialog: StoryFn = (_args, { parameters: { isTestEnvironme
8585
</SideModalBody>
8686
<SideModalFooter>
8787
<SideModalFooterActions>
88-
<Button variant="secondary">Cancel</Button>
8988
<Button variant="primary">Save</Button>
89+
<Button variant="secondary">Cancel</Button>
9090
</SideModalFooterActions>
9191
</SideModalFooter>
9292
</SideModal>

packages/paste-core/components/side-modal/stories/index.stories.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ export const Default: StoryFn = () => {
6464
</SideModalBody>
6565
<SideModalFooter>
6666
<SideModalFooterActions>
67-
<Button variant="secondary">Cancel</Button>
6867
<Button variant="primary">Start chat</Button>
68+
<Button variant="secondary">Cancel</Button>
6969
</SideModalFooterActions>
7070
</SideModalFooter>
7171
</SideModal>

packages/paste-website/src/component-examples/SideModalExamples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ const SideModalFooterExample = () => {
5252
</SideModalBody>
5353
<SideModalFooter>
5454
<SideModalFooterActions>
55-
<Button variant="secondary">Secondary action</Button>
5655
<Button variant="primary">Primary action</Button>
56+
<Button variant="secondary">Secondary action</Button>
5757
</SideModalFooterActions>
5858
</SideModalFooter>
5959
</SideModal>

0 commit comments

Comments
 (0)