@true-engineering/true-react-common-ui-kit 1.12.0 → 1.12.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactElement, ReactNode, ButtonHTMLAttributes, MouseEvent } from 'react';
|
|
2
2
|
import { ICommonProps } from '../../types';
|
|
3
3
|
import { IThemedPreloaderProps } from '../ThemedPreloader';
|
|
4
4
|
import { IIconType } from '../Icon';
|
|
@@ -25,4 +25,4 @@ export interface IButtonProps extends ICommonProps {
|
|
|
25
25
|
onClick?(event: MouseEvent<HTMLButtonElement>): void | Promise<void>;
|
|
26
26
|
onMouseDown?(event: MouseEvent<HTMLButtonElement>): void | Promise<void>;
|
|
27
27
|
}
|
|
28
|
-
export declare const Button:
|
|
28
|
+
export declare const Button: import("react").ForwardRefExoticComponent<IButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
@@ -6105,7 +6105,7 @@ var BUTTON_VIEWS = [
|
|
|
6105
6105
|
"text",
|
|
6106
6106
|
"custom"
|
|
6107
6107
|
];
|
|
6108
|
-
var Button = function(param) {
|
|
6108
|
+
var Button = /* @__PURE__ */ forwardRef(function(param, ref) {
|
|
6109
6109
|
var _param_type = param.type, type = _param_type === void 0 ? "button" : _param_type, children = param.children, _param_size = param.size, size = _param_size === void 0 ? "l" : _param_size, _param_view = param.view, view = _param_view === void 0 ? "primary" : _param_view, _param_isFullWidth = param.isFullWidth, isFullWidth = _param_isFullWidth === void 0 ? false : _param_isFullWidth, _param_isInline = param.isInline, isInline = _param_isInline === void 0 ? false : _param_isInline, _param_isDisabled = param.isDisabled, isDisabled = _param_isDisabled === void 0 ? false : _param_isDisabled, _param_isActive = param.isActive, isActive = _param_isActive === void 0 ? false : _param_isActive, _param_isLoading = param.isLoading, isLoading = _param_isLoading === void 0 ? false : _param_isLoading, _param_shouldSkipTabNavigation = param.shouldSkipTabNavigation, shouldSkipTabNavigation = _param_shouldSkipTabNavigation === void 0 ? false : _param_shouldSkipTabNavigation, data = param.data, testId = param.testId, tweakStyles = param.tweakStyles, icon = param.icon, _param_iconPosition = param.iconPosition, iconPosition = _param_iconPosition === void 0 ? "left" : _param_iconPosition, _param_preloaderType = param.preloaderType, preloaderType = _param_preloaderType === void 0 ? "dots" : _param_preloaderType, onClick = param.onClick, onMouseDown = param.onMouseDown;
|
|
6110
6110
|
var _useTheme = useTheme("Button", styles$D, tweakStyles), classes = _useTheme.classes, componentStyles = _useTheme.componentStyles;
|
|
6111
6111
|
var tweakPreloaderStyles = useMemo(function() {
|
|
@@ -6119,6 +6119,7 @@ var Button = function(param) {
|
|
|
6119
6119
|
var hasNoAction = isDisabled || isLoading;
|
|
6120
6120
|
var _obj, _obj1;
|
|
6121
6121
|
return /* @__PURE__ */ jsxs("button", _object_spread_props$v(_object_spread$E({
|
|
6122
|
+
ref,
|
|
6122
6123
|
type,
|
|
6123
6124
|
className: clsx(classes.root, classes[size], classes[view], (_obj = {}, _define_property$G(_obj, classes.disabled, isDisabled), _define_property$G(_obj, classes.fullWidth, isFullWidth), _define_property$G(_obj, classes.inline, isInline), _define_property$G(_obj, classes.active, isActive), _define_property$G(_obj, classes.loading, isLoading), _define_property$G(_obj, classes.onlyIcon, hasIcon && !hasChildren), _obj)),
|
|
6124
6125
|
tabIndex: shouldSkipTabNavigation ? -1 : void 0,
|
|
@@ -6152,7 +6153,7 @@ var Button = function(param) {
|
|
|
6152
6153
|
})
|
|
6153
6154
|
]
|
|
6154
6155
|
}));
|
|
6155
|
-
};
|
|
6156
|
+
});
|
|
6156
6157
|
var styles$C = {
|
|
6157
6158
|
root: {
|
|
6158
6159
|
cursor: "pointer",
|