blue-react 8.8.4 → 8.9.0

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.
package/dist/style.scss CHANGED
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * Blue React v8.8.4 (https://bruegmann.github.io/blue-react)
2
+ * Blue React v8.9.0 (https://bruegmann.github.io/blue-react)
3
3
  * Licensed under GNU General Public License v3.0 (https://github.com/bruegmann/blue-react/blob/master/LICENSE).
4
4
  */
5
5
 
@@ -17,6 +17,7 @@
17
17
  @import "./styles/_router";
18
18
  @import "./styles/_status";
19
19
  @import "./styles/_layout";
20
+ @import "./styles/_sidebar";
20
21
  @import "./styles/_search";
21
22
  @import "./styles/action-menu";
22
23
  @import "./styles/_switch";
@@ -21,28 +21,6 @@
21
21
  padding-right: 0;
22
22
  }
23
23
  }
24
-
25
- &.open {
26
- @media screen and (max-width: 1400px) {
27
- .router-page.active {
28
- .blue-page {
29
- filter: blur(3px) brightness(0.8);
30
- }
31
- }
32
- }
33
-
34
- @include openSidebarMenu();
35
- }
36
-
37
- &:not(.open) {
38
- .blue-sidebar-visible-on-open {
39
- display: none;
40
- }
41
-
42
- .blue-sidebar-hidden-on-open {
43
- animation: fade-in 1s;
44
- }
45
- }
46
24
  }
47
25
 
48
26
  .blue-header-wrapper {
@@ -59,7 +37,7 @@
59
37
  height: $normal-size;
60
38
  left: 0;
61
39
  top: 0;
62
- z-index: 3;
40
+ z-index: 5;
63
41
  }
64
42
 
65
43
  .blue-header {
@@ -67,10 +45,6 @@
67
45
  color: $header-color;
68
46
  }
69
47
 
70
- // .blue-layout:not(.wrapper-in) .blue-header {
71
- // overflow: hidden;
72
- // }
73
-
74
48
  .blue-header {
75
49
  height: $normal-size;
76
50
  position: fixed;
@@ -181,7 +155,7 @@
181
155
  display: none;
182
156
  }
183
157
 
184
- .blue-header {
158
+ &.hideToggleExpandSidebar .blue-header {
185
159
  left: 0;
186
160
  }
187
161
  }
@@ -0,0 +1,42 @@
1
+ .blue-sidebar-state {
2
+ &.open {
3
+ @media screen and (max-width: 1400px) {
4
+ .router-page.active {
5
+ .blue-page {
6
+ filter: blur(3px) brightness(0.8);
7
+ }
8
+ }
9
+ }
10
+
11
+ @include openSidebarMenu();
12
+
13
+ .blue-menu-item:not(.blue-open-menu) {
14
+ width: $bla-sidebar-width;
15
+
16
+ & > * {
17
+ width: auto;
18
+ }
19
+ }
20
+ }
21
+
22
+ &:not(.open) {
23
+ .blue-sidebar-visible-on-open {
24
+ display: none;
25
+ }
26
+
27
+ .blue-sidebar-hidden-on-open {
28
+ animation: fade-in 1s;
29
+ }
30
+ }
31
+ }
32
+
33
+ @keyframes blue-menu-item-dropdown-from-start {
34
+ from {
35
+ transform: translateX(-50%);
36
+ opacity: 0;
37
+ }
38
+ }
39
+
40
+ .blue-menu-item-dropdown-from-start {
41
+ animation: blue-menu-item-dropdown-from-start 0.15s;
42
+ }
@@ -17,10 +17,18 @@ export interface LayoutProps {
17
17
  */
18
18
  onChangeSidebarIn?: (sidebarIn: boolean) => void;
19
19
  style?: CSSProperties;
20
+ /**
21
+ * Set `true` to hide button to toggle `expandSidebar` state.
22
+ */
23
+ hideToggleExpandSidebar?: boolean;
20
24
  /**
21
25
  * Sidebar is automatically expanded on wider views.
22
26
  */
23
27
  expandSidebar?: boolean;
28
+ /**
29
+ * React to changes of the `expandSidebar` state.
30
+ */
31
+ onChangeExpandSidebar?: (expandSidebar: boolean) => void;
24
32
  /**
25
33
  * Disables sidebar.
26
34
  */
@@ -48,6 +56,11 @@ export interface LayoutProps {
48
56
  * If you don't use blueicon, you can define another icon element for the sidebar toggle button.
49
57
  */
50
58
  sidebarToggleIconComponent?: any;
59
+ /**
60
+ * Set `true` if you want to use the Utilities functions for status and alert.
61
+ * Set `false` if you want to use `StatusProvider` instead.
62
+ */
63
+ enableStatus?: boolean;
51
64
  /**
52
65
  * Will replace status icons with custom ones. This will also overwrite the `useBlueicons` option.
53
66
  * This can be a SVG component or a normal element component.
@@ -71,6 +84,7 @@ export interface LayoutProps {
71
84
  }
72
85
  export interface LayoutState {
73
86
  sidebarIn: boolean;
87
+ expandSidebar: boolean;
74
88
  match: any;
75
89
  history: string[];
76
90
  hash: string;
@@ -103,17 +117,18 @@ export default class Layout extends Component<LayoutProps, LayoutState> {
103
117
  constructor(props: LayoutProps);
104
118
  onHashChange(): void;
105
119
  static get defaultProps(): {
106
- expandSidebar: boolean;
107
120
  hideSidebarMenu: boolean;
108
121
  unrouteable: boolean;
109
122
  disableTitleSet: boolean;
110
123
  sidebarToggleIconComponent: JSX.Element;
124
+ enableStatus: boolean;
111
125
  statusIcons: {
112
126
  danger: JSX.Element;
113
127
  info: JSX.Element;
114
128
  success: JSX.Element;
115
129
  warning: JSX.Element;
116
130
  };
131
+ hideToggleExpandSidebar: boolean;
117
132
  };
118
133
  componentDidMount(): void;
119
134
  componentWillUnmount(): void;
@@ -124,5 +139,6 @@ export default class Layout extends Component<LayoutProps, LayoutState> {
124
139
  addEventListener(param1: any, param2: any, param3: any, listenerId?: string): void;
125
140
  removeEventListener(type: string, listenerId: string): void;
126
141
  removeDuplicatedEventListeners(): void;
142
+ toggleExpandSidebar(): void;
127
143
  render(): JSX.Element;
128
144
  }
@@ -0,0 +1,21 @@
1
+ /// <reference types="react" />
2
+ import { MenuItemProps } from "./MenuItem";
3
+ export interface SidebarMenuItemProps extends MenuItemProps {
4
+ outerClass?: string;
5
+ }
6
+ /**
7
+ * Extends `MenuItem` with following features:
8
+ * * Shows provided label as tooltip if sidebar is closed.
9
+ * * Children will be displayed on the right side of the parent item.
10
+ *
11
+ * **Important!** Set the following props to the surrounding `SidebarMenu` to provide problems with tooltips:
12
+ * ```jsx
13
+ * <SidebarMenu
14
+ * sidebarClass="overflow-visible"
15
+ * menuClass="overflow-visible"
16
+ * >
17
+ * ...
18
+ * </SidebarMenu>
19
+ * ```
20
+ */
21
+ export default function SidebarMenuItem({ outerClass, children, onClick, ...props }: SidebarMenuItemProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { MouseEventHandler, ReactNode } from "react";
2
+ export interface SidebarTogglerProps {
3
+ className?: string;
4
+ sidebarToggleIconComponent: ReactNode;
5
+ onClick: MouseEventHandler<HTMLButtonElement>;
6
+ }
7
+ /**
8
+ * Button to toggle sidebar state. Designed for internal use inside of `Layout`.
9
+ */
10
+ export default function SidebarToggler({ className, sidebarToggleIconComponent, onClick }: SidebarTogglerProps): JSX.Element;
@@ -13,9 +13,13 @@ export declare function hideSuccess(): void;
13
13
  export declare function toggleActions(): void;
14
14
  /**
15
15
  * Resets alert messages that was set with `setAlertMessage`.
16
+ * When using React, you should use `StatusProvider` instead: https://bruegmann.github.io/blue-react/v8/component/StatusProvider
16
17
  * @param alertClassName Leave empty to reset messages of any status type
17
18
  */
18
19
  export declare function resetAlertMessage(alertClassName?: StatusType): void;
20
+ /**
21
+ * When using React, you should use `StatusProvider` instead: https://bruegmann.github.io/blue-react/v8/component/StatusProvider
22
+ */
19
23
  export declare function setAlertMessage(message: string, alertClassName?: StatusType, close?: boolean, detailText?: string): void;
20
24
  export declare const guid: () => string;
21
25
  export declare function scrollToTop(): void;
package/index.d.ts CHANGED
@@ -53,6 +53,9 @@ export { SearchProps } from "./dist/types/components/Search"
53
53
  export { default as SidebarMenu } from "./dist/types/components/SidebarMenu"
54
54
  export { SidebarMenuProps } from "./dist/types/components/SidebarMenu"
55
55
 
56
+ export { default as SidebarMenuItem } from "./dist/types/components/SidebarMenuItem"
57
+ export { SidebarMenuItemProps } from "./dist/types/components/SidebarMenuItem"
58
+
56
59
  export { default as SlimContainer } from "./dist/types/components/SlimContainer"
57
60
  export { SlimContainerProps } from "./dist/types/components/SlimContainer"
58
61
 
package/index.js CHANGED
@@ -15,6 +15,7 @@ exports.Outside = require("./dist/components/Outside.js")["default"]
15
15
  exports.Page = require("./dist/components/Page.js")["default"]
16
16
  exports.Search = require("./dist/components/Search.js")["default"]
17
17
  exports.SidebarMenu = require("./dist/components/SidebarMenu.js")["default"]
18
+ exports.SidebarMenuItem = require("./dist/components/SidebarMenuItem.js")["default"]
18
19
  exports.SlimContainer = require("./dist/components/SlimContainer.js")["default"]
19
20
  exports.Status = require("./dist/components/Status.js")["default"]
20
21
  exports.StatusProvider = require("./dist/components/StatusProvider.js")["StatusProvider"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blue-react",
3
- "version": "8.8.4",
3
+ "version": "8.9.0",
4
4
  "description": "Blue React Components",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "main": "index.js",