UNPKG

@coveord/plasma-mantine

Version:

A Plasma flavoured Mantine theme

25 lines (24 loc) 1.03 kB
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime"; import { Box, Tooltip } from '@mantine/core'; import { forwardRef } from 'react'; import { createPolymorphicComponent } from '../../utils'; const _ButtonWithDisabledTooltip = /*#__PURE__*/ forwardRef(({ disabledTooltip, disabled, children, disabledTooltipProps, fullWidth, ...others }, ref)=>disabledTooltip ? /*#__PURE__*/ _jsx(Tooltip, { label: disabledTooltip, disabled: !disabled, ...disabledTooltipProps, children: /*#__PURE__*/ _jsx(Box, { ref: ref, style: { '&:hover': { cursor: 'not-allowed' }, width: fullWidth && '100%' }, ...others, children: children }) }) : /*#__PURE__*/ _jsx(_Fragment, { children: children })); export const ButtonWithDisabledTooltip = createPolymorphicComponent(_ButtonWithDisabledTooltip); //# sourceMappingURL=ButtonWithDisabledTooltip.js.map