mc-react-header 0.3.4 → 0.4.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/Breadcrumbs.css +9 -8
- package/dist/Breadcrumbs.js +3 -5
- package/dist/Navbar.js +11 -12
- package/dist/index.js +4 -10
- package/package.json +1 -1
- package/src/App.css +0 -35
- package/src/App.js +3 -6
- package/src/MaterialsCloudHeader/Breadcrumbs.css +9 -8
- package/src/MaterialsCloudHeader/Breadcrumbs.js +0 -2
- package/src/MaterialsCloudHeader/Navbar.js +0 -1
- package/src/MaterialsCloudHeader/index.js +3 -7
- package/src/index.css +4 -3
- package/src/index.js +0 -1
package/dist/Breadcrumbs.css
CHANGED
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
ul.mc-breadcrumb {
|
|
3
3
|
padding: 7px 10px 7px 20px;
|
|
4
4
|
list-style: none;
|
|
5
|
-
background-color: #f5f5f5;
|
|
5
|
+
/* background-color: #f5f5f5; */
|
|
6
|
+
background-color: #fafafa;
|
|
7
|
+
/* border: 1px solid #d6d6d6; */
|
|
8
|
+
border: 1px solid #d2d2d2;
|
|
6
9
|
border-radius: 2px;
|
|
7
|
-
border: 1px solid #d6d6d6;
|
|
8
10
|
font-size: 16px;
|
|
9
11
|
font-family: "Open Sans", sans-serif;
|
|
10
12
|
text-align: left;
|
|
11
|
-
margin:
|
|
12
|
-
margin-bottom: 20px;
|
|
13
|
-
/* margin-top: 20px; */
|
|
13
|
+
margin: 20px;
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
display: flex;
|
|
16
16
|
flex-direction: row;
|
|
@@ -18,6 +18,7 @@ ul.mc-breadcrumb {
|
|
|
18
18
|
/* gap: 40px; */
|
|
19
19
|
justify-content: start;
|
|
20
20
|
align-items: center;
|
|
21
|
+
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.04);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/* Display list items side by side */
|
|
@@ -30,7 +31,7 @@ ul.mc-breadcrumb li {
|
|
|
30
31
|
|
|
31
32
|
/* Add a color to all links inside the list */
|
|
32
33
|
ul.mc-breadcrumb li a {
|
|
33
|
-
color:
|
|
34
|
+
color: rgb(62, 112, 187);
|
|
34
35
|
text-decoration: none;
|
|
35
36
|
/* position: relative; */
|
|
36
37
|
/* padding: 0px 5px 0px 50px; */
|
|
@@ -45,7 +46,7 @@ ul.mc-breadcrumb li a[href]:hover {
|
|
|
45
46
|
|
|
46
47
|
/* prevent _reboot.scss from bootstrap to override this */
|
|
47
48
|
ul.mc-breadcrumb li a:not([href]):hover {
|
|
48
|
-
color:
|
|
49
|
+
color: rgb(62, 112, 187);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
.mc-breadcrumb li a::after {
|
|
@@ -86,7 +87,7 @@ ul.mc-breadcrumb li a:not([href]):hover {
|
|
|
86
87
|
|
|
87
88
|
.mc-breadcrumb li:last-child a {
|
|
88
89
|
background: transparent !important;
|
|
89
|
-
color:
|
|
90
|
+
color: rgb(62, 112, 187);
|
|
90
91
|
/* pointer-events: none;
|
|
91
92
|
cursor: default; */
|
|
92
93
|
}
|
package/dist/Breadcrumbs.js
CHANGED
|
@@ -5,18 +5,16 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
require("./Breadcrumbs.css");
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
|
-
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
8
|
const Breadcrumbs = _ref => {
|
|
11
9
|
let {
|
|
12
10
|
breadcrumbsPath
|
|
13
11
|
} = _ref;
|
|
14
|
-
return /*#__PURE__*/
|
|
12
|
+
return /*#__PURE__*/React.createElement("ul", {
|
|
15
13
|
className: "mc-breadcrumb"
|
|
16
14
|
}, breadcrumbsPath.map((el, i) => {
|
|
17
|
-
return /*#__PURE__*/
|
|
15
|
+
return /*#__PURE__*/React.createElement("li", {
|
|
18
16
|
key: i
|
|
19
|
-
}, /*#__PURE__*/
|
|
17
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
20
18
|
href: el.link
|
|
21
19
|
}, el.name));
|
|
22
20
|
}));
|
package/dist/Navbar.js
CHANGED
|
@@ -5,11 +5,10 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
require("./Navbar.css");
|
|
8
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
9
8
|
var _mcloud_logo = _interopRequireDefault(require("./assets/mcloud_logo.png"));
|
|
10
9
|
require("font-awesome/css/font-awesome.min.css");
|
|
10
|
+
var _react = require("react");
|
|
11
11
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
13
12
|
const mainSections = {
|
|
14
13
|
learn: {
|
|
15
14
|
name: "LEARN",
|
|
@@ -79,15 +78,15 @@ const DropdownMenu = _ref => {
|
|
|
79
78
|
}, []);
|
|
80
79
|
const toggleDropdown = () => setDropdownOpen(prev => !prev);
|
|
81
80
|
const dropdownContentClass = "dropdown-content" + (dropdownOpen ? " dropdown-open" : "");
|
|
82
|
-
return /*#__PURE__*/
|
|
81
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
83
82
|
ref: wrapperRef,
|
|
84
83
|
className: "more-dropdown"
|
|
85
|
-
}, /*#__PURE__*/
|
|
84
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
86
85
|
className: "more-btn",
|
|
87
86
|
onClick: toggleDropdown
|
|
88
|
-
}, "More ", /*#__PURE__*/
|
|
87
|
+
}, "More ", /*#__PURE__*/React.createElement("i", {
|
|
89
88
|
className: "fa fa-caret-down"
|
|
90
|
-
})), /*#__PURE__*/
|
|
89
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
91
90
|
className: dropdownContentClass
|
|
92
91
|
}, Object.keys(dropdownSections).map((element, i) => {
|
|
93
92
|
const {
|
|
@@ -95,7 +94,7 @@ const DropdownMenu = _ref => {
|
|
|
95
94
|
name
|
|
96
95
|
} = dropdownSections[element];
|
|
97
96
|
const cname = element === activeSection ? "active" : "";
|
|
98
|
-
return /*#__PURE__*/
|
|
97
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
99
98
|
key: i,
|
|
100
99
|
className: cname,
|
|
101
100
|
href: link
|
|
@@ -106,24 +105,24 @@ const Navbar = _ref2 => {
|
|
|
106
105
|
let {
|
|
107
106
|
activeSection
|
|
108
107
|
} = _ref2;
|
|
109
|
-
return /*#__PURE__*/
|
|
108
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
110
109
|
className: "mc-navbar"
|
|
111
|
-
}, /*#__PURE__*/
|
|
110
|
+
}, /*#__PURE__*/React.createElement("a", {
|
|
112
111
|
className: "mc-navbrand",
|
|
113
112
|
href: "https://www.materialscloud.org/home"
|
|
114
|
-
}, /*#__PURE__*/
|
|
113
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
115
114
|
src: _mcloud_logo.default,
|
|
116
115
|
height: "50",
|
|
117
116
|
alt: "MC logo"
|
|
118
117
|
})), Object.keys(mainSections).map((key, i) => {
|
|
119
118
|
let cname = "mc-navlink";
|
|
120
119
|
if (key === activeSection) cname += " active";
|
|
121
|
-
return /*#__PURE__*/
|
|
120
|
+
return /*#__PURE__*/React.createElement("a", {
|
|
122
121
|
key: i,
|
|
123
122
|
className: cname,
|
|
124
123
|
href: mainSections[key].link
|
|
125
124
|
}, mainSections[key].name);
|
|
126
|
-
}), /*#__PURE__*/
|
|
125
|
+
}), /*#__PURE__*/React.createElement(DropdownMenu, {
|
|
127
126
|
activeSection: activeSection
|
|
128
127
|
}));
|
|
129
128
|
};
|
package/dist/index.js
CHANGED
|
@@ -5,24 +5,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
require("./index.css");
|
|
8
|
-
var _react = _interopRequireDefault(require("react"));
|
|
9
8
|
var _Navbar = _interopRequireDefault(require("./Navbar"));
|
|
10
9
|
var _Breadcrumbs = _interopRequireDefault(require("./Breadcrumbs"));
|
|
11
10
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
12
11
|
const MaterialsCloudHeader = _ref => {
|
|
13
12
|
let {
|
|
14
13
|
activeSection,
|
|
15
|
-
breadcrumbsPath
|
|
16
|
-
children
|
|
14
|
+
breadcrumbsPath
|
|
17
15
|
} = _ref;
|
|
18
|
-
return /*#__PURE__*/
|
|
19
|
-
className: "main-container"
|
|
20
|
-
}, /*#__PURE__*/_react.default.createElement(_Navbar.default, {
|
|
16
|
+
return /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Navbar.default, {
|
|
21
17
|
activeSection: activeSection
|
|
22
|
-
}), /*#__PURE__*/
|
|
23
|
-
className: "content-container"
|
|
24
|
-
}, /*#__PURE__*/_react.default.createElement(_Breadcrumbs.default, {
|
|
18
|
+
}), /*#__PURE__*/React.createElement(_Breadcrumbs.default, {
|
|
25
19
|
breadcrumbsPath: breadcrumbsPath
|
|
26
|
-
})
|
|
20
|
+
}));
|
|
27
21
|
};
|
|
28
22
|
var _default = exports.default = MaterialsCloudHeader;
|
package/package.json
CHANGED
package/src/App.css
CHANGED
|
@@ -1,38 +1,3 @@
|
|
|
1
1
|
.App {
|
|
2
2
|
text-align: center;
|
|
3
3
|
}
|
|
4
|
-
|
|
5
|
-
.App-logo {
|
|
6
|
-
height: 40vmin;
|
|
7
|
-
pointer-events: none;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
@media (prefers-reduced-motion: no-preference) {
|
|
11
|
-
.App-logo {
|
|
12
|
-
animation: App-logo-spin infinite 20s linear;
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.App-header {
|
|
17
|
-
background-color: #282c34;
|
|
18
|
-
min-height: 100vh;
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
align-items: center;
|
|
22
|
-
justify-content: center;
|
|
23
|
-
font-size: calc(10px + 2vmin);
|
|
24
|
-
color: white;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.App-link {
|
|
28
|
-
color: #61dafb;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
@keyframes App-logo-spin {
|
|
32
|
-
from {
|
|
33
|
-
transform: rotate(0deg);
|
|
34
|
-
}
|
|
35
|
-
to {
|
|
36
|
-
transform: rotate(360deg);
|
|
37
|
-
}
|
|
38
|
-
}
|
package/src/App.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import "./App.css";
|
|
2
2
|
|
|
3
|
-
import React from "react";
|
|
4
|
-
|
|
5
3
|
import MaterialsCloudHeader from "./MaterialsCloudHeader";
|
|
6
4
|
|
|
7
5
|
function App() {
|
|
@@ -17,10 +15,9 @@ function App() {
|
|
|
17
15
|
},
|
|
18
16
|
{ name: "test", link: null },
|
|
19
17
|
]}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
</MaterialsCloudHeader>
|
|
18
|
+
/>
|
|
19
|
+
<h3>Test content</h3>
|
|
20
|
+
<p>Test content</p>
|
|
24
21
|
</div>
|
|
25
22
|
);
|
|
26
23
|
}
|
|
@@ -2,15 +2,15 @@
|
|
|
2
2
|
ul.mc-breadcrumb {
|
|
3
3
|
padding: 7px 10px 7px 20px;
|
|
4
4
|
list-style: none;
|
|
5
|
-
background-color: #f5f5f5;
|
|
5
|
+
/* background-color: #f5f5f5; */
|
|
6
|
+
background-color: #fafafa;
|
|
7
|
+
/* border: 1px solid #d6d6d6; */
|
|
8
|
+
border: 1px solid #d2d2d2;
|
|
6
9
|
border-radius: 2px;
|
|
7
|
-
border: 1px solid #d6d6d6;
|
|
8
10
|
font-size: 16px;
|
|
9
11
|
font-family: "Open Sans", sans-serif;
|
|
10
12
|
text-align: left;
|
|
11
|
-
margin:
|
|
12
|
-
margin-bottom: 20px;
|
|
13
|
-
/* margin-top: 20px; */
|
|
13
|
+
margin: 20px;
|
|
14
14
|
overflow: hidden;
|
|
15
15
|
display: flex;
|
|
16
16
|
flex-direction: row;
|
|
@@ -18,6 +18,7 @@ ul.mc-breadcrumb {
|
|
|
18
18
|
/* gap: 40px; */
|
|
19
19
|
justify-content: start;
|
|
20
20
|
align-items: center;
|
|
21
|
+
box-shadow: 0 4px 4px rgba(0, 0, 0, 0.04);
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
/* Display list items side by side */
|
|
@@ -30,7 +31,7 @@ ul.mc-breadcrumb li {
|
|
|
30
31
|
|
|
31
32
|
/* Add a color to all links inside the list */
|
|
32
33
|
ul.mc-breadcrumb li a {
|
|
33
|
-
color:
|
|
34
|
+
color: rgb(62, 112, 187);
|
|
34
35
|
text-decoration: none;
|
|
35
36
|
/* position: relative; */
|
|
36
37
|
/* padding: 0px 5px 0px 50px; */
|
|
@@ -45,7 +46,7 @@ ul.mc-breadcrumb li a[href]:hover {
|
|
|
45
46
|
|
|
46
47
|
/* prevent _reboot.scss from bootstrap to override this */
|
|
47
48
|
ul.mc-breadcrumb li a:not([href]):hover {
|
|
48
|
-
color:
|
|
49
|
+
color: rgb(62, 112, 187);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
.mc-breadcrumb li a::after {
|
|
@@ -86,7 +87,7 @@ ul.mc-breadcrumb li a:not([href]):hover {
|
|
|
86
87
|
|
|
87
88
|
.mc-breadcrumb li:last-child a {
|
|
88
89
|
background: transparent !important;
|
|
89
|
-
color:
|
|
90
|
+
color: rgb(62, 112, 187);
|
|
90
91
|
/* pointer-events: none;
|
|
91
92
|
cursor: default; */
|
|
92
93
|
}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import "./index.css";
|
|
2
2
|
|
|
3
|
-
import React from "react";
|
|
4
3
|
import Navbar from "./Navbar";
|
|
5
4
|
import Breadcrumbs from "./Breadcrumbs";
|
|
6
5
|
|
|
7
|
-
const MaterialsCloudHeader = ({ activeSection, breadcrumbsPath
|
|
8
|
-
<div
|
|
6
|
+
const MaterialsCloudHeader = ({ activeSection, breadcrumbsPath }) => (
|
|
7
|
+
<div>
|
|
9
8
|
<Navbar activeSection={activeSection} />
|
|
10
|
-
<
|
|
11
|
-
<Breadcrumbs breadcrumbsPath={breadcrumbsPath} />
|
|
12
|
-
{children}
|
|
13
|
-
</div>
|
|
9
|
+
<Breadcrumbs breadcrumbsPath={breadcrumbsPath} />
|
|
14
10
|
</div>
|
|
15
11
|
);
|
|
16
12
|
|
package/src/index.css
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
body {
|
|
2
2
|
margin: 0;
|
|
3
|
-
font-family: -apple-system, BlinkMacSystemFont,
|
|
4
|
-
|
|
3
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
|
|
4
|
+
"Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
|
|
5
5
|
sans-serif;
|
|
6
6
|
-webkit-font-smoothing: antialiased;
|
|
7
7
|
-moz-osx-font-smoothing: grayscale;
|
|
8
|
+
background-color: #f0f6f9;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
code {
|
|
11
|
-
font-family: source-code-pro, Menlo, Monaco, Consolas,
|
|
12
|
+
font-family: source-code-pro, Menlo, Monaco, Consolas, "Courier New",
|
|
12
13
|
monospace;
|
|
13
14
|
}
|
package/src/index.js
CHANGED