🏷️ refactor: Export the Dialog Parts Under Canonical Dialog Names (#17459)

Dialog, DialogContent, DialogTitle and the other parts, and
DialogTemplate, are now exported beside their OG names as the same
components, so new code and the docs can use the plain names while the
existing call sites keep working unchanged.
This commit is contained in:
Marco Beretta 2026-10-26 22:45:29 +01:00 • committed by GitHub
parent 8d3da9bbb2
commit 192cf3920f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 37 additions and 1 deletions

View file

@ -450,7 +450,18 @@ const DialogDescription: React.ForwardRefExoticComponent<
));
DialogDescription.displayName = DialogPrimitive.Description.displayName;
/** `Dialog*` are the canonical names. The `OG*` names are the same components under the names the
* app has always imported, kept so existing call sites need no change. */
export {
Dialog,
DialogPortal,
DialogClose,
DialogTrigger,
DialogContent,
DialogHeader,
DialogFooter,
DialogTitle,
DialogDescription,
Dialog as OGDialog,
DialogPortal as OGDialogPortal,
DialogOverlay as OGDialogOverlay,

View file

@ -0,0 +1,25 @@
import * as components from '../index';
/** The canonical `Dialog*` names and the `OG*` names the app imports are one component each, so a
* call site can move to the canonical name without any change in behaviour. */
const PARTS = [
'Dialog',
'DialogPortal',
'DialogOverlay',
'DialogClose',
'DialogTrigger',
'DialogContent',
'DialogHeader',
'DialogFooter',
'DialogTitle',
'DialogDescription',
'DialogTemplate',
] as const;
describe('dialog export names', () => {
it.each(PARTS)('exports %s as the same component as its OG name', (name) => {
const exports = components as Record<string, unknown>;
expect(exports[name]).toBeDefined();
expect(exports[name]).toBe(exports[`OG${name}`]);
});
});

View file

@ -72,7 +72,7 @@ export type {
MinutePickerProps,
TimeColumnProps,
} from './TimePicker';
export { default as OGDialogTemplate } from './OGDialogTemplate';
export { default as OGDialogTemplate, default as DialogTemplate } from './OGDialogTemplate';
export { default as AnimatedSearchInput } from './AnimatedSearchInput';
export { default as VirtualizedDataTable } from './DataTable/DataTable';
export type {