blue-react 11.0.0 → 11.0.2

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, activeClassName, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
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
- var _excluded = ["elementType", "className", "type", "variant", "color", "sm", "lg", "iconBefore", "iconAfter", "label", "labelHidden", "busy", "success", "active", "activeClassName"];
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
  */
package/index.js CHANGED
@@ -1,56 +1,23 @@
1
- // Import statements
2
- import A from "./dist/components/A.js"
3
- import ActionMenu from "./dist/components/ActionMenu.js"
4
- import Button from "./dist/components/Button.js"
5
- import Chevron from "./dist/components/Chevron.js"
6
- import HashRouter from "./dist/components/HashRouter.js"
7
- import Layout from "./dist/components/Layout.js"
8
- import Header from "./dist/components/Header.js"
9
- import HeaderTitle from "./dist/components/HeaderTitle.js"
10
- import IconMenuItem from "./dist/components/IconMenuItem.js"
11
- import Intro from "./dist/components/Intro.js"
12
- import LegacyMenuItem from "./dist/components/LegacyMenuItem.js"
13
- import MenuItem from "./dist/components/MenuItem.js"
14
- import Modal from "./dist/components/Modal.js"
15
- import { ModalProvider, useModal } from "./dist/components/ModalProvider.js"
16
- import Outside from "./dist/components/Outside.js"
17
- import Search from "./dist/components/Search.js"
18
- import SidebarMenu from "./dist/components/SidebarMenu.js"
19
- import SimpleLayout from "./dist/components/SimpleLayout.js"
20
- import SlimContainer from "./dist/components/SlimContainer.js"
21
- import Status from "./dist/components/Status.js"
22
- import { StatusProvider, useStatus } from "./dist/components/StatusProvider.js"
23
- import { ToastProvider, useToast } from "./dist/components/ToastProvider.js"
24
- import Utilities from "./dist/components/Utilities.js"
25
-
26
- // Export statements
27
- export {
28
- A,
29
- ActionMenu,
30
- Body,
31
- Button,
32
- Chevron,
33
- HashRouter,
34
- Layout,
35
- Header,
36
- HeaderTitle,
37
- IconMenuItem,
38
- Intro,
39
- LegacyMenuItem,
40
- MenuItem,
41
- Modal,
42
- ModalProvider,
43
- useModal,
44
- Outside,
45
- Page,
46
- Search,
47
- SidebarMenu,
48
- SimpleLayout,
49
- SlimContainer,
50
- Status,
51
- StatusProvider,
52
- useStatus,
53
- ToastProvider,
54
- useToast,
55
- Utilities
56
- }
1
+ export { default as A } from "./dist/components/A.js"
2
+ export { default as ActionMenu } from "./dist/components/ActionMenu.js"
3
+ export { default as Button } from "./dist/components/Button.js"
4
+ export { default as Chevron } from "./dist/components/Chevron.js"
5
+ export { default as HashRouter } from "./dist/components/HashRouter.js"
6
+ export { default as Layout } from "./dist/components/Layout.js"
7
+ export { default as Header } from "./dist/components/Header.js"
8
+ export { default as HeaderTitle } from "./dist/components/HeaderTitle.js"
9
+ export { default as IconMenuItem } from "./dist/components/IconMenuItem.js"
10
+ export { default as Intro } from "./dist/components/Intro.js"
11
+ export { default as LegacyMenuItem } from "./dist/components/LegacyMenuItem.js"
12
+ export { default as MenuItem } from "./dist/components/MenuItem.js"
13
+ export { default as Modal } from "./dist/components/Modal.js"
14
+ export { ModalProvider, useModal } from "./dist/components/ModalProvider.js"
15
+ export { default as Outside } from "./dist/components/Outside.js"
16
+ export { default as Search } from "./dist/components/Search.js"
17
+ export { default as SidebarMenu } from "./dist/components/SidebarMenu.js"
18
+ export { default as SimpleLayout } from "./dist/components/SimpleLayout.js"
19
+ export { default as SlimContainer } from "./dist/components/SlimContainer.js"
20
+ export { default as Status } from "./dist/components/Status.js"
21
+ export { StatusProvider, useStatus } from "./dist/components/StatusProvider.js"
22
+ export { ToastProvider, useToast } from "./dist/components/ToastProvider.js"
23
+ export { default as Utilities } from "./dist/components/Utilities.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blue-react",
3
- "version": "11.0.0",
3
+ "version": "11.0.2",
4
4
  "description": "Blue React Components",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "type": "module",