UNPKG

@wener/console

Version:

Base console UI toolkit

22 lines (21 loc) 1.24 kB
import React, { forwardRef } from "react"; import { PiAppWindowLight } from "react-icons/pi"; import { cn } from "../../tw/index.js"; import { getWindowDragHandleClassname } from "../const.js"; import { WindowsWindowController } from "./WindowsWindowController.js"; export const WindowsWindowFrame = /*#__PURE__*/ forwardRef(({ className, icon, controller, title, children, onToggleMaximize, ...props }, ref) => { return /*#__PURE__*/ React.createElement("div", { className: cn("group/window flex flex-col", "border-color 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 pl-2`, onDoubleClick: () => { onToggleMaximize?.(); } }, icon ?? /*#__PURE__*/ React.createElement(PiAppWindowLight, null), /*#__PURE__*/ React.createElement("h4", { className: "flex-1 truncate px-1 leading-7" }, title), controller ?? /*#__PURE__*/ React.createElement(WindowsWindowController, null)), children); }); //# sourceMappingURL=WindowsWindowFrame.js.map