Skip to content

Commit

Permalink
feat(alert-dialog): remove size prop support
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrés Alvarez authored and Andrés Alvarez committed Nov 8, 2023
1 parent 8cac1fc commit e99e370
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions packages/components/alert-dialog/src/AlertDialogContent.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
import { composeEventHandlers } from '@radix-ui/primitive'
import { Dialog, DialogContentProps } from '@spark-ui/dialog'
import { cx } from 'class-variance-authority'
import { ElementRef, forwardRef, useMemo, useRef } from 'react'

import { AlertDialogContext } from './AlertDialogContext'

export type AlertDialogContentElement = ElementRef<typeof Dialog.Content>
export type AlertDialogContentProps = Omit<
DialogContentProps,
'onPointerDownOutside' | 'onInteractOutside'
'size' | 'onPointerDownOutside' | 'onInteractOutside'
>

export const AlertDialogContent = forwardRef<AlertDialogContentElement, AlertDialogContentProps>(
({ onOpenAutoFocus, ...others }, ref) => {
({ className, onOpenAutoFocus, ...others }, ref) => {
const cancelRef = useRef<HTMLButtonElement | null>(null)

const value = useMemo(() => {
Expand All @@ -37,7 +38,9 @@ export const AlertDialogContent = forwardRef<AlertDialogContentElement, AlertDia
ref={ref}
data-spark-component="alert-dialog-content"
{...others}
className={cx(className, '!w-auto min-w-sz-288')}
role="alertdialog"
size="md"
onOpenAutoFocus={composeEventHandlers(onOpenAutoFocus, handleOpenAutoFocus)}
onPointerDownOutside={handlePointerDownOutside}
onInteractOutside={handleInteractOutside}
Expand Down

0 comments on commit e99e370

Please sign in to comment.