{
const [isDragging, setIsDragging] = React.useState(false)
const [isKeyboardDrag, setIsKeyboardDrag] = React.useState(false)
@@ -260,7 +268,8 @@ const VerticalDivider: React.FC
{draggable ? (
// Drag handle
- {
- if (event.button === 0) {
- setIsDragging(true)
- onDragStart?.()
- }
- }}
- onKeyDown={(event: React.KeyboardEvent) => {
- if (
- event.key === 'ArrowLeft' ||
- event.key === 'ArrowRight' ||
- event.key === 'ArrowUp' ||
- event.key === 'ArrowDown'
- ) {
- setIsKeyboardDrag(true)
- onDragStart?.()
- }
- }}
- onDoubleClick={onDoubleClick}
- />
+ <>
+ {
+ if (event.button === 0) {
+ setIsDragging(true)
+ onDragStart?.()
+ }
+ }}
+ onKeyDown={event => {
+ if (
+ event.key === 'ArrowLeft' ||
+ event.key === 'ArrowRight' ||
+ event.key === 'ArrowUp' ||
+ event.key === 'ArrowDown'
+ ) {
+ setIsKeyboardDrag(true)
+ onDragStart?.()
+ }
+ }}
+ onDoubleClick={onDoubleClick}
+ />
+ >
) : null}
-
+
)
}
@@ -336,7 +355,7 @@ export type PageLayoutHeaderProps = {
hidden?: boolean | ResponsiveValue
className?: string
style?: React.CSSProperties
-}
+} & SxProp
const Header: React.FC> = ({
'aria-label': label,
@@ -347,6 +366,7 @@ const Header: React.FC> = ({
hidden = false,
children,
style,
+ sx,
className,
}) => {
// Combine divider and dividerWhenNarrow for backwards compatibility
@@ -360,10 +380,12 @@ const Header: React.FC> = ({
const {rowGap} = React.useContext(PageLayoutContext)
return (
- > = ({
} as React.CSSProperties
}
/>
-
+
)
}
@@ -421,7 +443,7 @@ export type PageLayoutContentProps = {
hidden?: boolean | ResponsiveValue
className?: string
style?: React.CSSProperties
-}
+} & SxProp
// TODO: Account for pane width when centering content
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -440,17 +462,19 @@ const Content: React.FC> = ({
padding = 'none',
hidden = false,
children,
+ sx,
className,
style,
}) => {
const isHidden = useResponsiveValue(hidden, false)
- const Component = as
return (
-
@@ -465,7 +489,7 @@ const Content: React.FC> = ({
>
{children}
-
+
)
}
@@ -539,7 +563,7 @@ export type PageLayoutPaneProps = {
id?: string
className?: string
style?: React.CSSProperties
-}
+} & SxProp
// eslint-disable-next-line @typescript-eslint/no-unused-vars
const panePositions = {
@@ -577,6 +601,7 @@ const Pane = React.forwardRef