Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/huge-llamas-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': minor
---

Remove ConfirmationDialog custom renders to ensure visual parity with Dialog
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

42 changes: 1 addition & 41 deletions packages/react/src/ConfirmationDialog/ConfirmationDialog.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
import type React from 'react'
import {useCallback} from 'react'
import {createRoot} from 'react-dom/client'
import {FocusKeys} from '@primer/behaviors'
import type {DialogProps, DialogHeaderProps, DialogButtonProps, DialogWidth, DialogHeight} from '../Dialog/Dialog'
import type {DialogButtonProps, DialogWidth, DialogHeight} from '../Dialog/Dialog'
import {Dialog} from '../Dialog/Dialog'
import {useFocusZone} from '../hooks/useFocusZone'
import BaseStyles from '../BaseStyles'
import classes from './ConfirmationDialog.module.css'
import Heading from '../Heading'

/**
* Props to customize the ConfirmationDialog.
Expand Down Expand Up @@ -81,39 +77,6 @@ export interface ConfirmationDialogProps {
height?: DialogHeight
}

const ConfirmationHeader: React.FC<React.PropsWithChildren<DialogHeaderProps>> = ({title, onClose, dialogLabelId}) => {
const onCloseClick = useCallback(() => {
onClose('close-button')
}, [onClose])

return (
<div className={classes.ConfirmationHeader}>
<Heading id={dialogLabelId} as="h1" variant="small">
{title}
</Heading>
<Dialog.CloseButton onClose={onCloseClick} />
</div>
)
}

const ConfirmationBody: React.FC<React.PropsWithChildren<DialogProps>> = ({children}) => {
return <div className={classes.ConfirmationBody}>{children}</div>
}

const ConfirmationFooter: React.FC<React.PropsWithChildren<DialogProps>> = ({footerButtons}) => {
const {containerRef: footerRef} = useFocusZone({
bindKeys: FocusKeys.ArrowHorizontal | FocusKeys.Tab,
focusInStrategy: 'closest',
})

// Must have exactly 2 buttons!
Copy link
Contributor

@hectahertz hectahertz Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before merging, I'd have a look at why this was added, just in case.

I'd also have a look at why it was styled differently.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The exactly 2 buttons remains, since those are generated internally in the component.

Who could I speak to regarding the styles?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lukasoppermann mentioned on the slack thread:

I don't think they should be different. This is probably a change that was not propagated to both components.

Would this confirmation be enough?

return (
<div ref={footerRef as React.RefObject<HTMLDivElement>} className={classes.ConfirmationFooter}>
<Dialog.Buttons buttons={footerButtons ?? []} />
</div>
)
}

/**
* A ConfirmationDialog is a special kind of dialog with more rigid behavior. It
* is used to confirm a user action. ConfirmationDialogs always have exactly
Expand Down Expand Up @@ -168,9 +131,6 @@ export const ConfirmationDialog: React.FC<React.PropsWithChildren<ConfirmationDi
width={width}
height={height}
className={className}
renderHeader={ConfirmationHeader}
renderBody={ConfirmationBody}
renderFooter={ConfirmationFooter}
>
{children}
</Dialog>
Expand Down
Loading