Skip to content

Commit 93f4921

Browse files
Fix scrollable modal story and address review feedback
1 parent 7a3a307 commit 93f4921

File tree

2 files changed

+45
-37
lines changed

2 files changed

+45
-37
lines changed

Diff for: packages/bento-design-system/src/Chip/Chip.css.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export const chipRecipe = strictRecipe({
1111
}),
1212
variants: {
1313
uppercase: {
14-
true: {
14+
true: bentoSprinkles({
1515
textTransform: "uppercase",
16-
},
16+
}),
1717
},
1818
},
1919
});

Diff for: packages/bento-design-system/src/Modal/Modal.tsx

+43-35
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ import {
88
Box,
99
Column,
1010
Columns,
11-
Inset,
1211
Actions,
13-
Stack,
1412
} from "..";
1513
import { useOverlay, usePreventScroll, useModal } from "@react-aria/overlays";
1614
import { useDialog } from "@react-aria/dialog";
@@ -103,40 +101,50 @@ export function Modal(props: Props) {
103101

104102
return (
105103
<CustomModal {...props} aria-label={props.title}>
106-
<Inset spaceX={config.paddingX} spaceY={config.paddingY}>
107-
<Stack space={config.internalSpacing}>
108-
<Columns space={16} alignY="top">
109-
<Columns space={16} alignY="center">
110-
{icon && <Column width="content">{icon}</Column>}
111-
<Title size={config.titleSize}>{props.title}</Title>
112-
</Columns>
113-
<Column width="content">
114-
<IconButton
115-
icon={config.closeIcon}
116-
label={props.closeButtonLabel ?? defaultMessages.Modal.closeButtonLabel}
117-
onPress={props.onClose}
118-
size={config.closeIconSize}
119-
tabIndex={-1}
120-
kind="transparent"
121-
hierarchy="secondary"
122-
/>
123-
</Column>
104+
<Box
105+
paddingX={config.paddingX}
106+
paddingTop={config.paddingY}
107+
paddingBottom={config.internalSpacing}
108+
>
109+
<Columns space={16} alignY="top">
110+
<Columns space={16} alignY="center">
111+
{icon && <Column width="content">{icon}</Column>}
112+
<Title size={config.titleSize}>{props.title}</Title>
124113
</Columns>
125-
<Box className={modalBody}>{props.children}</Box>
126-
<Actions
127-
primaryAction={
128-
props.primaryAction
129-
? { ...props.primaryAction, isDestructive: kind === "destructive" }
130-
: undefined
131-
}
132-
secondaryAction={props.secondaryAction}
133-
size={config.actionsSize}
134-
loadingMessage={props.loadingMessage}
135-
error={props.error}
136-
errorBannerWidth={props.errorBannerWidth || config.defaultErrorBannerWidth}
137-
/>
138-
</Stack>
139-
</Inset>
114+
<Column width="content">
115+
<IconButton
116+
icon={config.closeIcon}
117+
label={props.closeButtonLabel ?? defaultMessages.Modal.closeButtonLabel}
118+
onPress={props.onClose}
119+
size={config.closeIconSize}
120+
tabIndex={-1}
121+
kind="transparent"
122+
hierarchy="secondary"
123+
/>
124+
</Column>
125+
</Columns>
126+
</Box>
127+
<Box className={modalBody} paddingX={config.paddingX}>
128+
{props.children}
129+
</Box>
130+
<Box
131+
paddingX={config.paddingX}
132+
paddingTop={config.internalSpacing}
133+
paddingBottom={config.paddingY}
134+
>
135+
<Actions
136+
primaryAction={
137+
props.primaryAction
138+
? { ...props.primaryAction, isDestructive: kind === "destructive" }
139+
: undefined
140+
}
141+
secondaryAction={props.secondaryAction}
142+
size={config.actionsSize}
143+
loadingMessage={props.loadingMessage}
144+
error={props.error}
145+
errorBannerWidth={props.errorBannerWidth || config.defaultErrorBannerWidth}
146+
/>
147+
</Box>
140148
</CustomModal>
141149
);
142150
}

0 commit comments

Comments
 (0)