The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
Expose complete Dialog parts (#27606)
Raphaël Bosi3c14b7af990c
diff --git a/packages/twenty-docs/developers/extend/apps/layout/front-components.mdx b/packages/twenty-docs/developers/extend/apps/layout/front-components.mdxindex b14fd17696c..1fd7adba18b 100644--- a/packages/twenty-docs/developers/extend/apps/layout/front-components.mdx+++ b/packages/twenty-docs/developers/extend/apps/layout/front-components.mdx@@ -592,7 +592,7 @@ const routeUrl = `${process.env.TWENTY_FUNCTIONS_URL || `${process.env.TWENTY_AP## Host communication API-Front components can trigger navigation, modals, and notifications using functions from `twenty-sdk`. Use `openCommandConfirmationModal` for confirmation dialogs. It accepts a structured title, subtitle, and confirm-button options and returns a confirm or cancel result. The host owns modal focus, dismissal, and scrolling. Front components cannot render direct `Dialog`, `AlertDialog`, or native browser dialogs, or activate native popovers.+Front components can trigger navigation, modals, and notifications using functions from `twenty-sdk/front-component`:| Function | Description || -------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |@@ -605,6 +605,8 @@ Front components can trigger navigation, modals, and notifications using functio| `updateProgress(progress)` | Update a progress indicator || `uploadFile(file, { fieldMetadataId, fileName? })` | Upload a `Blob` into a FILES field; resolves to `{ status: 'uploaded', file: { fileId, path, url, size, mimeType } }` or `{ status: 'failed', reason: 'invalid-params' \| 'upload-failed' }` |+Use `openCommandConfirmationModal` from `twenty-sdk/front-component` for dialogs. It accepts structured title, subtitle and button options, and resolves to `'confirm'` or `'cancel'`. Twenty owns the modal, focus management, dismissal and page scrolling. Front components must not render `Dialog`, `AlertDialog`, native `dialog` elements or native browser popovers directly. Supplying a local portal container does not make direct app-owned modality supported.+Here is an example that uses the host API to show a snackbar and close the side panel after an action completes:```tsx src/front-components/archive-record.tsx@@ -888,13 +890,15 @@ These entry points do not require `monaco-editor`.| `twenty-ui/primitives/input` | Buttons and form controls || `twenty-ui/primitives/layout` | Expansion, separators, direction, and resizing || `twenty-ui/primitives/navigation` | Action links, list items, and tabs |-| `twenty-ui/primitives/surfaces` | Cards, menus, popovers, and tooltips |+| `twenty-ui/primitives/surfaces` | Cards, menus, nonmodal popovers, and tooltips || `twenty-ui/primitives/typography` | Text and headings || `twenty-ui/icon` | `Icon*` components (e.g. `IconCheck`) || `twenty-ui/theme` | `ThemeProvider`, `themeCssVariables` |Use [`Dropdown`](/ui/components/navigation/dropdown) for action menus, option pickers, and form panels.+The standalone `Dialog` and `AlertDialog` APIs are also exported by Twenty UI, but direct use in front components is prohibited. Use the [host communication API](#host-communication-api) for dialogs.+```tsximport { defineFrontComponent } from 'twenty-sdk/define';import { Button } from 'twenty-ui/primitives/input';diff --git a/packages/twenty-docs/snippets/ui/generated/surfaces/dialog.mdx b/packages/twenty-docs/snippets/ui/generated/surfaces/dialog.mdxindex 8c950637193..bdabd5d9167 100644--- a/packages/twenty-docs/snippets/ui/generated/surfaces/dialog.mdx+++ b/packages/twenty-docs/snippets/ui/generated/surfaces/dialog.mdx@@ -21,8 +21,7 @@</ParamField><ParamField body="Root.children" type="ReactNode | PayloadChildRenderFunction<Payload>">- The content of the dialog.- This can be a regular React node or a render function that receives the `payload` of the active trigger.+ Parts or a render function receiving the active trigger payload. Root renders no DOM node.</ParamField><ParamField body="Root.defaultOpen" type="boolean" default="false">@@ -42,9 +41,7 @@</ParamField><ParamField body="Root.handle" type="DialogHandle<Payload>">- A handle to associate the dialog with a trigger.- If specified, allows external triggers to control the dialog's open state.- Can be created with the Dialog.createHandle() method.+ Connects detached triggers and imperative dialog actions.</ParamField><ParamField body="Root.modal" type="boolean | "trap-focus"" default="true">@@ -58,7 +55,7 @@</ParamField><ParamField body="Root.onOpenChange" type="((open: boolean, eventDetails: DialogRootChangeEventDetails) => void)">- Event handler called when the dialog is opened or closed.+ Receives the requested state and Base UI event details, including reason, event, trigger and cancel().</ParamField><ParamField body="Root.onOpenChangeComplete" type="((open: boolean) => void)">@@ -102,6 +99,10 @@A payload to pass to the dialog when it is opened.</ParamField>+<ParamField body="Trigger.ref" type="((((instance: HTMLButtonElement | null) => void | (() => VoidOrUndefinedOnly)) | RefObject<HTMLButtonElement | null>) & (RefObject<...> | ((instance: HTMLElement | null) => void | (() => VoidOrUndefinedOnly)))) | null">+ Ref to the trigger button, or the element supplied through render.+</ParamField>+<ParamField body="Trigger.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogTriggerState>">Allows you to replace the component's HTML elementwith a different tag, or compose it with another component.@@ -114,54 +115,115 @@returns a style object based on the component's state.</ParamField>-### Dialog.Popup+### Dialog.Portal-<ParamField body="Popup.backdrop" type="boolean | DialogBackdropProps" default="true">- Show the backdrop, customize its native props, or pass `false` to hide it.+<ParamField body="Portal.className" type="string | ((state: DialogPortalState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.</ParamField>-<ParamField body="Popup.className" type="string | ((state: DialogPopupState) => string | undefined)">+<ParamField body="Portal.container" type="HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null">+ Portal destination. Omit to use the nearest theme scope, then the parent portal or document body. Explicit null defers mounting; an element, ShadowRoot or ref keeps Base UI resolution.+</ParamField>++<ParamField body="Portal.keepMounted" type="boolean" default="false">+ Keeps the portal and its content mounted while closed.+</ParamField>++<ParamField body="Portal.ref" type="Ref<HTMLDivElement>">+ Ref to the portal div, or the element supplied through render.+</ParamField>++<ParamField body="Portal.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPortalState>">+ Composes the portal element. Native props and handlers target it.+</ParamField>++<ParamField body="Portal.style" type="CSSProperties | ((state: DialogPortalState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Dialog.Backdrop++<ParamField body="Backdrop.className" type="string | ((state: DialogBackdropState) => string | undefined)">CSS class applied to the element, or a function thatreturns a class based on the component's state.</ParamField>-<ParamField body="Popup.container" type="HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null">- Portal destination. Defaults to the theme container; `null` defers mounting.+<ParamField body="Backdrop.forceRender" type="boolean" default="false">+ Renders the backdrop even when this dialog is nested.</ParamField>-<ParamField body="Popup.finalFocus" type="boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)">- Determines the element to focus when the dialog is closed.+<ParamField body="Backdrop.ref" type="Ref<HTMLDivElement>">+ Ref to the backdrop div, or the element supplied through render.+</ParamField>++<ParamField body="Backdrop.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogBackdropState>">+ Allows you to replace the component's HTML element+ with a different tag, or compose it with another component.- - `false`: Do not move focus.- - `true`: Move focus based on the default behavior (trigger or previously focused element).- - `RefObject`: Move focus to the ref element.- - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).- Return an element to focus, `true` to use the default behavior, `null` to fall back to the default behavior, or `false`/`undefined` to do nothing.+ Accepts a `ReactElement` or a function that returns the element to render.</ParamField>-<ParamField body="Popup.initialFocus" type="boolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | void | HTMLElement | null)">- Determines the element to focus when the dialog is opened.- By default, focus moves to the first tabbable element inside the popup, except when the dialog- is opened by touch — then the popup itself is focused to avoid opening the virtual keyboard.+<ParamField body="Backdrop.style" type="CSSProperties | ((state: DialogBackdropState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Dialog.Viewport++<ParamField body="Viewport.children" type="ReactNode">+ Popup and any other content within the positioning viewport.+</ParamField>- - `false`: Do not move focus.- - `true`: Move focus based on the default behavior (first tabbable element or popup).- - `RefObject`: Move focus to the ref element.- - `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).- Return an element to focus, `true` to use the default behavior, `null` to fall back to the default behavior, or `false`/`undefined` to do nothing.+<ParamField body="Viewport.className" type="string | ((state: DialogViewportState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.</ParamField>-<ParamField body="Popup.keepMounted" type="boolean">- Keeps content mounted while the dialog is closed.+<ParamField body="Viewport.ref" type="Ref<HTMLDivElement>">+ Ref to the viewport div, or the element supplied through render.</ParamField>-<ParamField body="Popup.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPopupState>">+<ParamField body="Viewport.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogViewportState>">Allows you to replace the component's HTML elementwith a different tag, or compose it with another component.Accepts a `ReactElement` or a function that returns the element to render.</ParamField>+<ParamField body="Viewport.style" type="CSSProperties | ((state: DialogViewportState) => CSSProperties | undefined)">+ Style applied to the element, or a function that+ returns a style object based on the component's state.+</ParamField>++### Dialog.Popup++<ParamField body="Popup.children" type="ReactNode">+ Dialog content. Compose inside Viewport and Portal; Popup does not create those parts or a Backdrop.+</ParamField>++<ParamField body="Popup.className" type="string | ((state: DialogPopupState) => string | undefined)">+ CSS class applied to the element, or a function that+ returns a class based on the component's state.+</ParamField>++<ParamField body="Popup.finalFocus" type="boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)">+ Controls focus restoration on closing. Accepts a boolean, element ref or callback receiving the interaction type.+</ParamField>++<ParamField body="Popup.initialFocus" type="boolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | void | HTMLElement | null)">+ Controls focus on opening. Accepts a boolean, element ref or callback receiving the interaction type.+</ParamField>++<ParamField body="Popup.ref" type="Ref<HTMLDivElement>">+ Ref to the popup div, or the element supplied through render.+</ParamField>++<ParamField body="Popup.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPopupState>">+ Composes the popup element while retaining native props, handlers, dialog semantics and focus behavior.+</ParamField>+<ParamField body="Popup.size" type=""compact" | "fullscreen" | "lg" | "md" | "sm" | "xl"" default="md">Width of the dialog, or `fullscreen` to fill the viewport.</ParamField>@@ -171,10 +233,6 @@returns a style object based on the component's state.</ParamField>-<ParamField body="Popup.viewportProps" type="DialogViewportProps">- Native props and render composition for the viewport surrounding the popup.-</ParamField>-### Dialog.Title<ParamField body="Title.className" type="string | ((state: DialogTitleState) => string | undefined)">@@ -213,6 +271,10 @@returns a class based on the component's state.</ParamField>+<ParamField body="Description.ref" type="Ref<HTMLParagraphElement>">+ Ref to the description paragraph, or the element supplied through render.+</ParamField>+<ParamField body="Description.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogDescriptionState>">Allows you to replace the component's HTML elementwith a different tag, or compose it with another component.@@ -238,6 +300,10 @@Set to `false` if the rendered element is not a button (for example, `<div>`).</ParamField>+<ParamField body="Close.ref" type="Ref<HTMLButtonElement>">+ Ref to the close button, or the element supplied through render.+</ParamField>+<ParamField body="Close.render" type="ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogCloseState>">Allows you to replace the component's HTML elementwith a different tag, or compose it with another component.diff --git a/packages/twenty-docs/ui/primitives/overview.mdx b/packages/twenty-docs/ui/primitives/overview.mdxindex eb89e0aa73c..dac78996b7f 100644--- a/packages/twenty-docs/ui/primitives/overview.mdx+++ b/packages/twenty-docs/ui/primitives/overview.mdx@@ -46,7 +46,7 @@ Some primitives package supporting overlay elements inside their `Popup` part:Place content directly inside these popup parts. Their portal may move the rendered DOM to another container while preserving the component hierarchy and context. See [theming](/ui/theming#scope-an-override) for scoped portal containers.-[AlertDialog](/ui/primitives/surfaces/alert-dialog) exposes `Portal`, `Backdrop`, `Viewport`, and `Popup` separately. Configure mounting and the destination on `Portal`, overlay appearance on `Backdrop` and `Viewport`, and content size and focus on `Popup`. Each part preserves its own native attributes, ref target, and render composition.+[Dialog](/ui/primitives/surfaces/dialog) and [AlertDialog](/ui/primitives/surfaces/alert-dialog) expose separate `Portal`, `Backdrop`, `Viewport` and `Popup` parts. Configure mounting and the destination on Portal, overlay appearance on Backdrop and Viewport, and content size and focus on Popup. Each part preserves its own native attributes, ref target and render composition. These dialog APIs are for standalone UI and the Twenty host. Front components use the [SDK host dialog API](/developers/extend/apps/layout/front-components#host-communication-api).### Custom componentsdiff --git a/packages/twenty-docs/ui/primitives/surfaces/dialog.mdx b/packages/twenty-docs/ui/primitives/surfaces/dialog.mdxindex 5286e3ea0f2..48426599d44 100644--- a/packages/twenty-docs/ui/primitives/surfaces/dialog.mdx+++ b/packages/twenty-docs/ui/primitives/surfaces/dialog.mdx@@ -9,6 +9,8 @@ import DialogReference from '/snippets/ui/generated/surfaces/dialog.mdx';Use `Dialog` for forms, details, and other tasks that open above the page. It manages focus, keyboard dismissal, outside clicks, and scrolling. Use [AlertDialog](/ui/primitives/surfaces/alert-dialog) when the user must explicitly respond to a decision.+This API is for standalone Twenty UI and the Twenty host application. Front components must use the SDK's [`openCommandConfirmationModal`](/developers/extend/apps/layout/front-components#host-communication-api) instead of rendering `Dialog` or `AlertDialog` directly. Native browser dialogs and popovers are also prohibited in the front component renderer.+<StoryEmbedstoryId="ui-surfaces-dialog--documentation"title="Dialog example"@@ -20,24 +22,32 @@ Use `Dialog` for forms, details, and other tasks that open above the page. It ma```textDialog.Root├── Dialog.Trigger-└── Dialog.Popup- ├── Dialog.Header- │ ├── Dialog.Title- │ └── Dialog.Description- ├── Dialog.Body- └── Dialog.Footer- └── Dialog.Close+└── Dialog.Portal+ ├── Dialog.Backdrop+ └── Dialog.Viewport+ └── Dialog.Popup+ ├── Dialog.Header+ │ ├── Dialog.Title+ │ └── Dialog.Description+ ├── Dialog.Body+ └── Dialog.Footer+ └── Dialog.Close```-| Part | Requirement | Purpose |-| -------------------------- | ----------- | ------------------------------------------------------------------------------ |-| `Root` | Required | Coordinates visibility and modal behavior. |-| `Trigger` | Optional | Opens the dialog and receives focus when it closes. |-| `Popup` | Required | Contains the dialog and includes its portal, backdrop, and viewport. |-| `Title` | Recommended | Provides the accessible name. Supply `aria-label` on `Popup` when omitting it. |-| `Description` | Optional | Associates supporting text with the dialog. |-| `Header`, `Body`, `Footer` | Optional | Arrange headings, content, and actions. |-| `Close` | Recommended | Provides a visible close action, including for touch screen readers. |+| Part | Native and ref target |+| -------------------------- | ----------------------------------------------------------------------------------------------------------- |+| `Root` | Coordinates visibility and modal behavior. Renders no DOM node and accepts no native attributes or DOM ref. |+| `Trigger` | A button by default. Opens the dialog and supplies a focus restoration target. |+| `Portal` | The portal div. Owns the destination container and whether closed content stays mounted. |+| `Backdrop` | The backdrop div beneath the popup. Optional; omit it when no visible backdrop is needed. |+| `Viewport` | The positioning div around the popup. |+| `Popup` | The dialog div. Owns content, size, focus targets and dialog semantics. |+| `Title` | An `h2` by default. Supplies the accessible name. Supply `aria-label` on `Popup` when omitting it. |+| `Description` | A paragraph by default. Associates supporting text with the dialog. |+| `Header`, `Body`, `Footer` | Optional divs arranging headings, content and actions. |+| `Close` | A button by default. Provides a visible close action, including for touch screen readers. |++Assemble `Portal`, `Backdrop`, `Viewport` and `Popup` explicitly. Each DOM part accepts its own native attributes, handlers, `className`, `style`, ref and `render` composition. A ref targets that part's rendered element. `Popup` does not create a portal, backdrop or viewport.## Uncontrolled state@@ -49,28 +59,31 @@ import { Dialog } from 'twenty-ui/primitives/surfaces';export const AccountDialog = () => (<Dialog.Root defaultOpen={false}>- <Dialog.Trigger- render={<Button>Account details</Button>}- />- <Dialog.Popup>- <Dialog.Header>- <Dialog.Title>Account details</Dialog.Title>- <Dialog.Description>- Review your account information.- </Dialog.Description>- </Dialog.Header>- <Dialog.Body>Acme</Dialog.Body>- <Dialog.Footer>- <Dialog.Close render={<Button>Close</Button>} />- </Dialog.Footer>- </Dialog.Popup>+ <Dialog.Trigger render={<Button>Account details</Button>} />+ <Dialog.Portal>+ <Dialog.Backdrop />+ <Dialog.Viewport>+ <Dialog.Popup>+ <Dialog.Header>+ <Dialog.Title>Account details</Dialog.Title>+ <Dialog.Description>+ Review your account information.+ </Dialog.Description>+ </Dialog.Header>+ <Dialog.Body>Acme</Dialog.Body>+ <Dialog.Footer>+ <Dialog.Close render={<Button>Close</Button>} />+ </Dialog.Footer>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal></Dialog.Root>);```## Controlled state-Pass `open` and `onOpenChange` when the application owns visibility. The callback receives the requested state and event details. Update state to accept a change, or call `eventDetails.cancel()` to reject it.+Pass `open` and `onOpenChange` when the application owns visibility. The callback receives the requested state and Base UI event details, including `reason`, `event`, `trigger` and `cancel()`. Update state to accept a change, or call `eventDetails.cancel()` to reject it. `onOpenChangeComplete` runs when the opening or closing animation finishes.```tsximport { useState } from 'react';@@ -82,21 +95,24 @@ export const AccountDialog = () => {return (<Dialog.Root open={open} onOpenChange={setOpen}>- <Dialog.Trigger- render={<Button>Account details</Button>}- />- <Dialog.Popup>- <Dialog.Header>- <Dialog.Title>Account details</Dialog.Title>- <Dialog.Description>- Review your account information.- </Dialog.Description>- </Dialog.Header>- <Dialog.Body>Acme</Dialog.Body>- <Dialog.Footer>- <Dialog.Close render={<Button>Close</Button>} />- </Dialog.Footer>- </Dialog.Popup>+ <Dialog.Trigger render={<Button>Account details</Button>} />+ <Dialog.Portal>+ <Dialog.Backdrop />+ <Dialog.Viewport>+ <Dialog.Popup>+ <Dialog.Header>+ <Dialog.Title>Account details</Dialog.Title>+ <Dialog.Description>+ Review your account information.+ </Dialog.Description>+ </Dialog.Header>+ <Dialog.Body>Acme</Dialog.Body>+ <Dialog.Footer>+ <Dialog.Close render={<Button>Close</Button>} />+ </Dialog.Footer>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal></Dialog.Root>);};@@ -106,11 +122,21 @@ For an asynchronous form, keep the dialog open while submitting. Close it after## Composition-`Trigger` and `Close` accept `render` to compose with `Button`, as shown above. Custom wrappers must [forward supplied props and refs](/ui/primitives/overview#custom-components). Layout parts also support `render`, native attributes, refs, styles, and class names. `Popup`, `Title`, and `Description` accept state-aware class names and styles.+`Trigger` and `Close` accept `render` to compose with `Button`, as shown above. Custom wrappers must [forward supplied props and refs](/ui/primitives/overview#custom-components). DOM parts preserve Base UI's state-aware class names, styles and callback `render` contracts. `Header`, `Body` and `Footer` retain their styled layout and native div composition.Nest another `Dialog.Root` inside a popup to open a second dialog. Closing the nested dialog returns focus to its trigger in the parent.-To open one dialog from triggers outside `Root`, create a handle once with `Dialog.createHandle()` and pass it to `handle` on both `Root` and each `Trigger`. Trigger `payload` values are available in `Root`'s render function.+To open one dialog from triggers outside `Root`, create a handle once with `Dialog.createHandle<TPayload>()` and pass it to `handle` on both `Root` and each `Trigger`. Trigger `payload` values are available in `Root`'s render function. `Dialog.Handle` and the public `DialogHandle` type expose the installed handle contract:++| Member | Purpose |+| -------------------------- | ----------------------------------------------------- |+| `open(triggerId)` | Opens with a matching trigger as the active trigger. |+| `open(null)` | Opens without associating a trigger. |+| `openWithPayload(payload)` | Opens with a typed payload and no associated trigger. |+| `close()` | Requests closure. |+| `isOpen` | Reads whether the associated dialog is open. |++Imperative actions take effect only while the associated Root is mounted. Root's `actionsRef` also exposes `close()` and `unmount()` for explicit transition control. To control an external closing animation, call `eventDetails.preventUnmountOnClose()` in `onOpenChange`, then call the `unmount()` action when the animation finishes.`Title` uses `Heading` and defaults to an `h2` with large type, primary text color, centered alignment, and spacing-4 below it. Use `level` to change the heading level independently of `size`, or `color` to change its text color. Native `className`, `style`, refs, and `render` are forwarded to the heading. Keep a heading element when using `render`.@@ -124,17 +150,34 @@ To open one dialog from triggers outside `Root`, create a handle once with `Dial| `"trap-focus"` | Trapped inside the dialog | Page scrolling and outside interaction remain available. || `false` | Can leave the dialog | Page scrolling and outside interaction remain available. |-Set `Popup.backdrop={false}` when outside content should remain visible and interactive. Set `Popup.initialFocus` or `Popup.finalFocus` to a ref or callback to choose focus targets; `false` disables that automatic focus move.+Omit `Backdrop` when no visible backdrop is needed. For a nonmodal dialog whose viewport should pass pointer events through to the page, use `<Dialog.Viewport data-backdrop-hidden="true">`; Popup remains interactive. Omitting the visual backdrop alone does not change `Root.modal`.++Set `Popup.initialFocus` or `Popup.finalFocus` to a ref or callback to choose focus targets; `false` disables that automatic focus move. Focus callbacks receive the interaction type and retain Base UI's boolean, element, null and undefined return behavior. Closing normally restores focus to the trigger or previously focused element.`Root.disablePointerDismissal` prevents outside clicks from requesting closure. To prevent Escape dismissal, cancel the `escape-key` change in `onOpenChange`. Always provide a visible way to close a modal dialog.## Sizes and portals-`Popup.size` accepts `sm`, `md`, `lg`, `xl`, and `fullscreen`, and defaults to `md`. Long content scrolls within the popup. Width is constrained to the viewport.+`Popup.size` accepts `sm`, `compact`, `md`, `lg`, `xl`, and `fullscreen`, and defaults to `md`. Long content scrolls within the popup. Width is constrained to the viewport.++Set `Portal.container` to choose a destination:++| Value | Resolution |+| ----------------------- | ------------------------------------------------------------------------------------------------------------------------- |+| Omitted or `undefined` | Uses the nearest scoped theme container. Without one, Base UI uses the parent portal or document body. |+| Element or `ShadowRoot` | Uses that explicit destination instead of the theme scope. |+| Ref | Base UI resolves its current element. A ref whose current value is null falls back to the parent portal or document body. |+| `null` | Waits without mounting. Supply a destination in a later render to mount. |++`Portal.keepMounted` retains content and form state while closed. `Viewport` and `Popup` carry the provided text direction into an external container; their explicit `dir` props take precedence. Without a direction provider or explicit `dir`, they inherit from the destination. See [theming](/ui/theming) and [DirectionProvider](/ui/primitives/layout/direction-provider).++Customize `Backdrop` and `Viewport` through their own props. Their native attributes, handlers, refs and `render` apply to those elements independently of Popup. Backdrop's `forceRender` keeps a nested dialog's backdrop visible when needed. Base UI open and transition state remains available to state-aware styles and render callbacks.++## Migration-Portals use the nearest theme container by default and preserve text direction. Set `container` to an element or ref to choose another destination; `null` defers mounting until a destination is available. `keepMounted` retains content and form state while closed.+Wrap existing `Dialog.Popup` content in `Dialog.Portal` and `Dialog.Viewport`, and add a sibling `Dialog.Backdrop` inside Portal. Move `container` and `keepMounted` from Popup to Portal. Move former `backdrop` props onto Backdrop; replace `backdrop={false}` by omitting Backdrop. Move `viewportProps` onto Viewport, retaining `data-backdrop-hidden="true"` when the viewport must pass outside pointer events through. Keep `size`, `initialFocus`, `finalFocus`, native popup attributes and popup refs on Popup. The fused Popup assembly props are removed.-Use `backdrop` props to customize the backdrop, and `viewportProps` for native attributes, styles, or `render` composition on the surrounding viewport. These props let application layout containers host a dialog while keeping the popup's semantics.+Root, Trigger, Close, Title, Description, Header, Body, Footer and existing handles retain their roles. Public part props, state, actions and event-detail types are exported from `twenty-ui/primitives/surfaces`.## Propsdiff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.mdindex ebc6b869522..1e065f6a1e6 100644--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/README.md@@ -43,7 +43,7 @@ effect within the interaction timeout.| `twenty-ui-phone-country-picker` | PhoneCountryPicker || `twenty-ui-currency-picker` | CurrencyPicker || `twenty-ui-popover` | Popover |-| `twenty-ui-dialog` | Dialog |+| `twenty-ui-dialog` | SDK `openCommandConfirmationModal` confirmation request || `twenty-ui-menu` | Menu || `twenty-ui-select` | Select || `twenty-ui-dropdown` | Dropdown |@@ -82,10 +82,12 @@ outside this scope.## Dialog policy-Direct `AlertDialog` modality is prohibited inside the front component renderer. Its standalone Twenty UI API has dedicated unit and browser stories in `twenty-ui`. Front components request a host-owned confirmation through the SDK `openCommandConfirmationModal` API, which accepts structured title, subtitle, and confirm-button options and returns confirm or cancel. Renderer policy and SDK result, focus restoration, and teardown acceptance remain part of the renderer integration work. No direct AlertDialog gallery fixture is retained as a compatibility target.+Direct app-owned `Dialog`/`AlertDialog` modality and native browser dialog/popover activation are prohibited in front components. Their standalone Twenty UI APIs have dedicated unit and browser stories. Front components use SDK `openCommandConfirmationModal`, whose structured title, subtitle and confirm-button options are rendered by the host. The Dialog fixture checks the confirmation request. Result handling and actual host modal focus, restoration, dismissal and teardown acceptance remain part of the renderer integration work. No direct Dialog or AlertDialog gallery fixture is retained as a compatibility target.## Known sandbox limitations+An invisible popup is not a compatibility pass.+These are compatibility regression stories, not assertions that the componentswork fully in the sandbox. Scenarios pin the current behavior exactly: ascenario that reaches a gap asserts what the component reports, and one that@@ -94,12 +96,12 @@ must change the corresponding story to assert successful behavior; do not keepor broaden an obsolete expectation. No stories are skipped or marked asexpected-to-fail by the runner.-| Component | Current limitation |-| --------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |-| ImageInput | Native file picker activation and usable file contents are unavailable in the sandbox. The fixture checks forwarded file metadata, preview recovery, action callbacks, and supplied error changes. See the [ImageInput documentation](../../../../twenty-docs/ui/components/input/image-input.mdx). |-| Popover, Dialog, Menu, Select, Dropdown, CurrencyPicker, PhoneCountryPicker, CountrySelect, Autocomplete (React and Preact) | The trigger opens the overlay, but the popup portals into the sandbox `document.body`, which never reaches the host, so its content stays invisible. Search, selection, dismissal and focus restoration are not covered yet. |-| Slider | Thumbs stay hidden because the sandbox has no `ResizeObserver` to re-measure after the first geometry batch. |-| Responsive hooks | The sandbox `window.matchMedia` answers for the widget's own box, so `useIsMobile` follows the widget width rather than the browser viewport: a widget 768px wide or narrower gets the mobile layout, and Button drops its hotkey hint, on any screen. `useIsTouchDevice` follows the primary input of the host device, so it is `false` under the desktop Chromium that runs these stories. The fixture asserts both at a 1024px and a 400px widget width. |+| Component | Current limitation |+| ------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |+| ImageInput | Native file picker activation and usable file contents are unavailable in the sandbox. The fixture checks forwarded file metadata, preview recovery, action callbacks, and supplied error changes. See the [ImageInput documentation](../../../../twenty-docs/ui/components/input/image-input.mdx). |+| Popover, Menu, Select, Dropdown, CurrencyPicker, PhoneCountryPicker, CountrySelect, Autocomplete (React and Preact) | The trigger opens the overlay, but the popup portals into the sandbox `document.body`, which never reaches the host, so its content stays invisible. Search, selection, dismissal and focus restoration are not covered yet. |+| Slider | Thumbs stay hidden because the sandbox has no `ResizeObserver` to re-measure after the first geometry batch. |+| Responsive hooks | The sandbox `window.matchMedia` answers for the widget's own box, so `useIsMobile` follows the widget width rather than the browser viewport: a widget 768px wide or narrower gets the mobile layout, and Button drops its hotkey hint, on any screen. `useIsTouchDevice` follows the primary input of the host device, so it is `false` under the desktop Chromium that runs these stories. The fixture asserts both at a 1024px and a 400px widget width. |The worker DOM now provides `Node.contains`, `compareDocumentPosition`,`getRootNode`, `Element.matches`, `closest`, `querySelector` backed bydiff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-dialog.front-component.tsx b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-dialog.front-component.tsxindex a7276ff7bcb..527259d035f 100644--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-dialog.front-component.tsx+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/twenty-ui-dialog.front-component.tsx@@ -1,30 +1,34 @@import { useState } from 'react';import { defineFrontComponent } from 'twenty-sdk/define';+import { openCommandConfirmationModal } from 'twenty-sdk/front-component';import { Button } from 'twenty-ui/primitives/input';-import { Dialog } from 'twenty-ui/primitives/surfaces';import { Text } from 'twenty-ui/primitives/typography';import { TwentyUiGalleryCard } from '@/__stories__/shared/front-components/twenty-ui-gallery-card';const DialogExample = () => {- const [open, setOpen] = useState(false);+ const [status, setStatus] = useState('idle');++ const handleRequestConfirmation = async () => {+ setStatus('requested');+ const result = await openCommandConfirmationModal({+ title: 'Update account',+ subtitle: 'Confirm the account changes.',+ confirmButtonText: 'Update',+ });+ setStatus(result);+ };return (- <TwentyUiGalleryCard title="Dialog">- <Dialog.Root open={open} onOpenChange={setOpen}>- <Dialog.Trigger render={<Button>Edit account</Button>} />- <Dialog.Popup>- <Dialog.Header>- <Dialog.Title>Edit account</Dialog.Title>- <Dialog.Description>Update the account details.</Dialog.Description>- </Dialog.Header>- <Dialog.Body>Account details</Dialog.Body>- <Dialog.Footer>- <Dialog.Close render={<Button>Close</Button>} />- </Dialog.Footer>- </Dialog.Popup>- </Dialog.Root>- <Text role="status">Dialog: {open ? 'open' : 'closed'}</Text>+ <TwentyUiGalleryCard title="Host dialog">+ <Text>Front components request dialogs through the SDK host API.</Text>+ <Button+ onClick={handleRequestConfirmation}+ disabled={status === 'requested'}+ >+ Update account+ </Button>+ <Text role="status">Confirmation: {status}</Text></TwentyUiGalleryCard>);};@@ -32,6 +36,6 @@ const DialogExample = () => {export default defineFrontComponent({universalIdentifier: 'test-20ui0-0000-0000-0000-000000000111',name: 'twenty-ui-dialog',- description: 'Dialog opening and closing through a sandbox portal',+ description: 'Requests a host-owned confirmation through the SDK dialog API',component: DialogExample,});diff --git a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/dialogTest.ts b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/dialogTest.tsindex 14c1a2fd914..170efa9c35f 100644--- a/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/dialogTest.ts+++ b/packages/twenty-front-component-renderer/src/__stories__/twenty-ui-gallery/utils/dialogTest.ts@@ -1,7 +1,29 @@-import { createOverlayOpenTest } from '@/__stories__/twenty-ui-gallery/utils/createOverlayOpenTest';+import { expect, userEvent, waitFor, within } from 'storybook/test';-export const dialogTest = createOverlayOpenTest({- trigger: { role: 'button', name: 'Edit account' },- expectedOpenStatus: 'Dialog: open',- popupText: 'Update the account details.',-});+import {+ errorHandler,+ hostApiMocks,+} from '@/__stories__/shared/test-utils/createFrontComponentStoryMeta';+import { expectFrontComponentMounted } from '@/__stories__/shared/test-utils/matchers/expectFrontComponentMounted';+import { type TwentyUiGalleryPlayFunction } from '@/__stories__/twenty-ui-gallery/types/TwentyUiGalleryPlayFunction';++export const dialogTest: TwentyUiGalleryPlayFunction = async ({+ canvasElement,+}) => {+ const canvas = within(canvasElement);+ await expectFrontComponentMounted(canvas);+ await userEvent.click(canvas.getByRole('button', { name: 'Update account' }));++ await waitFor(() =>+ expect(hostApiMocks.openCommandConfirmationModal).toHaveBeenCalledWith({+ title: 'Update account',+ subtitle: 'Confirm the account changes.',+ confirmButtonText: 'Update',+ }),+ );+ expect(hostApiMocks.openCommandConfirmationModal).toHaveBeenCalledTimes(1);+ expect(canvas.getByRole('status')).toHaveTextContent(+ 'Confirmation: requested',+ );+ expect(errorHandler).not.toHaveBeenCalled();+};diff --git a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsxindex e1bfb90aad5..88107aa39ee 100644--- a/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx+++ b/packages/twenty-front/src/modules/activities/files/components/AttachmentList.tsx@@ -179,10 +179,10 @@ export const AttachmentList = ({onClose={handleClosePreview}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popuparia-label={previewedAttachment.name}- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="lg"style={{padding: 'var(--t-spacing-2)',diff --git a/packages/twenty-front/src/modules/front-components/media-session/components/FrontComponentMediaPermissionModal.tsx b/packages/twenty-front/src/modules/front-components/media-session/components/FrontComponentMediaPermissionModal.tsxindex 23fd91aa6d5..3a44a7c211a 100644--- a/packages/twenty-front/src/modules/front-components/media-session/components/FrontComponentMediaPermissionModal.tsx+++ b/packages/twenty-front/src/modules/front-components/media-session/components/FrontComponentMediaPermissionModal.tsx@@ -89,11 +89,8 @@ export const FrontComponentMediaPermissionModal = ({onClose={handleClose}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (- <Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}- size="sm"- >+ {({ onKeyDown }) => (+ <Dialog.Popup onKeyDown={onKeyDown} size="sm"><StyledContent><Dialog.Title>{t`Allow media access for ${applicationName}?`}</Dialog.Title>{buildApplicationCapabilitySummary(request.capabilities).map(diff --git a/packages/twenty-front/src/modules/marketplace/components/SettingsApplicationInstallPermissionValidationModal.tsx b/packages/twenty-front/src/modules/marketplace/components/SettingsApplicationInstallPermissionValidationModal.tsxindex 9b1723c6be8..0ff5b2d930f 100644--- a/packages/twenty-front/src/modules/marketplace/components/SettingsApplicationInstallPermissionValidationModal.tsx+++ b/packages/twenty-front/src/modules/marketplace/components/SettingsApplicationInstallPermissionValidationModal.tsx@@ -128,10 +128,10 @@ export const SettingsApplicationInstallPermissionValidationModal = ({dismissibleonClose={handleClose}>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popuparia-label={t`Install ${appDisplayName} on your workspace`}- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="fullscreen"style={{ padding: 0, background: 'transparent', boxShadow: 'none' }}>diff --git a/packages/twenty-front/src/modules/onboarding/components/OnboardingSkipDialog.tsx b/packages/twenty-front/src/modules/onboarding/components/OnboardingSkipDialog.tsxindex d00c7a10008..995aa078be4 100644--- a/packages/twenty-front/src/modules/onboarding/components/OnboardingSkipDialog.tsx+++ b/packages/twenty-front/src/modules/onboarding/components/OnboardingSkipDialog.tsx@@ -58,9 +58,9 @@ export const OnboardingSkipDialog = ({return (<DialogInstance dialogId={dialogId} dismissible renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="compact"initialFocus={firstActionRef}finalFocus={finalFocus}diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsxindex e19f51dbd80..dcd8cad0aa0 100644--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceCreditGrantModal.tsx@@ -138,9 +138,9 @@ export const SettingsAdminWorkspaceCreditGrantModal = ({onClose={handleClose}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="md"data-globally-prevent-click-outsidestyle={{diff --git a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceUsageLimitModal.tsx b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceUsageLimitModal.tsxindex 7c4412e1352..368f77fc603 100644--- a/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceUsageLimitModal.tsx+++ b/packages/twenty-front/src/modules/settings/admin-panel/components/SettingsAdminWorkspaceUsageLimitModal.tsx@@ -198,9 +198,9 @@ export const SettingsAdminWorkspaceUsageLimitModal = ({onClose={handleClose}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="md"data-globally-prevent-click-outsidestyle={{diff --git a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotLightbox.tsx b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotLightbox.tsxindex 5528db83cf4..db240d307a8 100644--- a/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotLightbox.tsx+++ b/packages/twenty-front/src/modules/settings/applications/components/SettingsApplicationScreenshotLightbox.tsx@@ -105,10 +105,10 @@ export const SettingsApplicationScreenshotLightbox = ({onClose={onClose}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popuparia-label={displayName}- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="fullscreen"style={{ padding: 0, background: 'transparent', boxShadow: 'none' }}>diff --git a/packages/twenty-front/src/modules/settings/billing/components/AddCreditCardModal.tsx b/packages/twenty-front/src/modules/settings/billing/components/AddCreditCardModal.tsxindex 2d6a01c1b5f..9fd67fef78d 100644--- a/packages/twenty-front/src/modules/settings/billing/components/AddCreditCardModal.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/AddCreditCardModal.tsx@@ -42,9 +42,9 @@ export const AddCreditCardModal = ({dismissible={true}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="md"data-globally-prevent-click-outsidestyle={{diff --git a/packages/twenty-front/src/modules/settings/billing/components/UpdatePaymentMethodModal.tsx b/packages/twenty-front/src/modules/settings/billing/components/UpdatePaymentMethodModal.tsxindex 1558cef657d..86acbf6dc9d 100644--- a/packages/twenty-front/src/modules/settings/billing/components/UpdatePaymentMethodModal.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/UpdatePaymentMethodModal.tsx@@ -56,9 +56,9 @@ export const UpdatePaymentMethodModal = ({return (<DialogInstance dialogId={modalInstanceId} dismissible renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="md"data-globally-prevent-click-outsidestyle={{diff --git a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsxindex a858df05281..6600c698d0a 100644--- a/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx+++ b/packages/twenty-front/src/modules/settings/billing/components/internal/ResourceCreditPackagePickerModal.tsx@@ -255,9 +255,9 @@ export const ResourceCreditPackagePickerModal = ({dismissible={true}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="md"data-globally-prevent-click-outsidestyle={{diff --git a/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx b/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsxindex 85a5ce3eb85..55708df6b48 100644--- a/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx+++ b/packages/twenty-front/src/modules/settings/components/SettingsCustomizeVideoModal.tsx@@ -123,10 +123,10 @@ export const SettingsCustomizeVideoModal = ({onClose={handleClose}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popuparia-label={activeTab.title}- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="lg"style={{ padding: 0 }}>diff --git a/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx b/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsxindex a0151582d27..1a87f174f1f 100644--- a/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx+++ b/packages/twenty-front/src/modules/settings/enterprise/components/EnterprisePlanModal.tsx@@ -154,10 +154,10 @@ export const EnterprisePlanModal = () => {return (<DialogInstance dialogId={ENTERPRISE_PLAN_MODAL_ID} dismissible>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popuparia-label={t`Get Organization`}- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="md"style={{ padding: 0 }}>diff --git a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalWrapper.tsx b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalWrapper.tsxindex 24ad3525a41..4e7d8cf6d85 100644--- a/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalWrapper.tsx+++ b/packages/twenty-front/src/modules/spreadsheet-import/components/SpreadSheetImportModalWrapper.tsx@@ -49,10 +49,10 @@ export const SpreadSheetImportModalWrapper = ({onClose={onClose}closeOnDismiss={false}>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popuparia-label={t`Import data`}- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="xl"style={{ padding: 0, height: 'var(--t-modal-size-xl-height)' }}>diff --git a/packages/twenty-front/src/modules/ui/field/display/components/GlobalFilePreviewModal.tsx b/packages/twenty-front/src/modules/ui/field/display/components/GlobalFilePreviewModal.tsxindex eac61f79f9e..c7e9358dfaa 100644--- a/packages/twenty-front/src/modules/ui/field/display/components/GlobalFilePreviewModal.tsx+++ b/packages/twenty-front/src/modules/ui/field/display/components/GlobalFilePreviewModal.tsx@@ -104,10 +104,10 @@ export const GlobalFilePreviewModal = (): JSX.Element | null => {onClose={handleClose}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popuparia-label={filePreview.label ?? t`File preview`}- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}size="lg"style={{ padding: 'var(--t-spacing-4)' }}>diff --git a/packages/twenty-front/src/modules/ui/layout/dialog/components/ConfirmationDialog.tsx b/packages/twenty-front/src/modules/ui/layout/dialog/components/ConfirmationDialog.tsxindex b855de346c9..37df3411aab 100644--- a/packages/twenty-front/src/modules/ui/layout/dialog/components/ConfirmationDialog.tsx+++ b/packages/twenty-front/src/modules/ui/layout/dialog/components/ConfirmationDialog.tsx@@ -90,9 +90,9 @@ export const ConfirmationDialog = ({onEnter={handleEnter}renderInDocumentBody>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}data-globally-prevent-click-outsidestyle={{padding: 'var(--t-spacing-6)',diff --git a/packages/twenty-front/src/modules/ui/layout/dialog/components/DialogInstance.tsx b/packages/twenty-front/src/modules/ui/layout/dialog/components/DialogInstance.tsxindex 4f38858e7e7..86423e2856f 100644--- a/packages/twenty-front/src/modules/ui/layout/dialog/components/DialogInstance.tsx+++ b/packages/twenty-front/src/modules/ui/layout/dialog/components/DialogInstance.tsx@@ -18,7 +18,7 @@ import { useAtomComponentStateValue } from '@/ui/utilities/state/jotai/hooks/usetype DialogInstanceProps = {dialogId: string;- children: (popupProps: DialogPopupProps) => ReactNode;+ children: (popupProps: Pick<DialogPopupProps, 'onKeyDown'>) => ReactNode;onEnter?: () => void;onClose?: () => void;dismissible?: boolean;@@ -54,27 +54,7 @@ export const DialogInstance = ({const { openDialog, closeDialog } = useDialog();const position = isInContainer ? 'absolute' : 'fixed';- const popupProps: DialogPopupProps = {- container: renderInDocumentBody ? document.body : (container ?? undefined),- backdrop: {- style: {- position,- zIndex: RootStackingContextZIndices.RootModalBackDrop,- background: isInContainer- ? 'var(--t-background-overlay-tertiary)'- : undefined,- },- },- viewportProps: {- render: (- <div- data-testid="dialog-viewport"- data-click-outside-id={DIALOG_BACKDROP_CLICK_OUTSIDE_ID}- />- ),- style: { position, zIndex: RootStackingContextZIndices.RootModal },- onMouseDown: (event) => event.stopPropagation(),- },+ const popupProps: Pick<DialogPopupProps, 'onKeyDown'> = {onKeyDown: (event) => {const isNestedFocus = store.get(currentFocusIdSelector.atom) !== dialogId;if (@@ -137,7 +117,32 @@ export const DialogInstance = ({{isDialogOpened && isDefined(onEnter) && (<DialogEnterHotkeyEffect dialogId={dialogId} onEnter={onEnter} />)}- {children(popupProps)}+ <Dialog.Portal+ container={+ renderInDocumentBody ? document.body : (container ?? undefined)+ }+ >+ <Dialog.Backdrop+ style={{+ position,+ zIndex: RootStackingContextZIndices.RootModalBackDrop,+ background: isInContainer+ ? 'var(--t-background-overlay-tertiary)'+ : undefined,+ }}+ />+ <Dialog.Viewport+ data-testid="dialog-viewport"+ data-click-outside-id={DIALOG_BACKDROP_CLICK_OUTSIDE_ID}+ style={{+ position,+ zIndex: RootStackingContextZIndices.RootModal,+ }}+ onMouseDown={(event) => event.stopPropagation()}+ >+ {children(popupProps)}+ </Dialog.Viewport>+ </Dialog.Portal></Dialog.Root></ClickOutsideListenerContext.Provider></DialogComponentInstanceContext.Provider>diff --git a/packages/twenty-front/src/modules/ui/layout/dialog/components/__stories__/DialogInstance.stories.tsx b/packages/twenty-front/src/modules/ui/layout/dialog/components/__stories__/DialogInstance.stories.tsxindex 23d161392bc..bd2d75b426d 100644--- a/packages/twenty-front/src/modules/ui/layout/dialog/components/__stories__/DialogInstance.stories.tsx+++ b/packages/twenty-front/src/modules/ui/layout/dialog/components/__stories__/DialogInstance.stories.tsx@@ -26,8 +26,8 @@ const DialogInstanceExample = (props: DialogInstanceExampleProps) => {<><Button onClick={() => openDialog(DIALOG_ID)}>Open dialog</Button><DialogInstance {...props} dialogId={DIALOG_ID}>- {({ container, backdrop, viewportProps, onKeyDown }) => (- <Dialog.Popup {...{ container, backdrop, viewportProps, onKeyDown }}>+ {({ onKeyDown }) => (+ <Dialog.Popup onKeyDown={onKeyDown}><Dialog.Header><Dialog.Title>Workspace preferences</Dialog.Title><Dialog.Description>Choose a preference.</Dialog.Description>diff --git a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDangerZone.tsx b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDangerZone.tsxindex cd33452a76b..2cfd6697b58 100644--- a/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDangerZone.tsx+++ b/packages/twenty-front/src/pages/settings/admin-panel/SettingsAdminApplicationRegistrationDangerZone.tsx@@ -278,9 +278,9 @@ export const SettingsAdminApplicationRegistrationDangerZone = ({dismissibleonClose={() => setTransferSubdomain('')}>- {({ container, backdrop, viewportProps, onKeyDown }) => (+ {({ onKeyDown }) => (<Dialog.Popup- {...{ container, backdrop, viewportProps, onKeyDown }}+ onKeyDown={onKeyDown}data-globally-prevent-click-outsidestyle={{padding: 'var(--t-spacing-6)',diff --git a/packages/twenty-ui/docs/components.ts b/packages/twenty-ui/docs/components.tsindex 9df27b8c454..a3476694dbb 100644--- a/packages/twenty-ui/docs/components.ts+++ b/packages/twenty-ui/docs/components.ts@@ -48,6 +48,7 @@ import { CODE_EDITOR_PROP_DESCRIPTIONS } from './codeEditorPropDescriptions';import { COLOR_SAMPLE_PROP_DESCRIPTIONS } from './colorSamplePropDescriptions';import { ALERT_DIALOG_PART_PROP_DESCRIPTIONS } from './alertDialogPartPropDescriptions';import { DIALOG_POPUP_PROP_DESCRIPTIONS } from './dialogPopupPropDescriptions';+import { DIALOG_PORTAL_PROP_DESCRIPTIONS } from './dialogPortalPropDescriptions';import { DIALOG_TITLE_PROP_DESCRIPTIONS } from './dialogTitlePropDescriptions';import { DROPDOWN_PART_PROP_DESCRIPTIONS } from './dropdownPartPropDescriptions';import { TEXT_PROP_DESCRIPTIONS } from './textPropDescriptions';@@ -421,9 +422,49 @@ export const DOCUMENTED_COMPONENTS = [source: 'primitives/surfaces/Dialog/Dialog.tsx',entryPoint: 'twenty-ui/primitives/surfaces',slug: 'surfaces/dialog',+ parts: [+ 'Root',+ 'Trigger',+ 'Portal',+ 'Backdrop',+ 'Viewport',+ 'Popup',+ 'Title',+ 'Description',+ 'Close',+ 'Header',+ 'Body',+ 'Footer',+ ],partPropDescriptions: {+ Root: {+ children:+ 'Parts or a render function receiving the active trigger payload. Root renders no DOM node.',+ handle: 'Connects detached triggers and imperative dialog actions.',+ onOpenChange:+ 'Receives the requested state and Base UI event details, including reason, event, trigger and cancel().',+ },+ Trigger: {+ ref: 'Ref to the trigger button, or the element supplied through render.',+ },+ Portal: DIALOG_PORTAL_PROP_DESCRIPTIONS,+ Backdrop: {+ ref: 'Ref to the backdrop div, or the element supplied through render.',+ forceRender: 'Renders the backdrop even when this dialog is nested.',+ },+ Viewport: {+ ref: 'Ref to the viewport div, or the element supplied through render.',+ children:+ 'Popup and any other content within the positioning viewport.',+ },Popup: DIALOG_POPUP_PROP_DESCRIPTIONS,Title: DIALOG_TITLE_PROP_DESCRIPTIONS,+ Description: {+ ref: 'Ref to the description paragraph, or the element supplied through render.',+ },+ Close: {+ ref: 'Ref to the close button, or the element supplied through render.',+ },},},{diff --git a/packages/twenty-ui/docs/dialogPopupPropDescriptions.ts b/packages/twenty-ui/docs/dialogPopupPropDescriptions.tsindex 0040f33b1b0..14960c0cafb 100644--- a/packages/twenty-ui/docs/dialogPopupPropDescriptions.ts+++ b/packages/twenty-ui/docs/dialogPopupPropDescriptions.ts@@ -2,11 +2,13 @@ import { type DialogPopupProps } from '../src/primitives/surfaces/Dialog/types/Dexport const DIALOG_POPUP_PROP_DESCRIPTIONS = {size: 'Width of the dialog, or `fullscreen` to fill the viewport.',- container:- 'Portal destination. Defaults to the theme container; `null` defers mounting.',- keepMounted: 'Keeps content mounted while the dialog is closed.',- backdrop:- 'Show the backdrop, customize its native props, or pass `false` to hide it.',- viewportProps:- 'Native props and render composition for the viewport surrounding the popup.',+ children:+ 'Dialog content. Compose inside Viewport and Portal; Popup does not create those parts or a Backdrop.',+ ref: 'Ref to the popup div, or the element supplied through render.',+ render:+ 'Composes the popup element while retaining native props, handlers, dialog semantics and focus behavior.',+ initialFocus:+ 'Controls focus on opening. Accepts a boolean, element ref or callback receiving the interaction type.',+ finalFocus:+ 'Controls focus restoration on closing. Accepts a boolean, element ref or callback receiving the interaction type.',} satisfies Partial<Record<keyof DialogPopupProps, string>>;diff --git a/packages/twenty-ui/docs/dialogPortalPropDescriptions.ts b/packages/twenty-ui/docs/dialogPortalPropDescriptions.tsnew file mode 100644index 00000000000..83728d180c4--- /dev/null+++ b/packages/twenty-ui/docs/dialogPortalPropDescriptions.ts@@ -0,0 +1,9 @@+import { type DialogPortalProps } from '../src/primitives/surfaces/Dialog/types/DialogPortalProps';++export const DIALOG_PORTAL_PROP_DESCRIPTIONS = {+ container:+ 'Portal destination. Omit to use the nearest theme scope, then the parent portal or document body. Explicit null defers mounting; an element, ShadowRoot or ref keeps Base UI resolution.',+ keepMounted: 'Keeps the portal and its content mounted while closed.',+ ref: 'Ref to the portal div, or the element supplied through render.',+ render: 'Composes the portal element. Native props and handlers target it.',+} satisfies Partial<Record<keyof DialogPortalProps, string>>;diff --git a/packages/twenty-ui/docs/public-exports.json b/packages/twenty-ui/docs/public-exports.jsonindex cee5f65fdda..762ceb0d2d0 100644--- a/packages/twenty-ui/docs/public-exports.json+++ b/packages/twenty-ui/docs/public-exports.json@@ -918,16 +918,32 @@"AlertDialogTriggerState": "primitives/surfaces/AlertDialog/types/AlertDialogTriggerState","AlertDialogViewportProps": "primitives/surfaces/AlertDialog/types/AlertDialogViewportProps","AlertDialogViewportState": "primitives/surfaces/AlertDialog/types/AlertDialogViewportState",+ "DialogBackdropProps": "primitives/surfaces/Dialog/types/DialogBackdropProps",+ "DialogBackdropState": "primitives/surfaces/Dialog/types/DialogBackdropState","DialogBodyProps": "primitives/surfaces/Dialog/types/DialogBodyProps","DialogCloseProps": "primitives/surfaces/Dialog/types/DialogCloseProps",+ "DialogCloseState": "primitives/surfaces/Dialog/types/DialogCloseState","DialogDescriptionProps": "primitives/surfaces/Dialog/types/DialogDescriptionProps",+ "DialogDescriptionState": "primitives/surfaces/Dialog/types/DialogDescriptionState","DialogFooterProps": "primitives/surfaces/Dialog/types/DialogFooterProps",+ "DialogHandle": "primitives/surfaces/Dialog/types/DialogHandle","DialogHeaderProps": "primitives/surfaces/Dialog/types/DialogHeaderProps","DialogPopupProps": "primitives/surfaces/Dialog/types/DialogPopupProps",+ "DialogPopupState": "primitives/surfaces/Dialog/types/DialogPopupState",+ "DialogPortalProps": "primitives/surfaces/Dialog/types/DialogPortalProps",+ "DialogPortalState": "primitives/surfaces/Dialog/types/DialogPortalState",+ "DialogRootActions": "primitives/surfaces/Dialog/types/DialogRootActions",+ "DialogRootChangeEventDetails": "primitives/surfaces/Dialog/types/DialogRootChangeEventDetails",+ "DialogRootChangeEventReason": "primitives/surfaces/Dialog/types/DialogRootChangeEventReason","DialogRootProps": "primitives/surfaces/Dialog/types/DialogRootProps",+ "DialogRootState": "primitives/surfaces/Dialog/types/DialogRootState","DialogSize": "primitives/surfaces/Dialog/types/DialogSize","DialogTitleProps": "primitives/surfaces/Dialog/types/DialogTitleProps",+ "DialogTitleState": "primitives/surfaces/Dialog/types/DialogTitleState","DialogTriggerProps": "primitives/surfaces/Dialog/types/DialogTriggerProps",+ "DialogTriggerState": "primitives/surfaces/Dialog/types/DialogTriggerState",+ "DialogViewportProps": "primitives/surfaces/Dialog/types/DialogViewportProps",+ "DialogViewportState": "primitives/surfaces/Dialog/types/DialogViewportState","MenuActionItemProps": "primitives/surfaces/Menu/types/MenuActionItemProps","MenuAlign": "primitives/surfaces/Menu/types/MenuAlign","MenuCheckboxItemProps": "primitives/surfaces/Menu/types/MenuCheckboxItemProps",diff --git a/packages/twenty-ui/generated/components.docs.json b/packages/twenty-ui/generated/components.docs.jsonindex 89ec41df6e8..2534d9101d7 100644--- a/packages/twenty-ui/generated/components.docs.json+++ b/packages/twenty-ui/generated/components.docs.json@@ -5215,7 +5215,7 @@"type": "ReactNode | PayloadChildRenderFunction<Payload>","required": false,"defaultValue": null,- "description": "The content of the dialog.\nThis can be a regular React node or a render function that receives the `payload` of the active trigger."+ "description": "Parts or a render function receiving the active trigger payload. Root renders no DOM node."},{"name": "defaultOpen",@@ -5243,7 +5243,7 @@"type": "DialogHandle<Payload>","required": false,"defaultValue": null,- "description": "A handle to associate the dialog with a trigger.\nIf specified, allows external triggers to control the dialog's open state.\nCan be created with the Dialog.createHandle() method."+ "description": "Connects detached triggers and imperative dialog actions."},{"name": "modal",@@ -5257,7 +5257,7 @@"type": "((open: boolean, eventDetails: DialogRootChangeEventDetails) => void)","required": false,"defaultValue": null,- "description": "Event handler called when the dialog is opened or closed."+ "description": "Receives the requested state and Base UI event details, including reason, event, trigger and cancel()."},{"name": "onOpenChangeComplete",@@ -5320,6 +5320,13 @@"defaultValue": null,"description": "A payload to pass to the dialog when it is opened."},+ {+ "name": "ref",+ "type": "((((instance: HTMLButtonElement | null) => void | (() => VoidOrUndefinedOnly)) | RefObject<HTMLButtonElement | null>) & (RefObject<...> | ((instance: HTMLElement | null) => void | (() => VoidOrUndefinedOnly)))) | null",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the trigger button, or the element supplied through render."+ },{"name": "render","type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogTriggerState>",@@ -5337,56 +5344,176 @@]},{- "name": "Popup",+ "name": "Portal","props": [{- "name": "backdrop",- "type": "boolean | DialogBackdropProps",+ "name": "className",+ "type": "string | ((state: DialogPortalState) => string | undefined)","required": false,- "defaultValue": "true",- "description": "Show the backdrop, customize its native props, or pass `false` to hide it."+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "container",+ "type": "HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null",+ "required": false,+ "defaultValue": null,+ "description": "Portal destination. Omit to use the nearest theme scope, then the parent portal or document body. Explicit null defers mounting; an element, ShadowRoot or ref keeps Base UI resolution."+ },+ {+ "name": "keepMounted",+ "type": "boolean",+ "required": false,+ "defaultValue": "false",+ "description": "Keeps the portal and its content mounted while closed."+ },+ {+ "name": "ref",+ "type": "Ref<HTMLDivElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the portal div, or the element supplied through render."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPortalState>",+ "required": false,+ "defaultValue": null,+ "description": "Composes the portal element. Native props and handlers target it."},+ {+ "name": "style",+ "type": "CSSProperties | ((state: DialogPortalState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Backdrop",+ "props": [{"name": "className",- "type": "string | ((state: DialogPopupState) => string | undefined)",+ "type": "string | ((state: DialogBackdropState) => string | undefined)","required": false,"defaultValue": null,"description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."},{- "name": "container",- "type": "HTMLElement | ShadowRoot | RefObject<HTMLElement | ShadowRoot | null> | null",+ "name": "forceRender",+ "type": "boolean",+ "required": false,+ "defaultValue": "false",+ "description": "Renders the backdrop even when this dialog is nested."+ },+ {+ "name": "ref",+ "type": "Ref<HTMLDivElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the backdrop div, or the element supplied through render."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogBackdropState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: DialogBackdropState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Viewport",+ "props": [+ {+ "name": "children",+ "type": "ReactNode",+ "required": false,+ "defaultValue": null,+ "description": "Popup and any other content within the positioning viewport."+ },+ {+ "name": "className",+ "type": "string | ((state: DialogViewportState) => string | undefined)","required": false,"defaultValue": null,- "description": "Portal destination. Defaults to the theme container; `null` defers mounting."+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."+ },+ {+ "name": "ref",+ "type": "Ref<HTMLDivElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the viewport div, or the element supplied through render."+ },+ {+ "name": "render",+ "type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogViewportState>",+ "required": false,+ "defaultValue": null,+ "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ },+ {+ "name": "style",+ "type": "CSSProperties | ((state: DialogViewportState) => CSSProperties | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."+ }+ ]+ },+ {+ "name": "Popup",+ "props": [+ {+ "name": "children",+ "type": "ReactNode",+ "required": false,+ "defaultValue": null,+ "description": "Dialog content. Compose inside Viewport and Portal; Popup does not create those parts or a Backdrop."+ },+ {+ "name": "className",+ "type": "string | ((state: DialogPopupState) => string | undefined)",+ "required": false,+ "defaultValue": null,+ "description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."},{"name": "finalFocus","type": "boolean | RefObject<HTMLElement | null> | ((closeType: InteractionType) => boolean | void | HTMLElement | null)","required": false,"defaultValue": null,- "description": "Determines the element to focus when the dialog is closed.\n\n- `false`: Do not move focus.\n- `true`: Move focus based on the default behavior (trigger or previously focused element).\n- `RefObject`: Move focus to the ref element.\n- `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).\n Return an element to focus, `true` to use the default behavior, `null` to fall back to the default behavior, or `false`/`undefined` to do nothing."+ "description": "Controls focus restoration on closing. Accepts a boolean, element ref or callback receiving the interaction type."},{"name": "initialFocus","type": "boolean | RefObject<HTMLElement | null> | ((openType: InteractionType) => boolean | void | HTMLElement | null)","required": false,"defaultValue": null,- "description": "Determines the element to focus when the dialog is opened.\nBy default, focus moves to the first tabbable element inside the popup, except when the dialog\nis opened by touch — then the popup itself is focused to avoid opening the virtual keyboard.\n\n- `false`: Do not move focus.\n- `true`: Move focus based on the default behavior (first tabbable element or popup).\n- `RefObject`: Move focus to the ref element.\n- `function`: Called with the interaction type (`mouse`, `touch`, `pen`, or `keyboard`).\n Return an element to focus, `true` to use the default behavior, `null` to fall back to the default behavior, or `false`/`undefined` to do nothing."+ "description": "Controls focus on opening. Accepts a boolean, element ref or callback receiving the interaction type."},{- "name": "keepMounted",- "type": "boolean",+ "name": "ref",+ "type": "Ref<HTMLDivElement>","required": false,"defaultValue": null,- "description": "Keeps content mounted while the dialog is closed."+ "description": "Ref to the popup div, or the element supplied through render."},{"name": "render","type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogPopupState>","required": false,"defaultValue": null,- "description": "Allows you to replace the component's HTML element\nwith a different tag, or compose it with another component.\n\nAccepts a `ReactElement` or a function that returns the element to render."+ "description": "Composes the popup element while retaining native props, handlers, dialog semantics and focus behavior."},{"name": "size",@@ -5401,13 +5528,6 @@"required": false,"defaultValue": null,"description": "Style applied to the element, or a function that\nreturns a style object based on the component's state."- },- {- "name": "viewportProps",- "type": "DialogViewportProps",- "required": false,- "defaultValue": null,- "description": "Native props and render composition for the viewport surrounding the popup."}]},@@ -5468,6 +5588,13 @@"defaultValue": null,"description": "CSS class applied to the element, or a function that\nreturns a class based on the component's state."},+ {+ "name": "ref",+ "type": "Ref<HTMLParagraphElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the description paragraph, or the element supplied through render."+ },{"name": "render","type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogDescriptionState>",@@ -5501,6 +5628,13 @@"defaultValue": "true","description": "Whether the component renders a native `<button>` element when replacing it\nvia the `render` prop.\nSet to `false` if the rendered element is not a button (for example, `<div>`)."},+ {+ "name": "ref",+ "type": "Ref<HTMLButtonElement>",+ "required": false,+ "defaultValue": null,+ "description": "Ref to the close button, or the element supplied through render."+ },{"name": "render","type": "ReactElement<unknown, string | JSXElementConstructor<any>> | ComponentRenderFn<HTMLProps, DialogCloseState>",diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/Dialog.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/Dialog.tsxindex aa721103e19..af34524c5c0 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/Dialog.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/Dialog.tsx@@ -1,16 +1,23 @@import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';+import { DialogBackdrop } from './internal/DialogBackdrop';import { DialogBody } from './internal/DialogBody';import { DialogDescription } from './internal/DialogDescription';import { DialogFooter } from './internal/DialogFooter';import { DialogHeader } from './internal/DialogHeader';import { DialogPopup } from './internal/DialogPopup';+import { DialogPortal } from './internal/DialogPortal';import { DialogTitle } from './internal/DialogTitle';+import { DialogViewport } from './internal/DialogViewport';export const Dialog = {createHandle: DialogPrimitive.createHandle,+ Handle: DialogPrimitive.Handle,Root: DialogPrimitive.Root,Trigger: DialogPrimitive.Trigger,+ Portal: DialogPortal,+ Backdrop: DialogBackdrop,+ Viewport: DialogViewport,Popup: DialogPopup,Title: DialogTitle,Description: DialogDescription,diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.handles.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.handles.stories.tsxindex e9da285d4f6..fb6b413e23d 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.handles.stories.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.handles.stories.tsx@@ -1,11 +1,13 @@import { type Meta, type StoryObj } from '@storybook/react-vite';-import { useState } from 'react';-import { expect, userEvent, waitFor, within } from 'storybook/test';+import { useRef, useState } from 'react';+import { expect, fn, userEvent, waitFor, within } from 'storybook/test';import { Button } from '@ui/primitives/input/Button/Button';import { ComponentDecorator } from '@ui/testing';import { Dialog } from '../Dialog';+import { type DialogRootActions } from '../types/DialogRootActions';+import { type DialogRootProps } from '../types/DialogRootProps';import { waitForDialog } from './waitForDialog';const ExternalTriggerDialog = () => {@@ -23,15 +25,22 @@ const ExternalTriggerDialog = () => {))}<Dialog.Root handle={handle}>{({ payload }) => (- <Dialog.Popup>- <Dialog.Header>- <Dialog.Title>{payload}</Dialog.Title>- <Dialog.Description>Review company details.</Dialog.Description>- </Dialog.Header>- <Dialog.Footer>- <Dialog.Close render={<Button>Close</Button>} />- </Dialog.Footer>- </Dialog.Popup>+ <Dialog.Portal>+ <Dialog.Backdrop />+ <Dialog.Viewport>+ <Dialog.Popup>+ <Dialog.Header>+ <Dialog.Title>{payload}</Dialog.Title>+ <Dialog.Description>+ Review company details.+ </Dialog.Description>+ </Dialog.Header>+ <Dialog.Footer>+ <Dialog.Close render={<Button>Close</Button>} />+ </Dialog.Footer>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal>)}</Dialog.Root></>@@ -66,3 +75,78 @@ export const ExternalTriggers: Story = {}},};++const ImperativeDialog = ({+ onOpenChange,+}: Pick<DialogRootProps, 'onOpenChange'>) => {+ const [handle] = useState(() => Dialog.createHandle<string>());+ const actionsRef = useRef<DialogRootActions>(null);++ return (+ <>+ <Button onClick={() => handle.openWithPayload('Acme')}>+ Open company review+ </Button>+ <Dialog.Root+ handle={handle}+ actionsRef={actionsRef}+ onOpenChange={onOpenChange}+ >+ {({ payload }) => (+ <Dialog.Portal>+ <Dialog.Backdrop />+ <Dialog.Viewport>+ <Dialog.Popup>+ <Dialog.Header>+ <Dialog.Title>{payload}</Dialog.Title>+ <Dialog.Description>+ Review company details.+ </Dialog.Description>+ </Dialog.Header>+ <Dialog.Footer>+ <Button onClick={() => handle.close()}>+ Close with handle+ </Button>+ <Button onClick={() => actionsRef.current?.close()}>+ Close with actions+ </Button>+ <Dialog.Close render={<Button>Close</Button>} />+ </Dialog.Footer>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal>+ )}+ </Dialog.Root>+ </>+ );+};++export const ImperativeHandleAndActions: StoryObj<typeof ImperativeDialog> = {+ args: { onOpenChange: fn() },+ render: (args) => <ImperativeDialog {...args} />,+ play: async ({ args, canvasElement }) => {+ const trigger = within(canvasElement).getByRole('button', {+ name: 'Open company review',+ });++ for (const name of ['Close with handle', 'Close with actions']) {+ await userEvent.click(trigger);++ const dialog = await waitForDialog(canvasElement);++ expect(dialog).toHaveAccessibleName('Acme');+ expect(args.onOpenChange).toHaveBeenLastCalledWith(+ true,+ expect.objectContaining({ reason: 'imperative-action' }),+ );++ await userEvent.click(within(dialog).getByRole('button', { name }));+ await waitFor(() => expect(dialog).not.toBeInTheDocument());++ expect(args.onOpenChange).toHaveBeenLastCalledWith(+ false,+ expect.objectContaining({ reason: 'imperative-action' }),+ );+ }+ },+};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.interactions.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.interactions.stories.tsxindex 7bfbbf27ff7..7384eab5c5c 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.interactions.stories.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.interactions.stories.tsx@@ -106,23 +106,32 @@ const ControlledDialog = () => {<Text>{saved ? 'Account saved' : 'Record available'}</Text><Dialog.Root open={open} onOpenChange={setOpen}><Dialog.Trigger render={<Button>Edit account</Button>} />- <Dialog.Popup>- <Dialog.Header>- <Dialog.Title>Edit account</Dialog.Title>- <Dialog.Description>Update the account details.</Dialog.Description>- </Dialog.Header>- <Dialog.Footer>- <Dialog.Close render={<Button variant="outline">Close</Button>} />- <Button- onClick={() => {- setSaved(true);- setOpen(false);- }}- >- Save changes- </Button>- </Dialog.Footer>- </Dialog.Popup>+ <Dialog.Portal>+ <Dialog.Backdrop />+ <Dialog.Viewport>+ <Dialog.Popup>+ <Dialog.Header>+ <Dialog.Title>Edit account</Dialog.Title>+ <Dialog.Description>+ Update the account details.+ </Dialog.Description>+ </Dialog.Header>+ <Dialog.Footer>+ <Dialog.Close+ render={<Button variant="outline">Close</Button>}+ />+ <Button+ onClick={() => {+ setSaved(true);+ setOpen(false);+ }}+ >+ Save changes+ </Button>+ </Dialog.Footer>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal></Dialog.Root></>);@@ -163,7 +172,7 @@ export const DisabledTrigger: Story = {export const KeepMounted: Story = {decorators: [ComponentDecorator],args: {- popupProps: { keepMounted: true },+ portalProps: { keepMounted: true },content: <Input aria-label="Reason" />,},play: async ({ canvasElement }) => {@@ -315,7 +324,7 @@ export const FocusTrapWithoutScrollLock: Story = {args: {defaultOpen: true,modal: 'trap-focus',- popupProps: { backdrop: false },+ backdrop: false,},play: async ({ canvasElement }) => {const dialog = await waitForDialog(canvasElement);@@ -337,7 +346,8 @@ export const ExternalStateAndFocus: Story = {open: true,modal: false,disablePointerDismissal: true,- popupProps: { initialFocus: false, finalFocus: false, backdrop: false },+ popupProps: { initialFocus: false, finalFocus: false },+ backdrop: false,},play: async ({ canvasElement }) => {const dialog = await waitForDialog(canvasElement);@@ -364,7 +374,7 @@ const NonModalDialog = () => {Page action</Button><Text role="status">Page actions: {pageActionCount}</Text>- <DialogExample open modal={false} popupProps={{ backdrop: false }} />+ <DialogExample open modal={false} backdrop={false} /></>);};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.parts.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.parts.stories.tsxnew file mode 100644index 00000000000..c02f6a6f252--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.parts.stories.tsx@@ -0,0 +1,108 @@+import { type Meta, type StoryObj } from '@storybook/react-vite';+import { expect, fn, userEvent, waitFor, within } from 'storybook/test';++import { Button } from '@ui/primitives/input/Button/Button';+import { ComponentDecorator } from '@ui/testing';++import { Dialog } from '../Dialog';+import { waitForDialog } from './waitForDialog';++const ComposedDialog = ({ onPopupClick }: { onPopupClick: () => void }) => (+ <Dialog.Root>+ <Dialog.Trigger render={<Button>Open composed dialog</Button>} />+ <Dialog.Portal+ data-testid="composed-portal"+ render={(props) => <article {...props} />}+ >+ <Dialog.Backdrop+ data-testid="composed-backdrop"+ render={(props, state) => (+ <aside {...props} data-render-open={state.open} />+ )}+ className={(state) =>+ state.open ? 'backdrop-open' : 'backdrop-closed'+ }+ />+ <Dialog.Viewport+ data-testid="composed-viewport"+ render={(props, state) => (+ <main {...props} data-render-open={state.open} />+ )}+ className={(state) =>+ state.open ? 'viewport-open' : 'viewport-closed'+ }+ >+ <Dialog.Popup+ render={(props, state) => (+ <section {...props} data-render-open={state.open} />+ )}+ onClick={onPopupClick}+ >+ <Dialog.Header>+ <Dialog.Title>Composed dialog</Dialog.Title>+ <Dialog.Description>+ Every part owns its element.+ </Dialog.Description>+ </Dialog.Header>+ <Dialog.Footer>+ <Dialog.Close render={<Button>Close composed dialog</Button>} />+ </Dialog.Footer>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal>+ </Dialog.Root>+);++const meta: Meta<typeof ComposedDialog> = {+ title: 'UI/Surfaces/Dialog',+ component: ComposedDialog,+ decorators: [ComponentDecorator],+};++export default meta;+type Story = StoryObj<typeof ComposedDialog>;++export const ComposedParts: Story = {+ args: { onPopupClick: fn() },+ play: async ({ args, canvasElement }) => {+ const body = within(canvasElement.ownerDocument.body);+ const trigger = within(canvasElement).getByRole('button', {+ name: 'Open composed dialog',+ });++ await userEvent.click(trigger);++ const dialog = await waitForDialog(canvasElement);+ const portal = body.getByTestId('composed-portal');+ const backdrop = body.getByTestId('composed-backdrop');+ const viewport = body.getByTestId('composed-viewport');++ expect(portal.tagName).toBe('ARTICLE');+ expect(backdrop.tagName).toBe('ASIDE');+ expect(viewport.tagName).toBe('MAIN');+ expect(dialog.tagName).toBe('SECTION');+ expect(portal).toContainElement(backdrop);+ expect(portal).toContainElement(viewport);+ expect(viewport).toContainElement(dialog);+ expect(backdrop).not.toContainElement(dialog);+ expect(dialog).toHaveAccessibleName('Composed dialog');+ expect(dialog).toHaveAccessibleDescription('Every part owns its element.');++ for (const part of [backdrop, viewport, dialog]) {+ expect(part).toHaveAttribute('data-render-open', 'true');+ }++ expect(backdrop).toHaveClass('backdrop-open');+ expect(viewport).toHaveClass('viewport-open');++ await userEvent.click(within(dialog).getByRole('heading'));++ expect(args.onPopupClick).toHaveBeenCalledOnce();++ await userEvent.click(+ within(dialog).getByRole('button', { name: 'Close composed dialog' }),+ );+ await waitFor(() => expect(portal).not.toBeInTheDocument());+ await waitFor(() => expect(trigger).toHaveFocus());+ },+};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.portals.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.portals.stories.tsxindex c8f8e6148ec..b87283b85cb 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.portals.stories.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.portals.stories.tsx@@ -63,7 +63,7 @@ const ExplicitContainerDialog = () => {<div ref={setContainer} data-testid="portal-container" /><ThemeProvider colorScheme="dark" applyToRoot={false}><div style={{ backgroundColor: 'var(--t-background-primary)' }}>- <DialogExample defaultOpen popupProps={{ container }} />+ <DialogExample defaultOpen portalProps={{ container }} /></div></ThemeProvider></>@@ -92,7 +92,7 @@ const DeferredContainerDialog = () => {<Button onClick={() => setContainer(containerRef.current)}>Attach container</Button>- <DialogExample open popupProps={{ container }} />+ <DialogExample open portalProps={{ container }} /></ThemeProvider>);};@@ -118,7 +118,7 @@ const RefContainerDialog = () => {return (<><div ref={container} data-testid="ref-container" />- <DialogExample defaultOpen popupProps={{ container }} />+ <DialogExample defaultOpen portalProps={{ container }} /></>);};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.titles.stories.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.titles.stories.tsxindex ec2c242374a..c11dd50e507 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.titles.stories.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/Dialog.titles.stories.tsx@@ -14,17 +14,22 @@ const meta: Meta<typeof Dialog.Title> = {args: { children: 'Grant credits' },render: (args) => (<Dialog.Root defaultOpen>- <Dialog.Popup>- <Dialog.Header>- <Dialog.Title {...args} />- <Dialog.Description>- Add credits to this workspace.- </Dialog.Description>- </Dialog.Header>- <Dialog.Footer>- <Dialog.Close render={<Button>Close</Button>} />- </Dialog.Footer>- </Dialog.Popup>+ <Dialog.Portal>+ <Dialog.Backdrop />+ <Dialog.Viewport>+ <Dialog.Popup>+ <Dialog.Header>+ <Dialog.Title {...args} />+ <Dialog.Description>+ Add credits to this workspace.+ </Dialog.Description>+ </Dialog.Header>+ <Dialog.Footer>+ <Dialog.Close render={<Button>Close</Button>} />+ </Dialog.Footer>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal></Dialog.Root>),};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/DialogExample.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/DialogExample.tsxindex 6f67344b974..1bf16f2764e 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/DialogExample.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/DialogExample.tsx@@ -6,7 +6,9 @@ import { type DialogExampleProps } from './DialogExampleProps';export const DialogExample = ({size,+ portalProps,popupProps,+ backdrop = true,disabled,content,...props@@ -16,16 +18,21 @@ export const DialogExample = ({disabled={disabled}render={<Button>Edit account</Button>}/>- <Dialog.Popup size={size} {...popupProps}>- <Dialog.Header>- <Dialog.Title>Edit account</Dialog.Title>- <Dialog.Description>Update the account details.</Dialog.Description>- </Dialog.Header>- {isDefined(content) && <Dialog.Body>{content}</Dialog.Body>}- <Dialog.Footer>- <Dialog.Close render={<Button variant="outline">Close</Button>} />- <Dialog.Close render={<Button>Save</Button>} />- </Dialog.Footer>- </Dialog.Popup>+ <Dialog.Portal {...portalProps}>+ {backdrop && <Dialog.Backdrop />}+ <Dialog.Viewport data-backdrop-hidden={!backdrop}>+ <Dialog.Popup size={size} {...popupProps}>+ <Dialog.Header>+ <Dialog.Title>Edit account</Dialog.Title>+ <Dialog.Description>Update the account details.</Dialog.Description>+ </Dialog.Header>+ {isDefined(content) && <Dialog.Body>{content}</Dialog.Body>}+ <Dialog.Footer>+ <Dialog.Close render={<Button variant="outline">Close</Button>} />+ <Dialog.Close render={<Button>Save</Button>} />+ </Dialog.Footer>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal></Dialog.Root>);diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/DialogExampleProps.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/DialogExampleProps.tsindex 2fba95e6c22..49164f7ec7b 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/DialogExampleProps.ts+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__stories__/DialogExampleProps.ts@@ -1,11 +1,14 @@import { type ReactNode } from 'react';import { type DialogPopupProps } from '../types/DialogPopupProps';+import { type DialogPortalProps } from '../types/DialogPortalProps';import { type DialogRootProps } from '../types/DialogRootProps';export type DialogExampleProps = DialogRootProps & {size?: DialogPopupProps['size'];+ portalProps?: DialogPortalProps;popupProps?: DialogPopupProps;+ backdrop?: boolean;disabled?: boolean;content?: ReactNode;};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/Dialog.test.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/Dialog.test.tsxindex 56949a1d0a9..5b345cdb298 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/Dialog.test.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/Dialog.test.tsx@@ -1,7 +1,11 @@-import { type ReactNode } from 'react';+import { render, screen } from '@testing-library/react';+import userEvent from '@testing-library/user-event';+import { createRef, type ReactNode } from 'react';+import { expect, it, vi } from 'vitest';import { runComponentConformance } from '@test-utilities/conformance/runComponentConformance';+import { DirectionProvider } from '@ui/primitives/layout/DirectionProvider/DirectionProvider';import styles from '@ui/primitives/surfaces/internal/Dialog.module.scss';import { Dialog } from '../Dialog';@@ -11,9 +15,25 @@ const DialogRootWrapper = ({ children }: { children: ReactNode }) => (const OpenDialogWrapper = ({ children }: { children: ReactNode }) => (<Dialog.Root open>{children}</Dialog.Root>);+const DialogPortalWrapper = ({ children }: { children: ReactNode }) => (+ <Dialog.Root open>+ <Dialog.Portal>{children}</Dialog.Portal>+ </Dialog.Root>+);+const DialogViewportWrapper = ({ children }: { children: ReactNode }) => (+ <Dialog.Root open>+ <Dialog.Portal>+ <Dialog.Viewport>{children}</Dialog.Viewport>+ </Dialog.Portal>+ </Dialog.Root>+);const DialogPopupWrapper = ({ children }: { children: ReactNode }) => (<Dialog.Root open>- <Dialog.Popup initialFocus={false}>{children}</Dialog.Popup>+ <Dialog.Portal>+ <Dialog.Viewport>+ <Dialog.Popup initialFocus={false}>{children}</Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal></Dialog.Root>);@@ -24,11 +44,31 @@ runComponentConformance({wrapper: DialogRootWrapper,renderPropTagName: 'button',});+runComponentConformance({+ name: 'Dialog.Portal',+ element: <Dialog.Portal />,+ refInstanceOf: HTMLDivElement,+ wrapper: OpenDialogWrapper,+});+runComponentConformance({+ name: 'Dialog.Backdrop',+ element: <Dialog.Backdrop />,+ refInstanceOf: HTMLDivElement,+ wrapper: DialogPortalWrapper,+ ownClassName: styles.backdrop,+});+runComponentConformance({+ name: 'Dialog.Viewport',+ element: <Dialog.Viewport />,+ refInstanceOf: HTMLDivElement,+ wrapper: DialogPortalWrapper,+ ownClassName: styles.viewport,+});runComponentConformance({name: 'Dialog.Popup',element: <Dialog.Popup initialFocus={false} />,refInstanceOf: HTMLDivElement,- wrapper: OpenDialogWrapper,+ wrapper: DialogViewportWrapper,ownClassName: styles.popup,});runComponentConformance({@@ -63,3 +103,82 @@ runComponentConformance({refInstanceOf: HTMLDivElement,ownClassName: styles.footer,});++it('keeps each composed part ref and native handler on its own element', async () => {+ const user = userEvent.setup();+ const portal = createRef<HTMLDivElement>();+ const backdrop = createRef<HTMLDivElement>();+ const viewport = createRef<HTMLDivElement>();+ const popup = createRef<HTMLDivElement>();+ const onPortalClick = vi.fn();+ const onBackdropClick = vi.fn();+ const onViewportClick = vi.fn();+ const onPopupClick = vi.fn();++ render(+ <Dialog.Root open disablePointerDismissal>+ <Dialog.Portal ref={portal} onClick={onPortalClick}>+ <Dialog.Backdrop+ ref={backdrop}+ data-testid="dialog-backdrop"+ onClick={onBackdropClick}+ />+ <Dialog.Viewport ref={viewport} onClick={onViewportClick}>+ <Dialog.Popup+ ref={popup}+ onClick={onPopupClick}+ initialFocus={false}+ aria-label="Composed dialog"+ >+ Content+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal>+ </Dialog.Root>,+ );++ const dialog = screen.getByRole('dialog', { name: 'Composed dialog' });++ expect(popup.current).toBe(dialog);+ expect(viewport.current).toBe(dialog.parentElement);+ expect(portal.current).toBe(viewport.current?.parentElement);+ expect(backdrop.current?.parentElement).toBe(portal.current);+ expect(backdrop.current).not.toBe(viewport.current);++ await user.click(dialog);++ expect(onPopupClick).toHaveBeenCalledOnce();+ expect(onViewportClick).toHaveBeenCalledOnce();+ expect(onPortalClick).toHaveBeenCalledOnce();+ expect(onBackdropClick).not.toHaveBeenCalled();++ await user.click(screen.getByTestId('dialog-backdrop'));++ expect(onBackdropClick).toHaveBeenCalledOnce();+ expect(onPortalClick).toHaveBeenCalledTimes(2);+ expect(onViewportClick).toHaveBeenCalledOnce();+ expect(onPopupClick).toHaveBeenCalledOnce();+});++it('preserves explicit native direction on viewport and popup', () => {+ render(+ <DirectionProvider direction="rtl">+ <Dialog.Root open>+ <Dialog.Portal>+ <Dialog.Viewport dir="ltr" data-testid="dialog-viewport">+ <Dialog.Popup+ dir="ltr"+ initialFocus={false}+ aria-label="Left to right dialog"+ />+ </Dialog.Viewport>+ </Dialog.Portal>+ </Dialog.Root>+ </DirectionProvider>,+ );++ expect(screen.getByTestId('dialog-viewport')).toHaveAttribute('dir', 'ltr');+ expect(+ screen.getByRole('dialog', { name: 'Left to right dialog' }),+ ).toHaveAttribute('dir', 'ltr');+});diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/DialogTitle.test.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/DialogTitle.test.tsxindex 66692e4547b..d110ecdac46 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/DialogTitle.test.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/DialogTitle.test.tsx@@ -25,11 +25,16 @@ it('labels the dialog and keeps the title level independent of its size', () =>render(<ThemeProvider colorScheme="light"><Dialog.Root open>- <Dialog.Popup initialFocus={false}>- <Dialog.Title level={3} size="sm">- Grant credits- </Dialog.Title>- </Dialog.Popup>+ <Dialog.Portal>+ <Dialog.Backdrop />+ <Dialog.Viewport>+ <Dialog.Popup initialFocus={false}>+ <Dialog.Title level={3} size="sm">+ Grant credits+ </Dialog.Title>+ </Dialog.Popup>+ </Dialog.Viewport>+ </Dialog.Portal></Dialog.Root></ThemeProvider>,);diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/DialogTypes.test.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/DialogTypes.test.tsxnew file mode 100644index 00000000000..a6d923cb38b--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/__tests__/DialogTypes.test.tsx@@ -0,0 +1,127 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';+import { createRef } from 'react';+import { expectTypeOf, it } from 'vitest';++import {+ Dialog,+ type DialogBackdropProps,+ type DialogBackdropState,+ type DialogHandle,+ type DialogPopupProps,+ type DialogPopupState,+ type DialogPortalProps,+ type DialogPortalState,+ type DialogRootActions,+ type DialogRootChangeEventDetails,+ type DialogRootChangeEventReason,+ type DialogRootProps,+ type DialogViewportProps,+ type DialogViewportState,+} from '@ui/primitives/surfaces';++it('keeps native handlers, refs, and render state on each composed part', () => {+ const portalProps: DialogPortalProps = {+ container: createRef<HTMLElement | ShadowRoot>(),+ keepMounted: true,+ ref: createRef<HTMLDivElement>(),+ onClick: (event) => {+ expectTypeOf(event.currentTarget).toEqualTypeOf<+ EventTarget & HTMLDivElement+ >();+ event.preventBaseUIHandler();+ },+ render: (elementProps, state) => {+ expectTypeOf(state).toEqualTypeOf<DialogPortalState>();+ return <section {...elementProps} />;+ },+ };+ const backdropProps: DialogBackdropProps = {+ forceRender: true,+ ref: (element) => {+ expectTypeOf(element).toEqualTypeOf<HTMLDivElement | null>();+ },+ className: (state) => {+ expectTypeOf(state).toEqualTypeOf<DialogBackdropState>();+ return state.open ? 'open' : undefined;+ },+ style: (state) => ({ opacity: state.open ? 1 : 0 }),+ };+ const viewportProps: DialogViewportProps = {+ ref: createRef<HTMLDivElement>(),+ onScroll: (event) => {+ expectTypeOf(event.currentTarget).toEqualTypeOf<+ EventTarget & HTMLDivElement+ >();+ },+ render: (elementProps, state) => {+ expectTypeOf(state).toEqualTypeOf<DialogViewportState>();+ return <section {...elementProps} data-nested={state.nested} />;+ },+ };++ <Dialog.Root>+ <Dialog.Portal {...portalProps}>+ <Dialog.Backdrop {...backdropProps} />+ <Dialog.Viewport {...viewportProps} />+ </Dialog.Portal>+ </Dialog.Root>;+});++it('infers payloads from handles and retains root actions and change details', () => {+ const payload = { recordId: 'record-id' };+ const handle: DialogHandle<typeof payload> =+ Dialog.createHandle<typeof payload>();+ const constructedHandle: DialogHandle<typeof payload> = new Dialog.Handle<+ typeof payload+ >();+ const rootProps: DialogRootProps<typeof payload> = {+ handle,+ actionsRef: createRef<DialogRootActions>(),+ onOpenChange: (open, details) => {+ expectTypeOf(open).toEqualTypeOf<boolean>();+ expectTypeOf(details).toEqualTypeOf<DialogRootChangeEventDetails>();+ expectTypeOf(details.reason).toEqualTypeOf<DialogRootChangeEventReason>();+ details.cancel();+ details.preventUnmountOnClose();+ },+ };++ expectTypeOf(handle.openWithPayload)+ .parameter(0)+ .toEqualTypeOf<typeof payload>();+ expectTypeOf(constructedHandle.open)+ .parameter(0)+ .toEqualTypeOf<string | null>();+ expectTypeOf<DialogRootActions>().toEqualTypeOf<DialogPrimitive.Root.Actions>();++ <Dialog.Trigger handle={handle} payload={payload} />;+ <Dialog.Root {...rootProps}>+ {({ payload: activePayload }) => {+ expectTypeOf(activePayload).toEqualTypeOf<typeof payload | undefined>();+ return null;+ }}+ </Dialog.Root>;+});++it('keeps popup focus and render contracts separate from assembly props', () => {+ expectTypeOf<DialogPopupProps>().not.toHaveProperty('container');+ expectTypeOf<DialogPopupProps>().not.toHaveProperty('keepMounted');+ expectTypeOf<DialogPopupProps>().not.toHaveProperty('backdrop');+ expectTypeOf<DialogPopupProps>().not.toHaveProperty('viewportProps');++ <Dialog.Popup+ ref={createRef<HTMLDivElement>()}+ size="fullscreen"+ initialFocus={(interactionType) => {+ expectTypeOf(interactionType).toEqualTypeOf<+ 'mouse' | 'touch' | 'pen' | 'keyboard' | ''+ >();+ return false;+ }}+ finalFocus={createRef<HTMLButtonElement>()}+ render={(elementProps, state) => {+ expectTypeOf(state).toEqualTypeOf<DialogPopupState>();+ return <section {...elementProps} />;+ }}+ />;+});diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogBackdrop.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogBackdrop.tsxnew file mode 100644index 00000000000..28b62e1bf0d--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogBackdrop.tsx@@ -0,0 +1,16 @@+import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';++import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';++import styles from '@ui/primitives/surfaces/internal/Dialog.module.scss';+import { type DialogBackdropProps } from '../types/DialogBackdropProps';++export const DialogBackdrop = ({+ className,+ ...props+}: DialogBackdropProps) => (+ <DialogPrimitive.Backdrop+ {...props}+ className={mergeClassNames(styles.backdrop, className)}+ />+);diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogPopup.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogPopup.tsxindex d3d963d1e09..2559a756e51 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogPopup.tsx+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogPopup.tsx@@ -1,8 +1,6 @@import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';-import { isBoolean } from '@sniptt/guards';import { useProvidedTextDirection } from '@ui/primitives/layout/DirectionProvider/internal/useProvidedTextDirection';-import { useThemeContainer } from '@ui/theme';import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';import styles from '@ui/primitives/surfaces/internal/Dialog.module.scss';@@ -10,42 +8,17 @@ import { type DialogPopupProps } from '../types/DialogPopupProps';export const DialogPopup = ({size = 'md',- container,- keepMounted,- backdrop = true,- viewportProps,className,...props}: DialogPopupProps) => {- const themeContainer = useThemeContainer();const direction = useProvidedTextDirection();- const backdropProps = isBoolean(backdrop) ? {} : backdrop;return (- <DialogPrimitive.Portal- container={- container === undefined ? (themeContainer ?? undefined) : container- }- keepMounted={keepMounted}- >- {backdrop !== false && (- <DialogPrimitive.Backdrop- {...backdropProps}- className={mergeClassNames(styles.backdrop, backdropProps.className)}- />- )}- <DialogPrimitive.Viewport- dir={direction}- data-backdrop-hidden={backdrop === false}- {...viewportProps}- className={mergeClassNames(styles.viewport, viewportProps?.className)}- >- <DialogPrimitive.Popup- {...props}- data-size={size}- className={mergeClassNames(styles.popup, className)}- />- </DialogPrimitive.Viewport>- </DialogPrimitive.Portal>+ <DialogPrimitive.Popup+ dir={direction}+ {...props}+ data-size={size}+ className={mergeClassNames(styles.popup, className)}+ />);};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogPortal.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogPortal.tsxnew file mode 100644index 00000000000..b1b91fd476c--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogPortal.tsx@@ -0,0 +1,19 @@+import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';+import { isUndefined } from '@sniptt/guards';++import { useThemeContainer } from '@ui/theme';++import { type DialogPortalProps } from '../types/DialogPortalProps';++export const DialogPortal = ({ container, ...props }: DialogPortalProps) => {+ const themeContainer = useThemeContainer();++ return (+ <DialogPrimitive.Portal+ {...props}+ container={+ isUndefined(container) ? (themeContainer ?? undefined) : container+ }+ />+ );+};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogViewport.tsx b/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogViewport.tsxnew file mode 100644index 00000000000..5c34729b5ed--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/internal/DialogViewport.tsx@@ -0,0 +1,22 @@+import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';++import { useProvidedTextDirection } from '@ui/primitives/layout/DirectionProvider/internal/useProvidedTextDirection';+import { mergeClassNames } from '@ui/utilities/internal/mergeClassNames';++import styles from '@ui/primitives/surfaces/internal/Dialog.module.scss';+import { type DialogViewportProps } from '../types/DialogViewportProps';++export const DialogViewport = ({+ className,+ ...props+}: DialogViewportProps) => {+ const direction = useProvidedTextDirection();++ return (+ <DialogPrimitive.Viewport+ dir={direction}+ {...props}+ className={mergeClassNames(styles.viewport, className)}+ />+ );+};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogBackdropProps.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogBackdropProps.tsnew file mode 100644index 00000000000..d4d8c3035df--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogBackdropProps.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogBackdropProps = DialogPrimitive.Backdrop.Props;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogBackdropState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogBackdropState.tsnew file mode 100644index 00000000000..6bdd85d11fd--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogBackdropState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogBackdropState = DialogPrimitive.Backdrop.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogCloseState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogCloseState.tsnew file mode 100644index 00000000000..eb766110145--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogCloseState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogCloseState = DialogPrimitive.Close.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogDescriptionState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogDescriptionState.tsnew file mode 100644index 00000000000..a0658411f31--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogDescriptionState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogDescriptionState = DialogPrimitive.Description.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogHandle.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogHandle.tsnew file mode 100644index 00000000000..20acbf10c15--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogHandle.ts@@ -0,0 +1,5 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogHandle<TPayload = unknown> = InstanceType<+ typeof DialogPrimitive.Handle<TPayload>+>;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPopupProps.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPopupProps.tsindex 527702bfd39..824235c70cf 100644--- a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPopupProps.ts+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPopupProps.ts@@ -4,8 +4,4 @@ import { type DialogSize } from './DialogSize';export type DialogPopupProps = DialogPrimitive.Popup.Props & {size?: DialogSize;- container?: DialogPrimitive.Portal.Props['container'];- keepMounted?: boolean;- backdrop?: boolean | DialogPrimitive.Backdrop.Props;- viewportProps?: DialogPrimitive.Viewport.Props;};diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPopupState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPopupState.tsnew file mode 100644index 00000000000..6ecf10b5de2--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPopupState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogPopupState = DialogPrimitive.Popup.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPortalProps.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPortalProps.tsnew file mode 100644index 00000000000..f3ad74af006--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPortalProps.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogPortalProps = DialogPrimitive.Portal.Props;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPortalState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPortalState.tsnew file mode 100644index 00000000000..37334a09706--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogPortalState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogPortalState = DialogPrimitive.Portal.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootActions.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootActions.tsnew file mode 100644index 00000000000..e2864d62d56--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootActions.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogRootActions = DialogPrimitive.Root.Actions;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootChangeEventDetails.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootChangeEventDetails.tsnew file mode 100644index 00000000000..e67af4474a1--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootChangeEventDetails.ts@@ -0,0 +1,4 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogRootChangeEventDetails =+ DialogPrimitive.Root.ChangeEventDetails;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootChangeEventReason.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootChangeEventReason.tsnew file mode 100644index 00000000000..b4f5580b2b4--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootChangeEventReason.ts@@ -0,0 +1,4 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogRootChangeEventReason =+ DialogPrimitive.Root.ChangeEventReason;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootState.tsnew file mode 100644index 00000000000..31ca9022392--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogRootState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogRootState = DialogPrimitive.Root.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogTitleState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogTitleState.tsnew file mode 100644index 00000000000..c25263078e7--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogTitleState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogTitleState = DialogPrimitive.Title.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogTriggerState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogTriggerState.tsnew file mode 100644index 00000000000..a81671748f5--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogTriggerState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogTriggerState = DialogPrimitive.Trigger.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogViewportProps.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogViewportProps.tsnew file mode 100644index 00000000000..ed180dbae1c--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogViewportProps.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogViewportProps = DialogPrimitive.Viewport.Props;diff --git a/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogViewportState.ts b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogViewportState.tsnew file mode 100644index 00000000000..c494810bc02--- /dev/null+++ b/packages/twenty-ui/src/primitives/surfaces/Dialog/types/DialogViewportState.ts@@ -0,0 +1,3 @@+import { type Dialog as DialogPrimitive } from '@base-ui/react/dialog';++export type DialogViewportState = DialogPrimitive.Viewport.State;diff --git a/packages/twenty-ui/src/primitives/surfaces/index.ts b/packages/twenty-ui/src/primitives/surfaces/index.tsindex afabf3530ec..85f2153e1d9 100644--- a/packages/twenty-ui/src/primitives/surfaces/index.ts+++ b/packages/twenty-ui/src/primitives/surfaces/index.ts@@ -36,16 +36,32 @@ export type { AlertDialogViewportProps } from './AlertDialog/types/AlertDialogViexport type { AlertDialogViewportState } from './AlertDialog/types/AlertDialogViewportState';export { Card } from './Card/Card';export { Dialog } from './Dialog/Dialog';+export type { DialogBackdropProps } from './Dialog/types/DialogBackdropProps';+export type { DialogBackdropState } from './Dialog/types/DialogBackdropState';export type { DialogBodyProps } from './Dialog/types/DialogBodyProps';export type { DialogCloseProps } from './Dialog/types/DialogCloseProps';+export type { DialogCloseState } from './Dialog/types/DialogCloseState';export type { DialogDescriptionProps } from './Dialog/types/DialogDescriptionProps';+export type { DialogDescriptionState } from './Dialog/types/DialogDescriptionState';export type { DialogFooterProps } from './Dialog/types/DialogFooterProps';+export type { DialogHandle } from './Dialog/types/DialogHandle';export type { DialogHeaderProps } from './Dialog/types/DialogHeaderProps';export type { DialogPopupProps } from './Dialog/types/DialogPopupProps';+export type { DialogPopupState } from './Dialog/types/DialogPopupState';+export type { DialogPortalProps } from './Dialog/types/DialogPortalProps';+export type { DialogPortalState } from './Dialog/types/DialogPortalState';+export type { DialogRootActions } from './Dialog/types/DialogRootActions';+export type { DialogRootChangeEventDetails } from './Dialog/types/DialogRootChangeEventDetails';+export type { DialogRootChangeEventReason } from './Dialog/types/DialogRootChangeEventReason';export type { DialogRootProps } from './Dialog/types/DialogRootProps';+export type { DialogRootState } from './Dialog/types/DialogRootState';export type { DialogSize } from './Dialog/types/DialogSize';export type { DialogTitleProps } from './Dialog/types/DialogTitleProps';+export type { DialogTitleState } from './Dialog/types/DialogTitleState';export type { DialogTriggerProps } from './Dialog/types/DialogTriggerProps';+export type { DialogTriggerState } from './Dialog/types/DialogTriggerState';+export type { DialogViewportProps } from './Dialog/types/DialogViewportProps';+export type { DialogViewportState } from './Dialog/types/DialogViewportState';export { Menu } from './Menu/Menu';export type { MenuActionItemProps } from './Menu/types/MenuActionItemProps';export type { MenuAlign } from './Menu/types/MenuAlign';