-
+ {MenuPanel && }
{HelperButtons && }
-
{topZone}
+
{TopPanel && }
- {shareZone}
+ {SharePanel && }
{StylePanel && breakpoint >= PORTRAIT_BREAKPOINT.TABLET_SM && !isReadonlyMode && (
<_StylePanel />
)}
diff --git a/packages/tldraw/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx b/packages/tldraw/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx
index 48f7a91ba..1d21d9b60 100644
--- a/packages/tldraw/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx
+++ b/packages/tldraw/src/lib/ui/components/ActionsMenu/DefaultActionsMenu.tsx
@@ -4,8 +4,14 @@ import { PORTRAIT_BREAKPOINT } from '../../constants'
import { useBreakpoint } from '../../context/breakpoints'
import { useReadonly } from '../../hooks/useReadonly'
import { useTranslation } from '../../hooks/useTranslation/useTranslation'
-import { TldrawUiMenuContextProvider } from '../menus/TldrawUiMenuContext'
-import { Popover, PopoverContent, PopoverTrigger } from '../primitives/Popover'
+import { TldrawUiButton } from '../primitives/Button/TldrawUiButton'
+import { TldrawUiButtonIcon } from '../primitives/Button/TldrawUiButtonIcon'
+import {
+ TldrawUiPopover,
+ TldrawUiPopoverContent,
+ TldrawUiPopoverTrigger,
+} from '../primitives/TldrawUiPopover'
+import { TldrawUiMenuContextProvider } from '../primitives/menus/TldrawUiMenuContext'
import { DefaultActionsMenuContent } from './DefaultActionsMenuContent'
/** @public */
@@ -37,16 +43,17 @@ export const DefaultActionsMenu = memo(function DefaultActionsMenu({
if (isReadonlyMode && !isInAcceptableReadonlyState) return
return (
-
-
-
+
+
)
})
diff --git a/packages/tldraw/src/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.tsx b/packages/tldraw/src/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.tsx
index 4c55d3ee2..2e02b2d7d 100644
--- a/packages/tldraw/src/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.tsx
+++ b/packages/tldraw/src/lib/ui/components/ActionsMenu/DefaultActionsMenuContent.tsx
@@ -9,7 +9,7 @@ import {
useThreeStackableItems,
useUnlockedSelectedShapesCount,
} from '../../hooks/menu-hooks'
-import { TldrawUiMenuItem } from '../menus/TldrawUiMenuItem'
+import { TldrawUiMenuItem } from '../primitives/menus/TldrawUiMenuItem'
/** @public */
export function DefaultActionsMenuContent() {
diff --git a/packages/tldraw/src/lib/ui/components/ContextMenu/DefaultContextMenu.tsx b/packages/tldraw/src/lib/ui/components/ContextMenu/DefaultContextMenu.tsx
index f333a4653..ac5abb240 100644
--- a/packages/tldraw/src/lib/ui/components/ContextMenu/DefaultContextMenu.tsx
+++ b/packages/tldraw/src/lib/ui/components/ContextMenu/DefaultContextMenu.tsx
@@ -2,7 +2,7 @@ import * as _ContextMenu from '@radix-ui/react-context-menu'
import { preventDefault, useContainer, useEditor } from '@tldraw/editor'
import { memo, useCallback } from 'react'
import { useMenuIsOpen } from '../../hooks/useMenuIsOpen'
-import { TldrawUiMenuContextProvider } from '../menus/TldrawUiMenuContext'
+import { TldrawUiMenuContextProvider } from '../primitives/menus/TldrawUiMenuContext'
import { DefaultContextMenuContent } from './DefaultContextMenuContent'
/** @public */
diff --git a/packages/tldraw/src/lib/ui/components/ContextMenu/DefaultContextMenuContent.tsx b/packages/tldraw/src/lib/ui/components/ContextMenu/DefaultContextMenuContent.tsx
index f321d11bf..ef3e2fe07 100644
--- a/packages/tldraw/src/lib/ui/components/ContextMenu/DefaultContextMenuContent.tsx
+++ b/packages/tldraw/src/lib/ui/components/ContextMenu/DefaultContextMenuContent.tsx
@@ -17,7 +17,7 @@ import {
ToggleLockMenuItem,
UngroupMenuItem,
} from '../menu-items'
-import { TldrawUiMenuGroup } from '../menus/TldrawUiMenuGroup'
+import { TldrawUiMenuGroup } from '../primitives/menus/TldrawUiMenuGroup'
/** @public */
export function DefaultContextMenuContent() {
diff --git a/packages/tldraw/src/lib/ui/components/DebugMenu/DefaultDebugMenu.tsx b/packages/tldraw/src/lib/ui/components/DebugMenu/DefaultDebugMenu.tsx
index a747fc1fd..a579b3c3d 100644
--- a/packages/tldraw/src/lib/ui/components/DebugMenu/DefaultDebugMenu.tsx
+++ b/packages/tldraw/src/lib/ui/components/DebugMenu/DefaultDebugMenu.tsx
@@ -1,10 +1,12 @@
import { useTranslation } from '../../hooks/useTranslation/useTranslation'
-import { TldrawUiMenuContextProvider } from '../menus/TldrawUiMenuContext'
+import { TldrawUiButton } from '../primitives/Button/TldrawUiButton'
+import { TldrawUiButtonIcon } from '../primitives/Button/TldrawUiButtonIcon'
import {
- DropdownMenuContent,
- DropdownMenuRoot,
- DropdownMenuTrigger,
-} from '../primitives/DropdownMenu'
+ TldrawUiDropdownMenuContent,
+ TldrawUiDropdownMenuRoot,
+ TldrawUiDropdownMenuTrigger,
+} from '../primitives/TldrawUiDropdownMenu'
+import { TldrawUiMenuContextProvider } from '../primitives/menus/TldrawUiMenuContext'
import { DefaultDebugMenuContent } from './DefaultDebugMenuContent'
/** @public */
@@ -18,13 +20,17 @@ export function DefaultDebugMenu({ children }: TLUiDebugMenuProps) {
const content = children ??
return (
-
-
-
+
+
+
+
+
+
+
{content}
-
-
+
+
)
}
diff --git a/packages/tldraw/src/lib/ui/components/DebugMenu/DefaultDebugMenuContent.tsx b/packages/tldraw/src/lib/ui/components/DebugMenu/DefaultDebugMenuContent.tsx
index 4ffdc509d..3fdc54dfd 100644
--- a/packages/tldraw/src/lib/ui/components/DebugMenu/DefaultDebugMenuContent.tsx
+++ b/packages/tldraw/src/lib/ui/components/DebugMenu/DefaultDebugMenuContent.tsx
@@ -1,4 +1,3 @@
-import { DialogTitle } from '@radix-ui/react-dialog'
import {
DebugFlag,
Editor,
@@ -15,12 +14,20 @@ import React from 'react'
import { useDialogs } from '../../context/dialogs'
import { useToasts } from '../../context/toasts'
import { untranslated } from '../../hooks/useTranslation/useTranslation'
-import { TldrawUiMenuCheckboxItem } from '../menus/TldrawUiMenuCheckboxItem'
-import { TldrawUiMenuGroup } from '../menus/TldrawUiMenuGroup'
-import { TldrawUiMenuItem } from '../menus/TldrawUiMenuItem'
-import { TldrawUiMenuSubmenu } from '../menus/TldrawUiMenuSubmenu'
-import { Button } from '../primitives/Button'
-import { DialogBody, DialogCloseButton, DialogFooter, DialogHeader } from '../primitives/Dialog'
+import { TldrawUiButton } from '../primitives/Button/TldrawUiButton'
+import { TldrawUiButtonCheck } from '../primitives/Button/TldrawUiButtonCheck'
+import { TldrawUiButtonLabel } from '../primitives/Button/TldrawUiButtonLabel'
+import {
+ TldrawUiDialogBody,
+ TldrawUiDialogCloseButton,
+ TldrawUiDialogFooter,
+ TldrawUiDialogHeader,
+ TldrawUiDialogTitle,
+} from '../primitives/TldrawUiDialog'
+import { TldrawUiMenuCheckboxItem } from '../primitives/menus/TldrawUiMenuCheckboxItem'
+import { TldrawUiMenuGroup } from '../primitives/menus/TldrawUiMenuGroup'
+import { TldrawUiMenuItem } from '../primitives/menus/TldrawUiMenuItem'
+import { TldrawUiMenuSubmenu } from '../primitives/menus/TldrawUiMenuSubmenu'
/** @public */
export function DefaultDebugMenuContent() {
@@ -225,29 +232,29 @@ function ExampleDialog({
return (
<>
-
- {title}
-
-
-
{body}
-
+
+ {title}
+
+
+ {body}
+
{displayDontShowAgain && (
-
+
+ Don't show again
+
)}
-
-
-
+
+ {cancel}
+
+
onContinue()}>
+ {confirm}
+
+
>
)
}
diff --git a/packages/tldraw/src/lib/ui/components/EditLinkDialog.tsx b/packages/tldraw/src/lib/ui/components/EditLinkDialog.tsx
index 3609cb4fe..7ce1f0600 100644
--- a/packages/tldraw/src/lib/ui/components/EditLinkDialog.tsx
+++ b/packages/tldraw/src/lib/ui/components/EditLinkDialog.tsx
@@ -3,9 +3,15 @@ import { T, TLBaseShape, track, useEditor } from '@tldraw/editor'
import { useCallback, useEffect, useRef, useState } from 'react'
import { TLUiDialogProps } from '../context/dialogs'
import { useTranslation } from '../hooks/useTranslation/useTranslation'
-import { Button } from './primitives/Button'
-import { DialogBody, DialogCloseButton, DialogFooter, DialogHeader } from './primitives/Dialog'
-import { Input } from './primitives/Input'
+import { TldrawUiButton } from './primitives/Button/TldrawUiButton'
+import { TldrawUiButtonLabel } from './primitives/Button/TldrawUiButtonLabel'
+import {
+ TldrawUiDialogBody,
+ TldrawUiDialogCloseButton,
+ TldrawUiDialogFooter,
+ TldrawUiDialogHeader,
+} from './primitives/TldrawUiDialog'
+import { TldrawUiInput } from './primitives/TldrawUiInput'
// A url can either be invalid, or valid with a protocol, or valid without a protocol.
// For example, "aol.com" would be valid with a protocol ()
@@ -134,13 +140,13 @@ export const EditLinkDialogInner = track(function EditLinkDialogInner({
return (
<>
-
+
{msg('edit-link-title')}
-
-
-
+
+
+
-
-
-
+
+
+
+ {msg('edit-link-cancel')}
+
{isRemoving ? (
-
+
+ {msg('edit-link-clear')}
+
) : (
-
+ {msg('edit-link-save')}
+
)}
-
+
>
)
})
diff --git a/packages/tldraw/src/lib/ui/components/EmbedDialog.tsx b/packages/tldraw/src/lib/ui/components/EmbedDialog.tsx
index 5376225d0..d0cf3b87f 100644
--- a/packages/tldraw/src/lib/ui/components/EmbedDialog.tsx
+++ b/packages/tldraw/src/lib/ui/components/EmbedDialog.tsx
@@ -5,10 +5,16 @@ import { TLEmbedResult, getEmbedInfo } from '../../utils/embeds/embeds'
import { useAssetUrls } from '../context/asset-urls'
import { TLUiDialogProps } from '../context/dialogs'
import { untranslated, useTranslation } from '../hooks/useTranslation/useTranslation'
-import { Button } from './primitives/Button'
-import { DialogBody, DialogCloseButton, DialogFooter, DialogHeader } from './primitives/Dialog'
-import { Icon } from './primitives/Icon'
-import { Input } from './primitives/Input'
+import { TldrawUiButton } from './primitives/Button/TldrawUiButton'
+import { TldrawUiButtonLabel } from './primitives/Button/TldrawUiButtonLabel'
+import {
+ TldrawUiDialogBody,
+ TldrawUiDialogCloseButton,
+ TldrawUiDialogFooter,
+ TldrawUiDialogHeader,
+} from './primitives/TldrawUiDialog'
+import { TldrawUiIcon } from './primitives/TldrawUiIcon'
+import { TldrawUiInput } from './primitives/TldrawUiInput'
export const EmbedDialog = track(function EmbedDialog({ onClose }: TLUiDialogProps) {
const editor = useEditor()
@@ -30,18 +36,18 @@ export const EmbedDialog = track(function EmbedDialog({ onClose }: TLUiDialogPro
return (
<>
-
+
{embedDefinition
? `${msg('embed-title')} — ${embedDefinition.title}`
: msg('embed-title')}
-
-
+
+
{embedDefinition ? (
<>
-
-
+
Learn more.
-
+
)}
@@ -86,23 +92,25 @@ export const EmbedDialog = track(function EmbedDialog({ onClose }: TLUiDialogPro
{showError ? msg('embed-invalid-url') : '\xa0'}
)}
-
-