32 lines
1.3 KiB
TypeScript
32 lines
1.3 KiB
TypeScript
import type { ComponentPropsWithoutRef } from "react";
|
|
|
|
import { cn } from "../lib/utils";
|
|
import { COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS } from "../workspaceTitlebar";
|
|
|
|
/**
|
|
* Shared workspace top-bar geometry. The height is `!important` so callers cannot
|
|
* grow the bar and pull its content off the sidebar header's center line.
|
|
*/
|
|
export function WorkspacePageHeader({
|
|
electron = false,
|
|
reserveNativeControls = electron,
|
|
className,
|
|
...props
|
|
}: ComponentPropsWithoutRef<"header"> & {
|
|
readonly electron?: boolean;
|
|
readonly reserveNativeControls?: boolean;
|
|
}) {
|
|
return (
|
|
<header
|
|
className={cn(
|
|
"flex h-[var(--workspace-topbar-height)]! min-h-[var(--workspace-topbar-height)]! max-h-[var(--workspace-topbar-height)]! shrink-0 items-center gap-3 pl-(--workspace-gutter-start) pr-(--workspace-gutter-end) [[data-panel-animations=true]_&]:motion-safe:transition-[padding-left,padding-right] [[data-panel-animations=true]_&]:motion-safe:duration-(--panel-animation-duration) [[data-panel-animations=true]_&]:motion-safe:ease-out",
|
|
electron && "drag-region",
|
|
reserveNativeControls && "wco:pr-(--workspace-native-controls-inset)",
|
|
COLLAPSED_SIDEBAR_TITLEBAR_INSET_CLASS,
|
|
className,
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
}
|