blue-react 10.2.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.
Files changed (76) hide show
  1. package/README.md +41 -84
  2. package/dist/components/A.js +13 -6
  3. package/dist/components/ActionMenu.js +27 -22
  4. package/dist/components/Actions.js +30 -22
  5. package/dist/components/Button.d.ts +28 -0
  6. package/dist/components/Button.js +111 -0
  7. package/dist/components/Chevron.js +11 -9
  8. package/dist/components/HashRouter.js +9 -6
  9. package/dist/components/Header.js +5 -3
  10. package/dist/components/HeaderTitle.js +31 -26
  11. package/dist/components/IconMenuItem.d.ts +3 -2
  12. package/dist/components/IconMenuItem.js +18 -10
  13. package/dist/components/Intro.js +23 -17
  14. package/dist/components/Layout.js +79 -71
  15. package/dist/{types/components/MenuItem.d.ts → components/LegacyMenuItem.d.ts} +150 -149
  16. package/dist/components/LegacyMenuItem.js +170 -0
  17. package/dist/components/MenuItem.d.ts +13 -149
  18. package/dist/components/MenuItem.js +168 -153
  19. package/dist/components/Modal.js +62 -49
  20. package/dist/components/ModalProvider.js +43 -35
  21. package/dist/components/Outside.js +5 -3
  22. package/dist/components/Search.js +69 -60
  23. package/dist/components/SidebarMenu.js +9 -6
  24. package/dist/components/SimpleLayout.js +16 -11
  25. package/dist/components/SlimContainer.js +8 -5
  26. package/dist/components/Status.js +56 -40
  27. package/dist/components/StatusProvider.js +22 -14
  28. package/dist/components/Tab.js +28 -19
  29. package/dist/components/Tabs.js +8 -5
  30. package/dist/components/ToastProvider.js +55 -44
  31. package/dist/components/shared.js +4 -1
  32. package/index.d.ts +5 -5
  33. package/index.js +4 -2
  34. package/package.json +14 -12
  35. package/dist/components/ActionMenuItem.js +0 -73
  36. package/dist/components/ActionMenuSwitch.js +0 -44
  37. package/dist/components/Body.d.ts +0 -21
  38. package/dist/components/Body.js +0 -25
  39. package/dist/components/Caret.js +0 -25
  40. package/dist/components/Layout/LayoutHeader.d.ts +0 -4
  41. package/dist/components/Layout/LayoutHeader.js +0 -25
  42. package/dist/components/Layout/LayoutMain.d.ts +0 -5
  43. package/dist/components/Layout/LayoutMain.js +0 -17
  44. package/dist/components/Page.d.ts +0 -13
  45. package/dist/components/Page.js +0 -39
  46. package/dist/components/SidebarMenuItem.js +0 -115
  47. package/dist/components/SidebarToggler.d.ts +0 -11
  48. package/dist/components/SidebarToggler.js +0 -24
  49. package/dist/components/Switch.js +0 -65
  50. package/dist/types/components/A.d.ts +0 -9
  51. package/dist/types/components/ActionMenu.d.ts +0 -25
  52. package/dist/types/components/ActionMenuItem.d.ts +0 -35
  53. package/dist/types/components/ActionMenuSwitch.d.ts +0 -12
  54. package/dist/types/components/Body.d.ts +0 -21
  55. package/dist/types/components/Caret.d.ts +0 -18
  56. package/dist/types/components/Chevron.d.ts +0 -17
  57. package/dist/types/components/Header.d.ts +0 -8
  58. package/dist/types/components/HeaderTitle.d.ts +0 -40
  59. package/dist/types/components/IconMenuItem.d.ts +0 -19
  60. package/dist/types/components/Intro.d.ts +0 -23
  61. package/dist/types/components/Layout.d.ts +0 -144
  62. package/dist/types/components/Modal.d.ts +0 -30
  63. package/dist/types/components/ModalProvider.d.ts +0 -21
  64. package/dist/types/components/Outside.d.ts +0 -17
  65. package/dist/types/components/Page.d.ts +0 -12
  66. package/dist/types/components/Search.d.ts +0 -36
  67. package/dist/types/components/SidebarMenu.d.ts +0 -32
  68. package/dist/types/components/SidebarMenuItem.d.ts +0 -22
  69. package/dist/types/components/SidebarToggler.d.ts +0 -10
  70. package/dist/types/components/SlimContainer.d.ts +0 -10
  71. package/dist/types/components/Status.d.ts +0 -12
  72. package/dist/types/components/StatusProvider.d.ts +0 -15
  73. package/dist/types/components/Switch.d.ts +0 -33
  74. package/dist/types/components/ToastProvider.d.ts +0 -22
  75. package/dist/types/components/Utilities.d.ts +0 -41
  76. package/dist/types/components/shared.d.ts +0 -15
@@ -1,10 +1,17 @@
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); }
1
2
  var _excluded = ["label", "outerClass", "tooltipClass", "horizontalOnOpenSidebar", "className"];
2
- function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
3
- function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var s = Object.getOwnPropertySymbols(e); for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
4
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (e.includes(n)) continue; t[n] = r[n]; } return t; }
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; }
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; }
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; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
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); }
8
+ function _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }
9
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
10
  import React from "react";
6
- import MenuItem from "./MenuItem.js";
11
+ import MenuItem from "./LegacyMenuItem.js";
12
+ import { jsx as _jsx } from "react/jsx-runtime";
7
13
  /**
14
+ * @deprecated
8
15
  * Variant of `MenuItem` to primarily display an icon without a label.
9
16
  * The label prop will be displayed as a tooltip.
10
17
  */
@@ -19,11 +26,12 @@ export default function IconMenuItem(_ref) {
19
26
  _ref$className = _ref.className,
20
27
  className = _ref$className === void 0 ? "" : _ref$className,
21
28
  props = _objectWithoutProperties(_ref, _excluded);
22
- return /*#__PURE__*/React.createElement("div", {
29
+ return /*#__PURE__*/_jsx("div", {
23
30
  className: "".concat(tooltipClass, " ").concat(horizontalOnOpenSidebar ? "blue-sidebar-menu-horizontal-on-open" : "", " ").concat(outerClass),
24
- "data-tooltip": label
25
- }, /*#__PURE__*/React.createElement(MenuItem, _extends({}, props, {
26
- className: "".concat(className, " w-100"),
27
- iconClassName: "w-100"
28
- })));
31
+ "data-tooltip": label,
32
+ children: /*#__PURE__*/_jsx(MenuItem, _objectSpread(_objectSpread({}, props), {}, {
33
+ className: "".concat(className, " w-100"),
34
+ iconClassName: "w-100"
35
+ }))
36
+ });
29
37
  }
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  /**
3
4
  * Can be used for a sign-in page.
4
5
  */
@@ -8,21 +9,26 @@ export default function Intro(_ref) {
8
9
  logoMaxWidth = _ref$logoMaxWidth === void 0 ? "100px" : _ref$logoMaxWidth,
9
10
  title = _ref.title,
10
11
  children = _ref.children;
11
- return /*#__PURE__*/React.createElement("div", {
12
- className: "sign-in-screen"
13
- }, /*#__PURE__*/React.createElement("div", {
14
- className: "sign-in-container mx-1"
15
- }, /*#__PURE__*/React.createElement("div", {
16
- className: "bg-body rounded-3 shadow-lg px-4 py-5"
17
- }, /*#__PURE__*/React.createElement("div", {
18
- className: "text-center"
19
- }, /*#__PURE__*/React.createElement("img", {
20
- style: {
21
- maxWidth: logoMaxWidth
22
- },
23
- src: logo,
24
- alt: ""
25
- }), /*#__PURE__*/React.createElement("h2", {
26
- className: "mt-4 mb-3"
27
- }, title)), children)));
12
+ return /*#__PURE__*/_jsx("div", {
13
+ className: "sign-in-screen",
14
+ children: /*#__PURE__*/_jsx("div", {
15
+ className: "sign-in-container mx-1",
16
+ children: /*#__PURE__*/_jsxs("div", {
17
+ className: "bg-body rounded-3 shadow-lg px-4 py-5",
18
+ children: [/*#__PURE__*/_jsxs("div", {
19
+ className: "text-center",
20
+ children: [/*#__PURE__*/_jsx("img", {
21
+ style: {
22
+ maxWidth: logoMaxWidth
23
+ },
24
+ src: logo,
25
+ alt: ""
26
+ }), /*#__PURE__*/_jsx("h2", {
27
+ className: "mt-4 mb-3",
28
+ children: title
29
+ })]
30
+ }), children]
31
+ })
32
+ })
33
+ });
28
34
  }
@@ -1,6 +1,7 @@
1
1
  import React from "react";
2
2
  import clsx from "clsx";
3
3
  import { getPhrase } from "./shared.js";
4
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
5
  /**
5
6
  * A layout with header, side and main content area. Side is collapsible.
6
7
  */
@@ -12,76 +13,83 @@ export default function Layout(_ref) {
12
13
  side = _ref.side,
13
14
  _ref$noPageBorder = _ref.noPageBorder,
14
15
  noPageBorder = _ref$noPageBorder === void 0 ? false : _ref$noPageBorder;
15
- return /*#__PURE__*/React.createElement("div", {
16
+ return /*#__PURE__*/_jsxs("div", {
16
17
  className: clsx("blue-layout", className),
17
- style: style
18
- }, /*#__PURE__*/React.createElement("input", {
19
- id: "layout-expand",
20
- type: "checkbox",
21
- className: "blue-layout-state blue-layout-state-expand",
22
- defaultChecked: true
23
- }), /*#__PURE__*/React.createElement("label", {
24
- className: "blue-layout-toggle blue-layout-toggle-expand",
25
- htmlFor: "layout-expand",
26
- title: getPhrase("Toggle menu"),
27
- "aria-label": getPhrase("Toggle menu"),
28
- role: "button"
29
- }, /*#__PURE__*/React.createElement("span", {
30
- className: "btn blue-menu-item w-100 h-100 d-flex align-items-center justify-content-center p-0"
31
- }, /*#__PURE__*/React.createElement("svg", {
32
- xmlns: "http://www.w3.org/2000/svg",
33
- viewBox: "0 0 16 16",
34
- "aria-hidden": "true",
35
- width: "1em",
36
- height: "1em",
37
- fill: "currentColor",
38
- className: "bi bi-layout-sidebar"
39
- }, /*#__PURE__*/React.createElement("path", {
40
- d: "M0 3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5-1v12h9a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1zM4 2H2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2z"
41
- })))), /*#__PURE__*/React.createElement("input", {
42
- id: "layout-drawer",
43
- type: "checkbox",
44
- className: "blue-layout-state blue-layout-state-drawer"
45
- }), /*#__PURE__*/React.createElement("label", {
46
- className: "blue-layout-toggle blue-layout-toggle-drawer",
47
- htmlFor: "layout-drawer",
48
- title: getPhrase("Toggle menu"),
49
- "aria-label": getPhrase("Toggle menu"),
50
- role: "button"
51
- }, /*#__PURE__*/React.createElement("span", {
52
- className: "btn blue-menu-item w-100 h-100 d-flex align-items-center justify-content-center p-0"
53
- }, /*#__PURE__*/React.createElement("svg", {
54
- xmlns: "http://www.w3.org/2000/svg",
55
- viewBox: "0 0 16 16",
56
- "aria-hidden": "true",
57
- width: "1em",
58
- height: "1em",
59
- fill: "currentColor",
60
- className: "bi bi-layout-sidebar-inset"
61
- }, /*#__PURE__*/React.createElement("path", {
62
- d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2z"
63
- }), /*#__PURE__*/React.createElement("path", {
64
- d: "M3 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z"
65
- })))), /*#__PURE__*/React.createElement("header", {
66
- className: "blue-layout-header"
67
- }, header), /*#__PURE__*/React.createElement("aside", {
68
- className: "blue-layout-side blue-sidebar-state open h-100 overflow-y-auto overflow-x-hidden",
69
- style: {
70
- color: "var(--blue-sidebar-color)",
71
- background: "var(--blue-sidebar-bg)"
72
- }
73
- }, side), /*#__PURE__*/React.createElement("main", {
74
- className: "blue-layout-main"
75
- }, /*#__PURE__*/React.createElement("div", {
76
- className: clsx("blue-layout-body", {
77
- "border-0": noPageBorder
78
- })
79
- }, children)), /*#__PURE__*/React.createElement("label", {
80
- "aria-label": "Close sidebar",
81
- htmlFor: "layout-drawer",
82
- className: "blue-layout-overlay bg-dark w-100 h-100",
83
- style: {
84
- "--bs-bg-opacity": 0.5
85
- }
86
- }));
18
+ style: style,
19
+ children: [/*#__PURE__*/_jsx("input", {
20
+ id: "layout-expand",
21
+ type: "checkbox",
22
+ className: "blue-layout-state blue-layout-state-expand",
23
+ defaultChecked: true
24
+ }), /*#__PURE__*/_jsx("label", {
25
+ className: "blue-layout-toggle blue-layout-toggle-expand",
26
+ htmlFor: "layout-expand",
27
+ title: getPhrase("Toggle menu"),
28
+ "aria-label": getPhrase("Toggle menu"),
29
+ role: "button",
30
+ children: /*#__PURE__*/_jsx("span", {
31
+ className: "btn blue-menu-item w-100 h-100 d-flex align-items-center justify-content-center p-0",
32
+ children: /*#__PURE__*/_jsx("svg", {
33
+ xmlns: "http://www.w3.org/2000/svg",
34
+ viewBox: "0 0 16 16",
35
+ "aria-hidden": "true",
36
+ width: "1em",
37
+ height: "1em",
38
+ fill: "currentColor",
39
+ className: "bi bi-layout-sidebar",
40
+ children: /*#__PURE__*/_jsx("path", {
41
+ d: "M0 3a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2zm5-1v12h9a1 1 0 0 0 1-1V3a1 1 0 0 0-1-1zM4 2H2a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h2z"
42
+ })
43
+ })
44
+ })
45
+ }), /*#__PURE__*/_jsx("input", {
46
+ id: "layout-drawer",
47
+ type: "checkbox",
48
+ className: "blue-layout-state blue-layout-state-drawer"
49
+ }), /*#__PURE__*/_jsx("label", {
50
+ className: "blue-layout-toggle blue-layout-toggle-drawer",
51
+ htmlFor: "layout-drawer",
52
+ title: getPhrase("Toggle menu"),
53
+ "aria-label": getPhrase("Toggle menu"),
54
+ role: "button",
55
+ children: /*#__PURE__*/_jsx("span", {
56
+ className: "btn blue-menu-item w-100 h-100 d-flex align-items-center justify-content-center p-0",
57
+ children: /*#__PURE__*/_jsxs("svg", {
58
+ xmlns: "http://www.w3.org/2000/svg",
59
+ viewBox: "0 0 16 16",
60
+ "aria-hidden": "true",
61
+ width: "1em",
62
+ height: "1em",
63
+ fill: "currentColor",
64
+ className: "bi bi-layout-sidebar-inset",
65
+ children: [/*#__PURE__*/_jsx("path", {
66
+ d: "M14 2a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V3a1 1 0 0 1 1-1zM2 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V3a2 2 0 0 0-2-2z"
67
+ }), /*#__PURE__*/_jsx("path", {
68
+ d: "M3 4a1 1 0 0 1 1-1h2a1 1 0 0 1 1 1v8a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1z"
69
+ })]
70
+ })
71
+ })
72
+ }), /*#__PURE__*/_jsx("header", {
73
+ className: "blue-layout-header",
74
+ children: header
75
+ }), /*#__PURE__*/_jsx("aside", {
76
+ className: "blue-layout-side",
77
+ children: side
78
+ }), /*#__PURE__*/_jsx("main", {
79
+ className: "blue-layout-main",
80
+ children: /*#__PURE__*/_jsx("div", {
81
+ className: clsx("blue-layout-body", {
82
+ "border-0": noPageBorder
83
+ }),
84
+ children: children
85
+ })
86
+ }), /*#__PURE__*/_jsx("label", {
87
+ "aria-label": "Close sidebar",
88
+ htmlFor: "layout-drawer",
89
+ className: "blue-layout-overlay bg-dark w-100 h-100",
90
+ style: {
91
+ "--bs-bg-opacity": 0.5
92
+ }
93
+ })]
94
+ });
87
95
  }
@@ -1,149 +1,150 @@
1
- import React, { CSSProperties } from "react";
2
- export interface MenuItemProps {
3
- /**
4
- * Sets `to` prop, e.g. when you use the `NavLink` component from React Router.
5
- */
6
- to?: string;
7
- /**
8
- * Prop for components by React Router.
9
- */
10
- exact?: boolean;
11
- href?: string;
12
- onClick?: (event: React.MouseEvent) => void;
13
- /**
14
- * Will be fired after `onClick`
15
- */
16
- onClickAttached?: (event: React.MouseEvent) => void;
17
- /**
18
- * Icon component or a class name.
19
- */
20
- icon?: any;
21
- /**
22
- * Addition to class name of icon wrapper element
23
- */
24
- iconClassName?: string;
25
- /**
26
- * Icon component or a class name when the MenuItem is active.
27
- */
28
- iconForActive?: any;
29
- /**
30
- * Label of the link.
31
- */
32
- label?: any;
33
- /**
34
- * Addition to class name of label wrapper element
35
- */
36
- labelClassName?: string;
37
- /**
38
- * Addition to class name of caret
39
- */
40
- caretClassName?: string;
41
- /**
42
- * Addition to style of caret
43
- */
44
- caretStyle?: CSSProperties;
45
- /**
46
- * Should be set as active.
47
- */
48
- isActive?: boolean;
49
- /**
50
- * Set true to highlight the current menu item.
51
- */
52
- highlighted?: boolean;
53
- /**
54
- * When using Blue React's routing system: define this link as home page link.
55
- */
56
- isHome?: boolean;
57
- /**
58
- * Extends class name of the dropdown menu.
59
- */
60
- dropdownClassName?: string;
61
- /**
62
- * Extends style of the dropdown menu.
63
- */
64
- dropdownStyle?: CSSProperties;
65
- /**
66
- * Set children to create a nested `MenuItem` as a dropdown.
67
- */
68
- children?: any;
69
- /**
70
- * Defines class name.
71
- */
72
- className?: any;
73
- /**
74
- * Defines dropdown status from outside.
75
- */
76
- showDropdown?: boolean;
77
- /**
78
- * Callback when `showDropdown` changes.
79
- */
80
- onShowDropdown?: (showDropdown: boolean) => void;
81
- /**
82
- * Close on click outside.
83
- */
84
- supportOutside?: boolean;
85
- /**
86
- * Overrides default class list to be ignored on click outside.
87
- * Hint: If you want this menu item to stay open when others will open, set:
88
- * `outsideIgnoreClasses={["blue-menu-item-wrapper"]}`.
89
- */
90
- outsideIgnoreClasses?: string[];
91
- /**
92
- * By default, MenuItem is a `"button"`. If you set a `href`, it's a `"a"`.
93
- * If you want to have it another type, you can pass a component reference with this prop (e.g. `Link`).
94
- */
95
- elementType?: any;
96
- target?: string;
97
- rel?: string;
98
- title?: string;
99
- type?: string;
100
- /**
101
- * Fired on the draggable target (the source element): occurs when the user starts to drag an element
102
- */
103
- onDragStart?: (event: React.DragEvent) => void | React.DragEventHandler;
104
- /**
105
- * Fired on the draggable target (the source element): occurs when an element is being dragged
106
- */
107
- onDrag?: (event: React.DragEvent) => void | React.DragEventHandler;
108
- /**
109
- * Fired on the draggable target (the source element): occurs when the user has finished dragging the element
110
- */
111
- onDragEnd?: (event: React.DragEvent) => void | React.DragEventHandler;
112
- /**
113
- * Fired on the drop target: occurs when the dragged element enters the drop target
114
- */
115
- onDragEnter?: (event: React.DragEvent) => void | React.DragEventHandler;
116
- /**
117
- * Fired on the drop target: occurs when the dragged element is over the drop target
118
- */
119
- onDragOver?: (event: React.DragEvent) => void | React.DragEventHandler;
120
- /**
121
- * Fired on the drop target: occurs when the dragged element leaves the drop target
122
- */
123
- onDragLeave?: (event: React.DragEvent) => void | React.DragEventHandler;
124
- /**
125
- * Fired on the drop target: occurs when the dragged element is dropped on the drop target
126
- */
127
- onDrop?: (event: React.DragEvent) => void | React.DragEventHandler;
128
- /**
129
- * Specifies whether an element is draggable or not.
130
- *
131
- * **Important:** To make draggable menu items work in Firefox, the elementType must not be `"button"`. Set it to something else, like `"div"`.
132
- */
133
- draggable?: boolean;
134
- hideDraggableIcon?: boolean;
135
- "data-tooltip"?: string;
136
- /**
137
- * Specifies whether an element is disabled or not.
138
- */
139
- disabled?: boolean;
140
- /**
141
- * Specifies style of an element.
142
- */
143
- style?: React.CSSProperties;
144
- id?: string;
145
- }
146
- /**
147
- * Link, button or custom component for Sidebar, Actions or ActionMenu
148
- */
149
- export default function MenuItem(props: MenuItemProps): JSX.Element;
1
+ import React, { CSSProperties } from "react";
2
+ export interface LegacyMenuItemProps {
3
+ /**
4
+ * Sets `to` prop, e.g. when you use the `NavLink` component from React Router.
5
+ */
6
+ to?: string;
7
+ /**
8
+ * Prop for components by React Router.
9
+ */
10
+ exact?: boolean;
11
+ href?: string;
12
+ onClick?: (event: React.MouseEvent) => void;
13
+ /**
14
+ * Will be fired after `onClick`
15
+ */
16
+ onClickAttached?: (event: React.MouseEvent) => void;
17
+ /**
18
+ * Icon component or a class name.
19
+ */
20
+ icon?: any;
21
+ /**
22
+ * Addition to class name of icon wrapper element
23
+ */
24
+ iconClassName?: string;
25
+ /**
26
+ * Icon component or a class name when the MenuItem is active.
27
+ */
28
+ iconForActive?: any;
29
+ /**
30
+ * Label of the link.
31
+ */
32
+ label?: any;
33
+ /**
34
+ * Addition to class name of label wrapper element
35
+ */
36
+ labelClassName?: string;
37
+ /**
38
+ * Addition to class name of caret
39
+ */
40
+ caretClassName?: string;
41
+ /**
42
+ * Addition to style of caret
43
+ */
44
+ caretStyle?: CSSProperties;
45
+ /**
46
+ * Should be set as active.
47
+ */
48
+ isActive?: boolean;
49
+ /**
50
+ * Set true to highlight the current menu item.
51
+ */
52
+ highlighted?: boolean;
53
+ /**
54
+ * When using Blue React's routing system: define this link as home page link.
55
+ */
56
+ isHome?: boolean;
57
+ /**
58
+ * Extends class name of the dropdown menu.
59
+ */
60
+ dropdownClassName?: string;
61
+ /**
62
+ * Extends style of the dropdown menu.
63
+ */
64
+ dropdownStyle?: CSSProperties;
65
+ /**
66
+ * Set children to create a nested `MenuItem` as a dropdown.
67
+ */
68
+ children?: any;
69
+ /**
70
+ * Defines class name.
71
+ */
72
+ className?: any;
73
+ /**
74
+ * Defines dropdown status from outside.
75
+ */
76
+ showDropdown?: boolean;
77
+ /**
78
+ * Callback when `showDropdown` changes.
79
+ */
80
+ onShowDropdown?: (showDropdown: boolean) => void;
81
+ /**
82
+ * Close on click outside.
83
+ */
84
+ supportOutside?: boolean;
85
+ /**
86
+ * Overrides default class list to be ignored on click outside.
87
+ * Hint: If you want this menu item to stay open when others will open, set:
88
+ * `outsideIgnoreClasses={["blue-menu-item-wrapper"]}`.
89
+ */
90
+ outsideIgnoreClasses?: string[];
91
+ /**
92
+ * By default, MenuItem is a `"button"`. If you set a `href`, it's a `"a"`.
93
+ * If you want to have it another type, you can pass a component reference with this prop (e.g. `Link`).
94
+ */
95
+ elementType?: any;
96
+ target?: string;
97
+ rel?: string;
98
+ title?: string;
99
+ type?: string;
100
+ /**
101
+ * Fired on the draggable target (the source element): occurs when the user starts to drag an element
102
+ */
103
+ onDragStart?: (event: React.DragEvent) => void | React.DragEventHandler;
104
+ /**
105
+ * Fired on the draggable target (the source element): occurs when an element is being dragged
106
+ */
107
+ onDrag?: (event: React.DragEvent) => void | React.DragEventHandler;
108
+ /**
109
+ * Fired on the draggable target (the source element): occurs when the user has finished dragging the element
110
+ */
111
+ onDragEnd?: (event: React.DragEvent) => void | React.DragEventHandler;
112
+ /**
113
+ * Fired on the drop target: occurs when the dragged element enters the drop target
114
+ */
115
+ onDragEnter?: (event: React.DragEvent) => void | React.DragEventHandler;
116
+ /**
117
+ * Fired on the drop target: occurs when the dragged element is over the drop target
118
+ */
119
+ onDragOver?: (event: React.DragEvent) => void | React.DragEventHandler;
120
+ /**
121
+ * Fired on the drop target: occurs when the dragged element leaves the drop target
122
+ */
123
+ onDragLeave?: (event: React.DragEvent) => void | React.DragEventHandler;
124
+ /**
125
+ * Fired on the drop target: occurs when the dragged element is dropped on the drop target
126
+ */
127
+ onDrop?: (event: React.DragEvent) => void | React.DragEventHandler;
128
+ /**
129
+ * Specifies whether an element is draggable or not.
130
+ *
131
+ * **Important:** To make draggable menu items work in Firefox, the elementType must not be `"button"`. Set it to something else, like `"div"`.
132
+ */
133
+ draggable?: boolean;
134
+ hideDraggableIcon?: boolean;
135
+ "data-tooltip"?: string;
136
+ /**
137
+ * Specifies whether an element is disabled or not.
138
+ */
139
+ disabled?: boolean;
140
+ /**
141
+ * Specifies style of an element.
142
+ */
143
+ style?: React.CSSProperties;
144
+ id?: string;
145
+ }
146
+ /**
147
+ * @deprecated
148
+ * Link, button or custom component for Sidebar, Actions or ActionMenu
149
+ */
150
+ export default function LegacyMenuItem(props: LegacyMenuItemProps): import("react/jsx-runtime").JSX.Element;