Skip to content

Commit 2e1a331

Browse files
authored
fix(Dialog): condense the design (#795)
1 parent 728f983 commit 2e1a331

File tree

2 files changed

+19
-24
lines changed

2 files changed

+19
-24
lines changed

.changeset/nine-candles-share.md

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+
Condense the UI of Dialog component.

src/components/overlays/Dialog/Dialog.tsx

Lines changed: 14 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
tasty,
2424
} from '../../../tasty';
2525
import { mergeProps, SlotProvider } from '../../../utils/react';
26-
import { Button } from '../../actions';
26+
import { Button, ItemButton } from '../../actions';
2727
import { useOpenTransitionContext } from '../Modal/OpenTransition';
2828

2929
import { useDialogContext } from './context';
@@ -73,45 +73,35 @@ const DialogElement = tasty({
7373
'[data-type="panel"]': 'auto',
7474
},
7575
'$dialog-title-padding-v': {
76-
'': '2x',
76+
'': '1.5x',
7777
'[data-type="popover"]': '1x',
7878
},
7979
'$dialog-content-padding-v': {
80-
'': '2x',
81-
'[data-type="popover"]': '2x',
80+
'': '1.5x',
81+
'[data-type="popover"]': '1x',
8282
},
8383
'$dialog-padding-h': {
84-
'': '2x',
85-
'[data-type="popover"]': '2x',
84+
'': '1.5x',
85+
'[data-type="popover"]': '1x',
8686
},
8787
'$dialog-footer-v': {
88-
'': '2x',
88+
'': '1.5x',
89+
'[data-type="popover"]': '1x',
90+
},
91+
'$dialog-content-gap': {
92+
'': '1.5x',
8993
'[data-type="popover"]': '1x',
9094
},
91-
'$dialog-content-gap': '2x',
9295
},
9396
});
9497

95-
const CloseButton = tasty(Button, {
98+
const CloseButton = tasty(ItemButton, {
9699
qa: 'ModalCloseButton',
97100
type: 'neutral',
98-
size: 'large',
99101
styles: {
100-
display: 'flex',
101102
position: 'absolute',
102103
top: '1x',
103104
right: '1x',
104-
placeContent: 'center',
105-
fill: {
106-
'': '#dark.0',
107-
hovered: '#dark.04',
108-
pressed: '#dark.05',
109-
},
110-
color: {
111-
'': '#dark-02',
112-
hovered: '#dark-02',
113-
pressed: '#purple',
114-
},
115105
},
116106
});
117107

@@ -261,7 +251,7 @@ const DialogContent = forwardRef(function DialogContent(
261251
display: 'flex',
262252
flow: 'row',
263253
gap: '1x',
264-
placeItems: 'baseline stretch',
254+
placeItems: 'center stretch',
265255
placeContent: 'space-between',
266256
padding: `$dialog-title-padding-v ${
267257
isDismissable ? '($dialog-padding-h + 4x)' : '$dialog-padding-h'
@@ -300,7 +290,7 @@ const DialogContent = forwardRef(function DialogContent(
300290
<SlotProvider slots={slots}>
301291
{isDismissable && (
302292
<CloseButton
303-
icon={closeIcon || <CloseIcon />}
293+
icon={closeIcon || <CloseIcon size={20} />}
304294
label={formatMessage('dismiss')}
305295
onPress={() => onDismiss && onDismiss()}
306296
/>

0 commit comments

Comments
 (0)