UNPKG

@light-sheet/react

Version:

FortuneSheet is a drop-in javascript spreadsheet library that provides rich features like Excel and Google Sheets

30 lines 887 B
import React from "react"; import SVGIcon from "../SVGIcon"; var Button = function Button(_ref) { var tooltip = _ref.tooltip, onClick = _ref.onClick, iconId = _ref.iconId, disabled = _ref.disabled, selected = _ref.selected, children = _ref.children; // const style: CSSProperties = { userSelect: "none" }; return /*#__PURE__*/React.createElement("div", { className: "fortune-toolbar-button fortune-toolbar-item", onClick: onClick, tabIndex: 0, "data-tips": tooltip, role: "button", "aria-label": tooltip, style: selected ? { backgroundColor: "#E7E5EB" } : {} }, /*#__PURE__*/React.createElement(SVGIcon, { name: iconId, style: disabled ? { opacity: 0.3 } : {} }), tooltip && /*#__PURE__*/React.createElement("div", { className: "fortune-tooltip" }, tooltip), children); }; export default Button;