UNPKG

@rainbow-me/rainbowkit

Version:
75 lines (70 loc) 1.73 kB
"use client"; import { touchableStyles } from "./chunk-2W63IDAD.js"; import { isMobile } from "./chunk-N6EWR2LO.js"; import { Box } from "./chunk-ZKEPQLOV.js"; // src/components/MenuButton/MenuButton.tsx import React from "react"; // src/components/MenuButton/MenuButton.css.ts var unsetBackgroundOnHover = "v9horb0"; // src/components/MenuButton/MenuButton.tsx var MenuButton = React.forwardRef( ({ children, currentlySelected = false, onClick, testId, ...urlProps }, ref) => { const mobile = isMobile(); return /* @__PURE__ */ React.createElement( Box, { as: "button", borderRadius: "menuButton", disabled: currentlySelected, display: "flex", onClick, ref, testId, type: "button" }, /* @__PURE__ */ React.createElement( Box, { borderRadius: "menuButton", className: [ mobile ? unsetBackgroundOnHover : void 0, !currentlySelected && touchableStyles({ active: "shrink" }) ], padding: mobile ? "8" : "6", transition: "default", width: "full", ...currentlySelected ? { background: "accentColor", borderColor: "selectedOptionBorder", borderStyle: "solid", borderWidth: "1", boxShadow: "selectedOption", color: "accentColorForeground" } : { background: { hover: "menuItemBackground" }, color: "modalText", transition: "default" }, ...urlProps }, children ) ); } ); MenuButton.displayName = "MenuButton"; export { MenuButton };