Reintroduce row, but deviate from material to retain accessibility

row-reverse causes the tab order to deviate from the reading order
This commit is contained in:
Manav Rathi
2024-10-11 18:54:14 +05:30
parent 70cd901571
commit 04b61ddb21
2 changed files with 7 additions and 1 deletions

View File

@@ -108,6 +108,8 @@ export interface MiniDialogAttributes {
text: string;
action: () => void;
};
/** The direction in which the buttons are stacked. Default is "column". */
buttonDirection?: "row" | "column";
}
type MiniDialogProps = Omit<DialogProps, "onClose"> & {
@@ -207,7 +209,10 @@ export const AttributedMiniDialog: React.FC<
</Typography>
)}
{children}
<Stack sx={{ paddingBlockStart: "24px", gap: "12px" }}>
<Stack
sx={{ paddingBlockStart: "24px", gap: "12px" }}
direction={attributes.buttonDirection ?? "column"}
>
{phase == "failed" && (
<Typography variant="small" color="critical.main">
{t("generic_error")}