blue-react 9.0.0-alpha2 → 9.0.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/components/HeaderTitle.js +2 -2
- package/dist/components/Layout.js +44 -12
- package/dist/components/MenuItem.js +1 -1
- package/dist/components/Search.js +3 -1
- package/dist/components/SidebarMenuItem.js +124 -0
- package/dist/components/SidebarToggler.js +33 -0
- package/dist/components/shared.js +2 -1
- package/dist/neu.scss +76 -0
- package/dist/style.css +185 -109
- package/dist/style.min.css +5 -5
- package/dist/style.scss +1 -2
- package/dist/styles/_bootstrap-variables.scss +2 -2
- package/dist/styles/_bootstrap.scss +1 -0
- package/dist/styles/_general.scss +2 -2
- package/dist/styles/_layout.scss +3 -7
- package/dist/styles/_sidebar.scss +36 -0
- package/dist/styles/_variables.scss +2 -9
- package/dist/styles/mixins/_sidebar.scss +16 -2
- package/dist/types/components/Layout.d.ts +11 -1
- package/dist/types/components/MenuItem.d.ts +4 -0
- package/dist/types/components/Search.d.ts +7 -3
- package/dist/types/components/SidebarMenuItem.d.ts +21 -0
- package/dist/types/components/SidebarToggler.d.ts +10 -0
- package/index.d.ts +3 -3
- package/index.js +1 -1
- package/package.json +4 -5
- package/dist/styles/_bootstrap-optimizations.scss +0 -5
package/dist/style.scss
CHANGED
|
@@ -18,10 +18,9 @@
|
|
|
18
18
|
@import "./styles/_router";
|
|
19
19
|
@import "./styles/_status";
|
|
20
20
|
@import "./styles/_layout";
|
|
21
|
+
@import "./styles/_sidebar";
|
|
21
22
|
@import "./styles/_search";
|
|
22
23
|
@import "./styles/action-menu";
|
|
23
24
|
@import "./styles/_caret";
|
|
24
25
|
@import "./styles/_tooltips";
|
|
25
26
|
@import "./styles/_hover";
|
|
26
|
-
|
|
27
|
-
@import "./styles/_bootstrap-optimizations";
|
|
@@ -12,5 +12,5 @@ $custom-checkbox-indicator-border-radius: $border-radius-sm !default;
|
|
|
12
12
|
$link-decoration: none !default;
|
|
13
13
|
$link-hover-decoration: underline !default;
|
|
14
14
|
|
|
15
|
-
$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, Oxygen-Sans,
|
|
16
|
-
Cantarell, "Helvetica Neue", sans-serif !default;
|
|
15
|
+
$font-family-sans-serif: -apple-system, BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, Oxygen-Sans,
|
|
16
|
+
Ubuntu, Cantarell, "Helvetica Neue", sans-serif !default;
|
|
@@ -48,6 +48,7 @@
|
|
|
48
48
|
@import "node_modules/bootstrap/scss/carousel";
|
|
49
49
|
@import "node_modules/bootstrap/scss/spinners";
|
|
50
50
|
@import "node_modules/bootstrap/scss/offcanvas";
|
|
51
|
+
@import "node_modules/bootstrap/scss/placeholders";
|
|
51
52
|
|
|
52
53
|
// Helpers
|
|
53
54
|
@import "node_modules/bootstrap/scss/helpers";
|
|
@@ -131,8 +131,8 @@ body {
|
|
|
131
131
|
|
|
132
132
|
@media screen and (min-width: 768px) {
|
|
133
133
|
.sign-in-container {
|
|
134
|
-
padding: 0 calc(50% - 18rem);
|
|
135
|
-
width: auto;
|
|
134
|
+
padding: var(--blue-sign-in-container-md-padding, 0 calc(50% - 18rem));
|
|
135
|
+
width: var(--blue-sign-in-container-md-width, auto);
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
}
|
package/dist/styles/_layout.scss
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
height: $normal-size;
|
|
60
60
|
left: 0;
|
|
61
61
|
top: 0;
|
|
62
|
-
z-index:
|
|
62
|
+
z-index: 5;
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
.blue-header {
|
|
@@ -67,10 +67,6 @@
|
|
|
67
67
|
color: $header-color;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
// .blue-layout:not(.wrapper-in) .blue-header {
|
|
71
|
-
// overflow: hidden;
|
|
72
|
-
// }
|
|
73
|
-
|
|
74
70
|
.blue-header {
|
|
75
71
|
height: $normal-size;
|
|
76
72
|
position: fixed;
|
|
@@ -181,7 +177,7 @@
|
|
|
181
177
|
display: none;
|
|
182
178
|
}
|
|
183
179
|
|
|
184
|
-
.blue-header {
|
|
180
|
+
&.hideToggleExpandSidebar .blue-header {
|
|
185
181
|
left: 0;
|
|
186
182
|
}
|
|
187
183
|
}
|
|
@@ -200,7 +196,7 @@
|
|
|
200
196
|
&,
|
|
201
197
|
&:hover,
|
|
202
198
|
&:focus {
|
|
203
|
-
color:
|
|
199
|
+
color: var(--blue-sidebar-color);
|
|
204
200
|
background-color: var(--blue-sidebar-bg);
|
|
205
201
|
border-color: transparent;
|
|
206
202
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
.blue-sidebar-state {
|
|
2
|
+
&.open {
|
|
3
|
+
@include openSidebarMenu();
|
|
4
|
+
|
|
5
|
+
.blue-menu-item {
|
|
6
|
+
width: $bla-sidebar-width;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.blue-menu-item {
|
|
10
|
+
& > * {
|
|
11
|
+
width: auto;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&:not(.open) {
|
|
17
|
+
.blue-sidebar-visible-on-open {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.blue-sidebar-hidden-on-open {
|
|
22
|
+
animation: fade-in 1s;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes blue-menu-item-dropdown-from-start {
|
|
28
|
+
from {
|
|
29
|
+
transform: translateX(-50%);
|
|
30
|
+
opacity: 0;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.blue-menu-item-dropdown-from-start {
|
|
35
|
+
animation: blue-menu-item-dropdown-from-start 0.15s;
|
|
36
|
+
}
|
|
@@ -60,11 +60,7 @@ $sidebar-open-bg: darken($sidebar-bg, 30%) !default;
|
|
|
60
60
|
$sidebar-deep-bg: darken($sidebar-bg, 4%) !default;
|
|
61
61
|
|
|
62
62
|
// Text color of sidebar.
|
|
63
|
-
$
|
|
64
|
-
$blue-sidebar-color-s: 100% !default;
|
|
65
|
-
$blue-sidebar-color-l: 100% !default;
|
|
66
|
-
$blue-sidebar-color: hsl($blue-sidebar-color-h, $blue-sidebar-color-s, $blue-sidebar-color-l) !default;
|
|
67
|
-
$sidebar-color: $blue-sidebar-color !default;
|
|
63
|
+
$sidebar-color: #fff !default;
|
|
68
64
|
|
|
69
65
|
// Color of indicator for active sidebar item.
|
|
70
66
|
$sidebar-indicator-color: $sidebar-color !default;
|
|
@@ -92,10 +88,7 @@ $scrollbar-size: 10px;
|
|
|
92
88
|
|
|
93
89
|
:root {
|
|
94
90
|
--blue-sidebar-width: #{$bla-sidebar-width};
|
|
95
|
-
--blue-sidebar-color
|
|
96
|
-
--blue-sidebar-color-s: #{$blue-sidebar-color-s};
|
|
97
|
-
--blue-sidebar-color-l: #{$blue-sidebar-color-l};
|
|
98
|
-
--blue-sidebar-color: #{$blue-sidebar-color};
|
|
91
|
+
--blue-sidebar-color: #{$sidebar-color};
|
|
99
92
|
--blue-theme: var(--theme, #{$theme});
|
|
100
93
|
--blue-shimmering: 0.8;
|
|
101
94
|
|
|
@@ -94,7 +94,8 @@
|
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
&:hover,
|
|
97
|
-
&:active
|
|
97
|
+
&:active,
|
|
98
|
+
&.highlighted {
|
|
98
99
|
color: inherit;
|
|
99
100
|
border-color: transparent;
|
|
100
101
|
|
|
@@ -104,6 +105,19 @@
|
|
|
104
105
|
}
|
|
105
106
|
}
|
|
106
107
|
|
|
108
|
+
&.highlighted {
|
|
109
|
+
&::before {
|
|
110
|
+
opacity: 0.16;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
&:hover,
|
|
115
|
+
&:active {
|
|
116
|
+
&::before {
|
|
117
|
+
opacity: 0.25;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
107
121
|
&.active::after {
|
|
108
122
|
content: "";
|
|
109
123
|
position: absolute;
|
|
@@ -127,7 +141,7 @@
|
|
|
127
141
|
|
|
128
142
|
.blue-sidebar {
|
|
129
143
|
width: $width;
|
|
130
|
-
color:
|
|
144
|
+
color: var(--blue-sidebar-color);
|
|
131
145
|
background: var(--blue-sidebar-bg);
|
|
132
146
|
position: fixed;
|
|
133
147
|
left: 0;
|
|
@@ -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
|
*/
|
|
@@ -76,6 +84,7 @@ export interface LayoutProps {
|
|
|
76
84
|
}
|
|
77
85
|
export interface LayoutState {
|
|
78
86
|
sidebarIn: boolean;
|
|
87
|
+
expandSidebar: boolean;
|
|
79
88
|
match: any;
|
|
80
89
|
history: string[];
|
|
81
90
|
hash: string;
|
|
@@ -108,7 +117,6 @@ export default class Layout extends Component<LayoutProps, LayoutState> {
|
|
|
108
117
|
constructor(props: LayoutProps);
|
|
109
118
|
onHashChange(): void;
|
|
110
119
|
static get defaultProps(): {
|
|
111
|
-
expandSidebar: boolean;
|
|
112
120
|
hideSidebarMenu: boolean;
|
|
113
121
|
unrouteable: boolean;
|
|
114
122
|
disableTitleSet: boolean;
|
|
@@ -120,6 +128,7 @@ export default class Layout extends Component<LayoutProps, LayoutState> {
|
|
|
120
128
|
success: JSX.Element;
|
|
121
129
|
warning: JSX.Element;
|
|
122
130
|
};
|
|
131
|
+
hideToggleExpandSidebar: boolean;
|
|
123
132
|
};
|
|
124
133
|
componentDidMount(): void;
|
|
125
134
|
componentWillUnmount(): void;
|
|
@@ -130,5 +139,6 @@ export default class Layout extends Component<LayoutProps, LayoutState> {
|
|
|
130
139
|
addEventListener(param1: any, param2: any, param3: any, listenerId?: string): void;
|
|
131
140
|
removeEventListener(type: string, listenerId: string): void;
|
|
132
141
|
removeDuplicatedEventListeners(): void;
|
|
142
|
+
toggleExpandSidebar(): void;
|
|
133
143
|
render(): JSX.Element;
|
|
134
144
|
}
|
|
@@ -30,6 +30,10 @@ export interface MenuItemProps {
|
|
|
30
30
|
* Should be set as active.
|
|
31
31
|
*/
|
|
32
32
|
isActive?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Set true to highlight the current menu item.
|
|
35
|
+
*/
|
|
36
|
+
highlighted?: boolean;
|
|
33
37
|
/**
|
|
34
38
|
* When using Blue React's routing system: define this link as home page link.
|
|
35
39
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
1
|
+
import React, { ReactNode, RefObject } from "react";
|
|
2
2
|
export interface SearchProps {
|
|
3
3
|
autoFocus?: boolean;
|
|
4
4
|
/**
|
|
@@ -7,8 +7,8 @@ export interface SearchProps {
|
|
|
7
7
|
body?: boolean;
|
|
8
8
|
className?: string;
|
|
9
9
|
icon?: any;
|
|
10
|
-
onChange?: (event: React.ChangeEvent) => void;
|
|
11
|
-
onSubmit?: (event: React.FormEvent) => void;
|
|
10
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
11
|
+
onSubmit?: (event: React.FormEvent<HTMLFormElement>) => void;
|
|
12
12
|
placeholder?: string;
|
|
13
13
|
/**
|
|
14
14
|
* Allow reset?
|
|
@@ -25,6 +25,10 @@ export interface SearchProps {
|
|
|
25
25
|
value?: string;
|
|
26
26
|
children?: ReactNode;
|
|
27
27
|
id?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Set `ref` prop of the input element. Let's you take control of it from the outside, e.g. to set focus.
|
|
30
|
+
*/
|
|
31
|
+
inputRef?: RefObject<HTMLInputElement>;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* A search bar that can be placed to the sidebar or on a page.
|
|
@@ -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;
|
package/index.d.ts
CHANGED
|
@@ -21,9 +21,6 @@ export { BodyProps } from "./dist/types/components/Body"
|
|
|
21
21
|
export { default as Caret } from "./dist/types/components/Caret"
|
|
22
22
|
export { CaretProps } from "./dist/types/components/Caret"
|
|
23
23
|
|
|
24
|
-
export { default as DocumentView } from "./dist/types/components/DocumentView"
|
|
25
|
-
export { DocumentViewProps } from "./dist/types/components/DocumentView"
|
|
26
|
-
|
|
27
24
|
export { default as Header } from "./dist/types/components/Header"
|
|
28
25
|
export { HeaderProps } from "./dist/types/components/Header"
|
|
29
26
|
|
|
@@ -53,6 +50,9 @@ export { SearchProps } from "./dist/types/components/Search"
|
|
|
53
50
|
export { default as SidebarMenu } from "./dist/types/components/SidebarMenu"
|
|
54
51
|
export { SidebarMenuProps } from "./dist/types/components/SidebarMenu"
|
|
55
52
|
|
|
53
|
+
export { default as SidebarMenuItem } from "./dist/types/components/SidebarMenuItem"
|
|
54
|
+
export { SidebarMenuItemProps } from "./dist/types/components/SidebarMenuItem"
|
|
55
|
+
|
|
56
56
|
export { default as SlimContainer } from "./dist/types/components/SlimContainer"
|
|
57
57
|
export { SlimContainerProps } from "./dist/types/components/SlimContainer"
|
|
58
58
|
|
package/index.js
CHANGED
|
@@ -2,7 +2,6 @@ exports.ActionMenu = require("./dist/components/ActionMenu.js")["default"]
|
|
|
2
2
|
exports.ActionMenuSwitch = require("./dist/components/ActionMenuSwitch.js")["default"]
|
|
3
3
|
exports.Body = require("./dist/components/Body.js")["default"]
|
|
4
4
|
exports.Caret = require("./dist/components/Caret.js")["default"]
|
|
5
|
-
exports.DocumentView = require("./dist/components/DocumentView.js")["default"]
|
|
6
5
|
exports.Layout = require("./dist/components/Layout.js")["default"]
|
|
7
6
|
exports.Header = require("./dist/components/Header.js")["default"]
|
|
8
7
|
exports.HeaderTitle = require("./dist/components/HeaderTitle.js")["default"]
|
|
@@ -15,6 +14,7 @@ exports.Outside = require("./dist/components/Outside.js")["default"]
|
|
|
15
14
|
exports.Page = require("./dist/components/Page.js")["default"]
|
|
16
15
|
exports.Search = require("./dist/components/Search.js")["default"]
|
|
17
16
|
exports.SidebarMenu = require("./dist/components/SidebarMenu.js")["default"]
|
|
17
|
+
exports.SidebarMenuItem = require("./dist/components/SidebarMenuItem.js")["default"]
|
|
18
18
|
exports.SlimContainer = require("./dist/components/SlimContainer.js")["default"]
|
|
19
19
|
exports.Status = require("./dist/components/Status.js")["default"]
|
|
20
20
|
exports.StatusProvider = require("./dist/components/StatusProvider.js")["StatusProvider"]
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blue-react",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Blue React Components",
|
|
5
5
|
"license": "LGPL-3.0-or-later",
|
|
6
6
|
"main": "index.js",
|
|
7
7
|
"types": "index.d.ts",
|
|
8
|
-
"homepage": "https://bruegmann.github.io/blue-react/
|
|
8
|
+
"homepage": "https://bruegmann.github.io/blue-react/v9",
|
|
9
9
|
"repository": {
|
|
10
10
|
"type": "git",
|
|
11
11
|
"url": "https://github.com/bruegmann/blue-react.git"
|
|
@@ -26,13 +26,13 @@
|
|
|
26
26
|
"predeploy": "npm run build-docs",
|
|
27
27
|
"deploy": "gh-pages --dist build --dest v9",
|
|
28
28
|
"prepublishOnly": "npm i && npm run build-release",
|
|
29
|
-
"release": "npm publish
|
|
29
|
+
"release": "npm publish && npm run deploy",
|
|
30
30
|
"prettier": "npx prettier --write .",
|
|
31
31
|
"license-report": "npx license-report --prod --output=json > ./src/docs/data/license-report.json"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@popperjs/core": "^2.11.5",
|
|
35
|
-
"bootstrap": "~5.3.0
|
|
35
|
+
"bootstrap": "~5.3.0",
|
|
36
36
|
"clsx": "^1.1.1"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
@@ -54,7 +54,6 @@
|
|
|
54
54
|
"@types/react-router-dom": "^5.3.3",
|
|
55
55
|
"@types/react-syntax-highlighter": "^13.5.0",
|
|
56
56
|
"autoprefixer": "^10.3.6",
|
|
57
|
-
"blue-web-components": "github:bruegmann/blue-web-components",
|
|
58
57
|
"gh-pages": "^3.1.0",
|
|
59
58
|
"license-report": "^6.2.0",
|
|
60
59
|
"lint-staged": "^11.1.2",
|