UNPKG

@wener/console

Version:

Base console UI toolkit

23 lines (22 loc) 1.21 kB
import React, { forwardRef } from "react"; import { cn } from "../../tw/index.js"; import { getWindowDragHandleClassname } from "../const.js"; import { MacOSWindowController } from "./MacOSWindowController.js"; export const MacOSWindowFrame = /*#__PURE__*/ forwardRef(({ className, controller, title, children, onToggleMaximize, ...props }, ref) => { return /*#__PURE__*/ React.createElement("div", { className: cn("group/window flex flex-col", "border-color rounded border shadow", "focus-within:shadow-lg", "bg-base-100", className), tabIndex: -1, ref: ref, ...props }, /*#__PURE__*/ React.createElement("header", { className: `${getWindowDragHandleClassname()} flex h-7 cursor-default items-center justify-between bg-base-200 px-1.5`, onDoubleClick: () => { onToggleMaximize?.(); } }, controller ?? /*#__PURE__*/ React.createElement(MacOSWindowController, null), /*#__PURE__*/ React.createElement("h4", { className: "flex-1 truncate px-1 text-center leading-7" }, title), /*#__PURE__*/ React.createElement("div", { className: "w-16" })), children); }); //# sourceMappingURL=MacOSWindowFrame.js.map