Better dialog padding

This commit is contained in:
Gregory Schier
2024-01-19 22:08:32 -08:00
parent 2a4a830fb7
commit 92e2b2b8f9
2 changed files with 4 additions and 5 deletions

View File

@@ -55,7 +55,7 @@ export function Dialog({
className, className,
'gap-2 grid grid-rows-[auto_minmax(0,1fr)]', 'gap-2 grid grid-rows-[auto_minmax(0,1fr)]',
'relative bg-gray-50 pointer-events-auto', 'relative bg-gray-50 pointer-events-auto',
'p-5 rounded-lg overflow-auto', 'px-6 py-4 rounded-lg overflow-auto',
'dark:border border-highlight shadow shadow-black/10', 'dark:border border-highlight shadow shadow-black/10',
'max-w-[90vw] max-h-[calc(100vh-8em)]', 'max-w-[90vw] max-h-[calc(100vh-8em)]',
size === 'sm' && 'w-[25rem] max-h-[80vh]', size === 'sm' && 'w-[25rem] max-h-[80vh]',
@@ -66,8 +66,7 @@ export function Dialog({
> >
{title ? ( {title ? (
<Heading size={1} id={titleId}> <Heading size={1} id={titleId}>
{' '} {title}
{title}{' '}
</Heading> </Heading>
) : ( ) : (
<span /> <span />
@@ -80,7 +79,7 @@ export function Dialog({
<div className="ml-auto absolute right-1 top-1"> <div className="ml-auto absolute right-1 top-1">
<IconButton <IconButton
onClick={onClose} onClick={onClose}
title="Close dialog" title="Close dialog (Esc)"
aria-label="Close" aria-label="Close"
size="sm" size="sm"
icon="x" icon="x"

View File

@@ -1,5 +1,5 @@
import classNames from 'classnames'; import classNames from 'classnames';
import type { ComponentType, HTMLAttributes } from 'react'; import type { HTMLAttributes } from 'react';
interface Props extends HTMLAttributes<HTMLHeadingElement> { interface Props extends HTMLAttributes<HTMLHeadingElement> {
size?: 1 | 2 | 3; size?: 1 | 2 | 3;