UNPKG

@coveord/plasma-mantine

Version:

A Plasma flavoured Mantine theme

52 lines (51 loc) 2.26 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 _sliced_to_array = require("@swc/helpers/_/_sliced_to_array"); var _to_array = require("@swc/helpers/_/_to_array"); var _jsxruntime = require("react/jsx-runtime"); var _core = require("@mantine/core"); var _react = require("react"); var _createPolymorphicComponent = require("../../utils/createPolymorphicComponent.js"); var _ButtonWithDisabledTooltip = /*#__PURE__*/ (0, _react.forwardRef)(function(_0, _1) { var _ref = [ _0, _1 ], _ref1 = _to_array._(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), disabledTooltip = _ref2.disabledTooltip, disabled = _ref2.disabled, children = _ref2.children, disabledTooltipProps = _ref2.disabledTooltipProps, fullWidth = _ref2.fullWidth, others = _object_without_properties._(_ref2, [ "disabledTooltip", "disabled", "children", "disabledTooltipProps", "fullWidth" ]), _rest1 = _sliced_to_array._(_rest, 1), ref = _rest1[0]; 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, _createPolymorphicComponent.createPolymorphicComponent)(_ButtonWithDisabledTooltip); //# sourceMappingURL=ButtonWithDisabledTooltip.js.map