import { forwardRef } from "react"; import { SettingsTiny } from "components/Icons/SettingsTiny"; import { Popover } from "components/Popover"; export const SettingsTriggerButton = forwardRef< HTMLButtonElement, React.ButtonHTMLAttributes >(({ "aria-label": ariaLabel = "Settings", ...props }, ref) => ( )); SettingsTriggerButton.displayName = "SettingsTriggerButton"; export function BlockSettings(props: { // Names the block for the trigger's aria-label; nothing renders it. label: string; children: React.ReactNode; // Width only — the rest of the shell is shared across every block. className?: string; }) { return ( e.preventDefault()} trigger={ e.stopPropagation()} /> } > {/* Clicks here would otherwise bubble (through the portal) to the page wrapper, which refocuses the page and unmounts the options bar. */}
e.stopPropagation()} > {props.children}
); }