Add shared core-backed React and browser runtimes, continuous playback transitions, export previews and API documentation. Package the JavaScript export as a CDN-powered demo with the portable avatar definition.
38 lines
1.3 KiB
TypeScript
38 lines
1.3 KiB
TypeScript
import { Dialog as DialogPrimitive } from '@base-ui/react/dialog'
|
|
import type * as React from 'react'
|
|
|
|
import { cn } from '@/lib/utils'
|
|
|
|
function Dialog(props: DialogPrimitive.Root.Props) {
|
|
return <DialogPrimitive.Root {...props} />
|
|
}
|
|
|
|
function DialogClose(props: DialogPrimitive.Close.Props) {
|
|
return <DialogPrimitive.Close {...props} />
|
|
}
|
|
|
|
function DialogContent({ className, children, ...props }: DialogPrimitive.Popup.Props) {
|
|
return (
|
|
<DialogPrimitive.Portal>
|
|
<DialogPrimitive.Backdrop className="dialog-backdrop" />
|
|
<DialogPrimitive.Popup className={cn('dialog-content', className)} {...props}>
|
|
{children}
|
|
</DialogPrimitive.Popup>
|
|
</DialogPrimitive.Portal>
|
|
)
|
|
}
|
|
|
|
function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
return <div className={cn('dialog-header', className)} {...props} />
|
|
}
|
|
|
|
function DialogTitle({ className, ...props }: DialogPrimitive.Title.Props) {
|
|
return <DialogPrimitive.Title className={cn('dialog-title', className)} {...props} />
|
|
}
|
|
|
|
function DialogDescription({ className, ...props }: DialogPrimitive.Description.Props) {
|
|
return <DialogPrimitive.Description className={cn('dialog-description', className)} {...props} />
|
|
}
|
|
|
|
export { Dialog, DialogClose, DialogContent, DialogDescription, DialogHeader, DialogTitle }
|