UNPKG

@coveord/plasma-mantine

Version:

A Plasma flavoured Mantine theme

47 lines (46 loc) 1.91 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ButtonWithDisabledTooltip", { enumerable: true, get: function() { return ButtonWithDisabledTooltip; } }); var _object_spread = require("@swc/helpers/_/_object_spread"); var _object_spread_props = require("@swc/helpers/_/_object_spread_props"); var _object_without_properties = require("@swc/helpers/_/_object_without_properties"); var _jsxruntime = require("react/jsx-runtime"); var _core = require("@mantine/core"); var _react = require("react"); var _utils = require("../../utils"); var _ButtonWithDisabledTooltip = /*#__PURE__*/ (0, _react.forwardRef)(function(_param, ref) { var disabledTooltip = _param.disabledTooltip, disabled = _param.disabled, children = _param.children, disabledTooltipProps = _param.disabledTooltipProps, fullWidth = _param.fullWidth, others = _object_without_properties._(_param, [ "disabledTooltip", "disabled", "children", "disabledTooltipProps", "fullWidth" ]); return disabledTooltip ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Tooltip, _object_spread_props._(_object_spread._({ label: disabledTooltip, disabled: !disabled }, disabledTooltipProps), { children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.Box, _object_spread_props._(_object_spread._({ ref: ref, style: { '&:hover': { cursor: 'not-allowed' }, width: fullWidth && '100%' } }, others), { children: children })) })) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_jsxruntime.Fragment, { children: children }); }); var ButtonWithDisabledTooltip = (0, _utils.createPolymorphicComponent)(_ButtonWithDisabledTooltip); //# sourceMappingURL=ButtonWithDisabledTooltip.js.map