♻️(frontend) enable flexible dialog sizing temporary

The 'Box' component has a type 'dialog' which limits the Dialog size.
The default size is insufficient for larger dialogs like
the advanced settings.

To address this temporarily, I'm allowing the wrapper component to set the
Dialog size directly. This isn't ideal, but will enable better flexibility
until we finalize the user experience and dialog requirements.

I am not sure of the new props' naming introduced.
This commit is contained in:
lebaudantoine
2024-08-14 12:00:43 +02:00
committed by aleb_the_flash
parent 20493edd07
commit 69a8eea1ce

View File

@@ -60,6 +60,7 @@ export type DialogProps = RACDialogProps & {
* after user interaction
*/
onOpenChange?: (isOpen: boolean) => void
type?: 'flex'
}
export const Dialog = ({
@@ -71,6 +72,7 @@ export const Dialog = ({
...dialogProps
}: DialogProps) => {
const isAlert = dialogProps['role'] === 'alertdialog'
const boxType = dialogProps['type'] !== 'flex' ? 'dialog' : undefined
return (
<StyledModalOverlay
isKeyboardDismissDisabled={isAlert}
@@ -95,7 +97,7 @@ export const Dialog = ({
margin="auto"
pointerEvents="auto"
>
<Box size="sm" type="dialog">
<Box size="sm" type={boxType}>
{!!title && (
<Heading
slot="title"