Skip to content

Commit e0947b5

Browse files
authored
fix(Dialog): reverse the order of buttons (#850)
1 parent 9e502b7 commit e0947b5

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@cube-dev/ui-kit": patch
3+
---
4+
5+
Reverse the order of buttons in dialogs.

src/components/other/Calendar/Calendar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useProviderProps } from '../../../provider';
1515
import { tasty } from '../../../tasty';
1616
import { Button } from '../../actions';
1717
import { Title } from '../../content/Title';
18+
import { Space } from '../../layout/Space';
1819

1920
import { CalendarGrid } from './CalendarGrid';
2021

@@ -70,10 +71,10 @@ function Calendar(props: CubeCalendarProps, ref: FocusableRef<HTMLElement>) {
7071
<Title level={6} preset="h6">
7172
{title}
7273
</Title>
73-
<Button.Group gap=".5x">
74+
<Space gap=".5x">
7475
<Button size="xsmall" {...prevButtonProps} icon={<LeftIcon />} />
7576
<Button size="xsmall" {...nextButtonProps} icon={<RightIcon />} />
76-
</Button.Group>
77+
</Space>
7778
</CalendarHeaderElement>
7879
<CalendarGrid state={state} selectedRange={props.selectedRange} />
7980
</CalendarElement>

src/components/other/Calendar/RangeCalendar.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { useProviderProps } from '../../../provider';
1515
import { tasty } from '../../../tasty';
1616
import { Button } from '../../actions';
1717
import { Title } from '../../content/Title';
18+
import { Space } from '../../layout/Space';
1819

1920
import { CalendarGrid } from './CalendarGrid';
2021

@@ -64,10 +65,10 @@ function RangeCalendar<T extends DateValue>(
6465
<Title level={6} preset="h6">
6566
{title}
6667
</Title>
67-
<Button.Group gap=".5x">
68+
<Space gap=".5x">
6869
<Button size="small" {...prevButtonProps} icon={<LeftIcon />} />
6970
<Button size="small" {...nextButtonProps} icon={<RightIcon />} />
70-
</Button.Group>
71+
</Space>
7172
</CalendarHeaderElement>
7273
<CalendarGrid state={state} />
7374
</CalendarElement>

src/components/overlays/AlertDialog/AlertDialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ function AlertDialog(props: CubeAlertDialogProps, ref) {
8484
) : null}
8585
{!noActions && (confirmProps || secondaryProps || cancelProps) ? (
8686
<Footer>
87-
<ButtonGroup align="end">
87+
<ButtonGroup>
8888
{confirmProps && (
8989
<Button
9090
autoFocus

src/components/overlays/Dialog/Dialog.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,12 +264,17 @@ const DialogContent = forwardRef(function DialogContent(
264264
styles: {
265265
display: 'flex',
266266
gap: '1x',
267-
flow: 'row',
267+
flow: 'row-reverse',
268268
placeItems: 'baseline stretch',
269269
placeContent: 'space-between',
270270
padding: '$dialog-footer-v $dialog-padding-h',
271271
},
272272
},
273+
buttonGroup: {
274+
styles: {
275+
flow: 'row-reverse',
276+
},
277+
},
273278
};
274279

275280
return (

0 commit comments

Comments
 (0)