blue-react 11.0.0 → 11.0.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.
|
@@ -12,6 +12,7 @@ export type ButtonProps = ComponentProps<"a"> & ComponentProps<"button"> & {
|
|
|
12
12
|
label?: string;
|
|
13
13
|
labelHidden?: boolean;
|
|
14
14
|
busy?: boolean;
|
|
15
|
+
/** Button will be displayed as successful for 3 seconds. */
|
|
15
16
|
success?: boolean;
|
|
16
17
|
active?: boolean;
|
|
17
18
|
} & {
|
|
@@ -23,9 +24,5 @@ export type ButtonProps = ComponentProps<"a"> & ComponentProps<"button"> & {
|
|
|
23
24
|
* For compatibility with React Router NavLink
|
|
24
25
|
*/
|
|
25
26
|
exact?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* For compatibility with React Router NavLink
|
|
28
|
-
*/
|
|
29
|
-
activeClassName?: string;
|
|
30
27
|
};
|
|
31
|
-
export default function Button({ elementType, className, type, variant, color, sm, lg, iconBefore, iconAfter, label, labelHidden, busy: busyProp, success: successProp, active,
|
|
28
|
+
export default function Button({ elementType, className, type, variant, color, sm, lg, iconBefore, iconAfter, label, labelHidden, busy: busyProp, success: successProp, active, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
var _excluded = ["elementType", "className", "type", "variant", "color", "sm", "lg", "iconBefore", "iconAfter", "label", "labelHidden", "busy", "success", "active"];
|
|
2
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
5
|
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
|
5
6
|
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
|
|
6
7
|
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
8
8
|
function _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }
|
|
9
9
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
10
10
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
@@ -50,8 +50,6 @@ export default function Button(_ref) {
|
|
|
50
50
|
busyProp = _ref.busy,
|
|
51
51
|
successProp = _ref.success,
|
|
52
52
|
active = _ref.active,
|
|
53
|
-
_ref$activeClassName = _ref.activeClassName,
|
|
54
|
-
activeClassName = _ref$activeClassName === void 0 ? "current" : _ref$activeClassName,
|
|
55
53
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
56
54
|
var Comp = elementType || (props.href ? "a" : "button");
|
|
57
55
|
var _useState = useState(false),
|
|
@@ -67,12 +65,6 @@ export default function Button(_ref) {
|
|
|
67
65
|
}
|
|
68
66
|
}, [successProp]);
|
|
69
67
|
var variantClass = getButtonVariantClass(variant, color);
|
|
70
|
-
var isNavLink = _typeof(elementType) === "object" && elementType !== null && "displayName" in elementType && elementType.displayName === "NavLink";
|
|
71
|
-
if (isNavLink) {
|
|
72
|
-
props = _objectSpread(_objectSpread({}, props), {}, {
|
|
73
|
-
activeClassName: activeClassName
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
68
|
return /*#__PURE__*/_jsx(Comp, _objectSpread(_objectSpread({
|
|
77
69
|
type: Comp === "button" && type === undefined ? "button" : type,
|
|
78
70
|
className: clsx("btn", _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, variantClass, !success), "btn-success", success), "btn-sm", sm), "btn-lg", lg), "icon-link", busyProp || iconBefore !== null || iconAfter !== null), "active", active), className)
|
|
@@ -12,6 +12,7 @@ export interface IconMenuItemProps extends LegacyMenuItemProps {
|
|
|
12
12
|
horizontalOnOpenSidebar?: boolean;
|
|
13
13
|
}
|
|
14
14
|
/**
|
|
15
|
+
* @deprecated
|
|
15
16
|
* Variant of `MenuItem` to primarily display an icon without a label.
|
|
16
17
|
* The label prop will be displayed as a tooltip.
|
|
17
18
|
*/
|
|
@@ -11,6 +11,7 @@ import React from "react";
|
|
|
11
11
|
import MenuItem from "./LegacyMenuItem.js";
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
/**
|
|
14
|
+
* @deprecated
|
|
14
15
|
* Variant of `MenuItem` to primarily display an icon without a label.
|
|
15
16
|
* The label prop will be displayed as a tooltip.
|
|
16
17
|
*/
|