diff --git a/packages/tldraw/src/components/Primitives/ToolButton/ToolButton.tsx b/packages/tldraw/src/components/Primitives/ToolButton/ToolButton.tsx index 4b6a970e0..f6412c995 100644 --- a/packages/tldraw/src/components/Primitives/ToolButton/ToolButton.tsx +++ b/packages/tldraw/src/components/Primitives/ToolButton/ToolButton.tsx @@ -141,6 +141,7 @@ export const StyledToolButton = styled('button', { [`& ${StyledToolButtonInner}`]: { fontSize: '$1', padding: '0 $3', + gap: '$3', }, }, circle: { diff --git a/packages/tldraw/src/components/Primitives/icons/RedoIcon.tsx b/packages/tldraw/src/components/Primitives/icons/RedoIcon.tsx index 516c8972b..030fa9d58 100644 --- a/packages/tldraw/src/components/Primitives/icons/RedoIcon.tsx +++ b/packages/tldraw/src/components/Primitives/icons/RedoIcon.tsx @@ -2,17 +2,8 @@ import * as React from 'react' export function RedoIcon(props: React.SVGProps): JSX.Element { return ( - - - + + ) } diff --git a/packages/tldraw/src/components/Primitives/icons/UndoIcon.tsx b/packages/tldraw/src/components/Primitives/icons/UndoIcon.tsx index d6215a413..b8fb9467e 100644 --- a/packages/tldraw/src/components/Primitives/icons/UndoIcon.tsx +++ b/packages/tldraw/src/components/Primitives/icons/UndoIcon.tsx @@ -2,17 +2,8 @@ import * as React from 'react' export function UndoIcon(props: React.SVGProps): JSX.Element { return ( - - - + + ) } diff --git a/packages/tldraw/src/components/TopPanel/StyleMenu/StyleMenu.tsx b/packages/tldraw/src/components/TopPanel/StyleMenu/StyleMenu.tsx index f4bb1406d..211412991 100644 --- a/packages/tldraw/src/components/TopPanel/StyleMenu/StyleMenu.tsx +++ b/packages/tldraw/src/components/TopPanel/StyleMenu/StyleMenu.tsx @@ -38,6 +38,7 @@ import { TextAlignLeftIcon, TextAlignRightIcon, } from '@radix-ui/react-icons' +import { RowButton } from '~components/Primitives/RowButton' const currentStyleSelector = (s: TDSnapshot) => s.appState.currentStyle const selectedIdsSelector = (s: TDSnapshot) => @@ -149,22 +150,25 @@ export const StyleMenu = React.memo(function ColorMenu(): JSX.Element { return ( - - - {displayedStyle.isFilled && ( - - )} - {DASH_ICONS[displayedStyle.dash]} - - + + + Styles + + {displayedStyle.isFilled && ( + + )} + {DASH_ICONS[displayedStyle.dash]} + + + Color diff --git a/packages/tldraw/src/components/TopPanel/TopPanel.tsx b/packages/tldraw/src/components/TopPanel/TopPanel.tsx index 9925aecac..10c487927 100644 --- a/packages/tldraw/src/components/TopPanel/TopPanel.tsx +++ b/packages/tldraw/src/components/TopPanel/TopPanel.tsx @@ -5,6 +5,10 @@ import { PageMenu } from './PageMenu' import { ZoomMenu } from './ZoomMenu' import { StyleMenu } from './StyleMenu' import { Panel } from '~components/Primitives/Panel' +import { ToolButton } from '~components/Primitives/ToolButton' +import { RedoIcon, UndoIcon } from '~components/Primitives/icons' +import { breakpoints } from '~components/breakpoints' +import { useTldrawApp } from '~hooks' interface TopPanelProps { readOnly: boolean @@ -23,6 +27,8 @@ export function TopPanel({ showZoom, showSponsorLink, }: TopPanelProps) { + const app = useTldrawApp() + return ( {(showMenu || showPages) && ( @@ -35,6 +41,14 @@ export function TopPanel({ {(showStyles || showZoom) && ( {showStyles && !readOnly && } + + + + + + + + {showZoom && } )} @@ -60,3 +74,18 @@ const StyledSpacer = styled('div', { flexGrow: 2, pointerEvents: 'none', }) + +const MobileOnly = styled('div', { + display: 'flex', + flexDirection: 'row', + variants: { + bp: { + small: { + display: 'inherit', + }, + medium: { + display: 'none', + }, + }, + }, +}) diff --git a/packages/tldraw/src/components/breakpoints.tsx b/packages/tldraw/src/components/breakpoints.tsx index dfd64f662..6100e1bdb 100644 --- a/packages/tldraw/src/components/breakpoints.tsx +++ b/packages/tldraw/src/components/breakpoints.tsx @@ -3,4 +3,9 @@ /* -------------------------------------------------- */ // eslint-disable-next-line @typescript-eslint/no-explicit-any -export const breakpoints: any = { '@initial': 'mobile', '@sm': 'small' } +export const breakpoints: any = { + '@initial': 'mobile', + '@micro': 'micro', + '@sm': 'small', + '@md': 'medium', +} diff --git a/packages/tldraw/src/styles/stitches.config.ts b/packages/tldraw/src/styles/stitches.config.ts index 2a800f7ca..e1feafc0e 100644 --- a/packages/tldraw/src/styles/stitches.config.ts +++ b/packages/tldraw/src/styles/stitches.config.ts @@ -32,7 +32,8 @@ const { styled, createTheme } = createStitches({ key: '1px 1px rgba(0,0,0,1)', panel: `0px 0px 16px -1px rgba(0, 0, 0, 0.05), 0px 0px 16px -8px rgba(0, 0, 0, 0.05), - 0px 0px 16px -12px rgba(0, 0, 0, 0.12)`, + 0px 0px 16px -12px rgba(0, 0, 0, 0.12), + 0px 0px 2px 0px rgba(0, 0, 0, 0.08)`, }, space: { 0: '2px',