UNPKG

@coveord/plasma-mantine

Version:

A Plasma flavoured Mantine theme

104 lines (103 loc) 4.25 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "ActionIcon", { enumerable: true, get: function() { return ActionIcon; } }); var _object_spread = require("@swc/helpers/_/_object_spread"); 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 _useClickWithLoading = require("../../hooks/useClickWithLoading.js"); var _ButtonWithDisabledTooltip = require("../Button/ButtonWithDisabledTooltip.js"); var ActionIcon = (0, _core.polymorphicFactory)(function(_0, _1) { var _ref = [ _0, _1 ], _ref1 = _to_array._(_ref), _ref2 = _ref1[0], _rest = _ref1.slice(1), disabledTooltip = _ref2.disabledTooltip, disabled = _ref2.disabled, disabledTooltipProps = _ref2.disabledTooltipProps, loading = _ref2.loading, onClick = _ref2.onClick, others = _object_without_properties._(_ref2, [ "disabledTooltip", "disabled", "disabledTooltipProps", "loading", "onClick" ]), _rest1 = _sliced_to_array._(_rest, 1), ref = _rest1[0]; var _useClickWithLoading1 = (0, _useClickWithLoading.useClickWithLoading)(onClick), isLoading = _useClickWithLoading1.isLoading, handleClick = _useClickWithLoading1.handleClick; return /*#__PURE__*/ (0, _jsxruntime.jsx)(_ButtonWithDisabledTooltip.ButtonWithDisabledTooltip, { disabled: disabled, disabledTooltip: disabledTooltip, disabledTooltipProps: disabledTooltipProps, fullWidth: others.fullWidth, children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_core.ActionIcon, _object_spread._({ loaderProps: { type: 'oval' }, ref: ref, loading: isLoading || loading, onClick: handleClick, disabled: disabled }, others)) }); }); var ActionIconPrimary = ActionIcon.withProps({ variant: 'filled' }); var ActionIconSecondary = ActionIcon.withProps({ variant: 'light', color: 'var(--coveo-color-text-primary)' }); var ActionIconTertiary = ActionIcon.withProps({ variant: 'default', color: 'var(--coveo-color-text-primary)' }); var ActionIconQuaternary = ActionIcon.withProps({ variant: 'subtle', color: 'var(--coveo-color-text-primary)' }); var ActionIconDestructive = ActionIcon.withProps({ variant: 'filled', color: 'var(--mantine-color-error)' }); var ActionIconDestructiveSecondary = ActionIcon.withProps({ variant: 'light', color: 'var(--mantine-color-error)' }); var ActionIconDestructiveTertiary = ActionIcon.withProps({ variant: 'default', vars: function vars() { return { root: { '--ai-color': 'var(--mantine-color-error)' } }; } }); var ActionIconDestructiveQuaternary = ActionIcon.withProps({ variant: 'subtle', color: 'var(--mantine-color-error)' }); ActionIcon.Group = _core.ActionIcon.Group; ActionIcon.Primary = ActionIconPrimary; ActionIcon.Secondary = ActionIconSecondary; ActionIcon.Tertiary = ActionIconTertiary; ActionIcon.Quaternary = ActionIconQuaternary; ActionIcon.DestructivePrimary = ActionIconDestructive; ActionIcon.DestructiveSecondary = ActionIconDestructiveSecondary; ActionIcon.DestructiveTertiary = ActionIconDestructiveTertiary; ActionIcon.DestructiveQuaternary = ActionIconDestructiveQuaternary; ActionIcon.displayName = 'ActionIcon'; ActionIcon.Group.displayName = 'ActionIcon.Group'; ActionIconPrimary.displayName = 'ActionIcon.Primary'; ActionIconSecondary.displayName = 'ActionIcon.Secondary'; ActionIconTertiary.displayName = 'ActionIcon.Tertiary'; ActionIconQuaternary.displayName = 'ActionIcon.Quaternary'; ActionIconDestructive.displayName = 'ActionIcon.DestructivePrimary'; ActionIconDestructiveSecondary.displayName = 'ActionIcon.DestructiveSecondary'; ActionIconDestructiveTertiary.displayName = 'ActionIcon.DestructiveTertiary'; ActionIconDestructiveQuaternary.displayName = 'ActionIcon.DestructiveQuaternary'; //# sourceMappingURL=ActionIcon.js.map