Skip to content

Commit 68ba389

Browse files
authored
feat(ui): switch Modal default button sequence (#1534)
* feat(ui): switch Modal default button sequence * feat(ui): remove resolved note about modal button sequence from docs * Add changeset for Modal default button sequence update
1 parent 3243595 commit 68ba389

3 files changed

Lines changed: 12 additions & 13 deletions

File tree

.changeset/three-ravens-knock.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cloudoperators/juno-ui-components": patch
3+
---
4+
5+
feat(ui): switch Modal default button sequence

docs/ux/modals.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@
22

33
# Modals
44

5-
> [!NOTE]
6-
> We have recently decided to move the primary action button in Modals to the very right, as is reflected below.
7-
> Unfortunately, the `Modal` component as of the time of writing doesn't reflect this yet, and places the primary button as the leftmost one, at least when created by the component using the API.
8-
> We will remedy this situation as soon, an issue to do that exists here: #1487 .
9-
> Once this change is merged, we can remove this note.
10-
115
A Modal is a focused UI element that interrupts user flow and prevents interaction with the underlying page or view until it is completed or dismissed.
126

137
Best used for short, self-contained tasks or decisions that require user focus. Tasks in a Modal require completion or dismissal before the user can continue interacting with the current page or view.

packages/ui-components/src/components/ModalFooter/ModalFooter.component.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,20 +59,20 @@ export const ModalFooter = ({
5959
children
6060
) : confirmButtonLabel || onConfirm ? (
6161
<ButtonRow>
62-
<Button
63-
variant="primary"
64-
label={confirmButtonLabel || "Confirm"}
65-
icon={confirmButtonIcon || undefined}
66-
disabled={disableConfirmButton}
67-
onClick={handleConfirmClick}
68-
/>
6962
<Button
7063
variant="subdued"
7164
label={cancelButtonLabel || "Cancel"}
7265
disabled={disableCancelButton}
7366
icon={cancelButtonIcon || undefined}
7467
onClick={handleCancelClick}
7568
/>
69+
<Button
70+
variant="primary"
71+
label={confirmButtonLabel || "Confirm"}
72+
icon={confirmButtonIcon || undefined}
73+
disabled={disableConfirmButton}
74+
onClick={handleConfirmClick}
75+
/>
7676
</ButtonRow>
7777
) : (
7878
<ButtonRow>

0 commit comments

Comments
 (0)