mc-react-header 0.2.1 → 0.3.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.
@@ -0,0 +1,41 @@
1
+ name: Release and publish
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ jobs:
9
+ release_and_publish:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Checkout code
13
+ uses: actions/checkout@v2
14
+
15
+ - name: Set up Node.js
16
+ uses: actions/setup-node@v3
17
+ with:
18
+ node-version: "16"
19
+ registry-url: "https://registry.npmjs.org/"
20
+
21
+ - name: Install project dependencies
22
+ run: npm ci
23
+
24
+ - name: Build the dist folder
25
+ run: npm run build
26
+
27
+ - name: Create GitHub Release
28
+ id: create_release
29
+ uses: actions/create-release@v1
30
+ env:
31
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32
+ with:
33
+ tag_name: ${{ github.ref }}
34
+ release_name: ${{ github.ref }}
35
+ draft: false
36
+ prerelease: false
37
+
38
+ - name: Publish to npm
39
+ run: npm publish
40
+ env:
41
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package/README.md CHANGED
@@ -1,78 +1,21 @@
1
- # Materials Cloud header component
2
-
3
- A React component for Materials Cloud header, built just with CSS.
4
-
5
- See `src/App.js` on how to use it.
6
-
7
- Published to npm, install with `npm install mc-react-header`.
8
-
9
- # Getting Started with Create React App
10
-
11
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
12
-
13
- ## Available Scripts
14
-
15
- In the project directory, you can run:
16
-
17
- ### `npm start`
18
-
19
- Runs the app in the development mode.\
20
- Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
21
-
22
- The page will reload when you make changes.\
23
- You may also see any lint errors in the console.
24
-
25
- ### `npm test`
26
-
27
- Launches the test runner in the interactive watch mode.\
28
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
29
-
30
- ### `npm run build`
31
-
32
- Builds the app for production to the `build` folder.\
33
- It correctly bundles React in production mode and optimizes the build for the best performance.
34
-
35
- The build is minified and the filenames include the hashes.\
36
- Your app is ready to be deployed!
37
-
38
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
39
-
40
- ### `npm run eject`
41
-
42
- **Note: this is a one-way operation. Once you `eject`, you can't go back!**
43
-
44
- If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
45
-
46
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
47
-
48
- You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
49
-
50
- ## Learn More
51
-
52
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
53
-
54
- To learn React, check out the [React documentation](https://reactjs.org/).
55
-
56
- ### Code Splitting
57
-
58
- This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
59
-
60
- ### Analyzing the Bundle Size
61
-
62
- This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
63
-
64
- ### Making a Progressive Web App
65
-
66
- This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
67
-
68
- ### Advanced Configuration
69
-
70
- This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
71
-
72
- ### Deployment
73
-
74
- This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
75
-
76
- ### `npm run build` fails to minify
77
-
78
- This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
1
+ # Materials Cloud header component
2
+
3
+ A React component for Materials Cloud header, built just with CSS.
4
+
5
+ See `src/App.js` on how to use it.
6
+
7
+ Published to npm, install with `npm install mc-react-header`.
8
+
9
+ ## Development
10
+
11
+ ```bash
12
+ npm install
13
+ npm start
14
+ ```
15
+
16
+ To make a new version and publish to npm via GitHub Actions:
17
+
18
+ ```bash
19
+ npm version <patch/minor/major>
20
+ git push --follow-tags
21
+ ```
@@ -1,101 +1,101 @@
1
- /* Style the list */
2
- ul.mc-breadcrumb {
3
- padding: 7px 10px 7px 20px;
4
- list-style: none;
5
- background-color: #f5f5f5;
6
- border-radius: 2px;
7
- border: 1px solid #d6d6d6;
8
- font-size: 16px;
9
- font-weight: 300;
10
- font-family: "Open Sans", sans-serif;
11
- text-align: left;
12
- margin: 6px;
13
- margin-bottom: 20px;
14
- /* margin-top: 20px; */
15
- overflow: hidden;
16
- display: flex;
17
- flex-direction: row;
18
- /* flex-wrap: wrap; */
19
- /* gap: 40px; */
20
- justify-content: start;
21
- align-items: center;
22
- }
23
-
24
-
25
- /* Display list items side by side */
26
- ul.mc-breadcrumb li {
27
- display: inline;
28
- line-height: 1.0;
29
- margin-right: 46px;
30
- position: relative;
31
- }
32
-
33
- /* Add a color to all links inside the list */
34
- ul.mc-breadcrumb li a {
35
- color: #303f9f;
36
- text-decoration: none;
37
- /* position: relative; */
38
- /* padding: 0px 5px 0px 50px; */
39
- /* padding: 10px 0 10px 65px; */
40
- /* z-index: 3; */
41
- }
42
-
43
-
44
- /* Add a color on mouse-over, if the <a> has href defined */
45
- ul.mc-breadcrumb li a[href]:hover {
46
- text-decoration: underline;
47
- }
48
-
49
- /* prevent _reboot.scss from bootstrap to override this */
50
- ul.mc-breadcrumb li a:not([href]):hover {
51
- color: #303f9f;
52
- }
53
-
54
- .mc-breadcrumb li a::after {
55
- content: " ";
56
- display: block;
57
- width: 0;
58
- height: 0;
59
- border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
60
- border-bottom: 50px solid transparent;
61
- border-left: 30px solid #f5f5f5;
62
- position: absolute;
63
- top: 50%;
64
- margin-top: -50px;
65
- /* left: 100%; */
66
- z-index: 2;
67
- right: 0;
68
- z-index: 2;
69
- transform: translate(30px, 0);
70
- }
71
-
72
- .mc-breadcrumb li a::before {
73
- content: " ";
74
- display: block;
75
- width: 0;
76
- height: 0;
77
- border-top: 50px solid transparent;
78
- border-bottom: 50px solid transparent;
79
- border-left: 30px solid #d6d6d6;
80
- position: absolute;
81
- top: 50%;
82
- margin-top: -50px;
83
- margin-left: 2px;
84
- /* left: 100%; */
85
- right: 0;
86
- z-index: 1;
87
- transform: translate(32px, 0);
88
- }
89
-
90
- .mc-breadcrumb li:last-child a {
91
- background: transparent !important;
92
- color: #303f9f;
93
- /* pointer-events: none;
94
- cursor: default; */
95
- }
96
- .mc-breadcrumb li:last-child a::after,
97
- .mc-breadcrumb li:last-child a::before {
98
- border: 0;
99
- display: none;
100
- }
101
-
1
+ /* Style the list */
2
+ ul.mc-breadcrumb {
3
+ padding: 7px 10px 7px 20px;
4
+ list-style: none;
5
+ background-color: #f5f5f5;
6
+ border-radius: 2px;
7
+ border: 1px solid #d6d6d6;
8
+ font-size: 16px;
9
+ font-weight: 300;
10
+ font-family: "Open Sans", sans-serif;
11
+ text-align: left;
12
+ margin: 6px;
13
+ margin-bottom: 20px;
14
+ /* margin-top: 20px; */
15
+ overflow: hidden;
16
+ display: flex;
17
+ flex-direction: row;
18
+ /* flex-wrap: wrap; */
19
+ /* gap: 40px; */
20
+ justify-content: start;
21
+ align-items: center;
22
+ }
23
+
24
+
25
+ /* Display list items side by side */
26
+ ul.mc-breadcrumb li {
27
+ display: inline;
28
+ line-height: 1.0;
29
+ margin-right: 46px;
30
+ position: relative;
31
+ }
32
+
33
+ /* Add a color to all links inside the list */
34
+ ul.mc-breadcrumb li a {
35
+ color: #303f9f;
36
+ text-decoration: none;
37
+ /* position: relative; */
38
+ /* padding: 0px 5px 0px 50px; */
39
+ /* padding: 10px 0 10px 65px; */
40
+ /* z-index: 3; */
41
+ }
42
+
43
+
44
+ /* Add a color on mouse-over, if the <a> has href defined */
45
+ ul.mc-breadcrumb li a[href]:hover {
46
+ text-decoration: underline;
47
+ }
48
+
49
+ /* prevent _reboot.scss from bootstrap to override this */
50
+ ul.mc-breadcrumb li a:not([href]):hover {
51
+ color: #303f9f;
52
+ }
53
+
54
+ .mc-breadcrumb li a::after {
55
+ content: " ";
56
+ display: block;
57
+ width: 0;
58
+ height: 0;
59
+ border-top: 50px solid transparent; /* Go big on the size, and let overflow hide */
60
+ border-bottom: 50px solid transparent;
61
+ border-left: 30px solid #f5f5f5;
62
+ position: absolute;
63
+ top: 50%;
64
+ margin-top: -50px;
65
+ /* left: 100%; */
66
+ z-index: 2;
67
+ right: 0;
68
+ z-index: 2;
69
+ transform: translate(30px, 0);
70
+ }
71
+
72
+ .mc-breadcrumb li a::before {
73
+ content: " ";
74
+ display: block;
75
+ width: 0;
76
+ height: 0;
77
+ border-top: 50px solid transparent;
78
+ border-bottom: 50px solid transparent;
79
+ border-left: 30px solid #d6d6d6;
80
+ position: absolute;
81
+ top: 50%;
82
+ margin-top: -50px;
83
+ margin-left: 2px;
84
+ /* left: 100%; */
85
+ right: 0;
86
+ z-index: 1;
87
+ transform: translate(32px, 0);
88
+ }
89
+
90
+ .mc-breadcrumb li:last-child a {
91
+ background: transparent !important;
92
+ color: #303f9f;
93
+ /* pointer-events: none;
94
+ cursor: default; */
95
+ }
96
+ .mc-breadcrumb li:last-child a::after,
97
+ .mc-breadcrumb li:last-child a::before {
98
+ border: 0;
99
+ display: none;
100
+ }
101
+
@@ -3,20 +3,20 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports["default"] = void 0;
6
+ exports.default = void 0;
7
7
  var _react = _interopRequireDefault(require("react"));
8
8
  require("./Breadcrumbs.css");
9
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
9
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
10
10
  function Breadcrumbs(props) {
11
- return /*#__PURE__*/_react["default"].createElement("ul", {
11
+ return /*#__PURE__*/_react.default.createElement("ul", {
12
12
  className: "mc-breadcrumb"
13
13
  }, props.breadcrumbsPath.map(function (el, i) {
14
- return /*#__PURE__*/_react["default"].createElement("li", {
14
+ return /*#__PURE__*/_react.default.createElement("li", {
15
15
  key: i
16
- }, /*#__PURE__*/_react["default"].createElement("a", {
16
+ }, /*#__PURE__*/_react.default.createElement("a", {
17
17
  href: el.link
18
18
  }, el.name));
19
19
  }));
20
20
  }
21
21
  var _default = Breadcrumbs;
22
- exports["default"] = _default;
22
+ exports.default = _default;
package/dist/Navbar.css CHANGED
@@ -1,129 +1,129 @@
1
- .mc-navbar {
2
- background-color: rgb(255, 255, 255);
3
- overflow: hidden;
4
- border-bottom: 3px solid #dee6e6;
5
- z-index: 10;
6
- font-family: "Open Sans", sans-serif;
7
- }
8
-
9
- .mc-navbar .mc-navbrand {
10
- float: left;
11
- display: block;
12
- text-align: center;
13
- font-size: 0px;
14
- padding: 7px 15px 5px 20px;
15
- /* border: 1px solid green; */
16
- }
17
-
18
- .mc-navbar .mc-navlink {
19
- float: left;
20
- display: block;
21
- color: #455860;
22
- font-size: 16px;
23
- line-height: 32px;
24
- font-weight: 700;
25
- text-align: center;
26
- padding: 14px 15px;
27
- text-decoration: none;
28
- /* border: 1px solid green; */
29
- }
30
-
31
- /* Change the color of links on hover */
32
- .mc-navbar a:hover {
33
- color: #8fa5af;
34
- }
35
-
36
- /* Add an active class to highlight the current page */
37
- .mc-navbar a.active {
38
- background-color: #fbfcfc;
39
- color: #cc1b30;
40
- }
41
-
42
- .more-dropdown {
43
- padding: 14px 0px;
44
- float: right;
45
- /* border: 1px solid rgb(128, 0, 0); */
46
- /* overflow: hidden; */
47
- }
48
-
49
- .more-btn {
50
- color: #455860;
51
- font-size: 16px;
52
- line-height: 32px;
53
- /* display: block; */
54
- text-decoration: none;
55
- font-weight: 700;
56
- cursor: pointer;
57
- text-align: center;
58
- padding: 21px 20px;
59
- /* border: 1px solid green; */
60
- /* margin: 0; Important for vertical align on mobile phones */
61
- user-select: none;
62
- }
63
-
64
- .dropdown-content {
65
- display: none;
66
- position: absolute;
67
- right: 0;
68
- background-color: #ffffff;
69
- min-width: 220px;
70
- border-radius: 6px;
71
- border: 2px solid #dee6e6;
72
- z-index: 100;
73
- padding: 5px 0px;
74
- }
75
-
76
- .dropdown-content a {
77
- float: none;
78
- color: #455860;
79
- font-weight: 300;
80
- padding: 10px 14px;
81
- text-decoration: none;
82
- display: block;
83
- text-align: left;
84
- font-size: 16px;
85
- line-height: 10px;
86
- z-index: 100;
87
- }
88
-
89
- .dropdown-content a:hover {
90
- background-color: #fbfcfc;
91
- }
92
-
93
- .dropdown-open {
94
- display: block;
95
- }
96
-
97
- /* Show the dropdown menu on hover */
98
- /* .more-dropdown:hover .dropdown-content {
99
- display: block;
100
- } */
101
-
102
- @media screen and (max-width: 680px) {
103
- /* .mc-navbar a.menu {
104
- float: right;
105
- display: block;
106
- border: 2px solid #455860;
107
- } */
108
- /* .mc-navbar {
109
- position: relative;
110
- } */
111
- .mc-navbar .mc-navlink {
112
- position: relative;
113
- float: none;
114
- display: block;
115
- text-align: left;
116
- padding: 2px 20px 2px;
117
- z-index: 10;
118
- }
119
- .mc-navbar .mc-navbrand {
120
- float: none;
121
- display: block;
122
- text-align: left;
123
- }
124
- .mc-navbar .more-dropdown {
125
- position: absolute;
126
- top: 0;
127
- right: 0;
128
- }
129
- }
1
+ .mc-navbar {
2
+ background-color: rgb(255, 255, 255);
3
+ overflow: hidden;
4
+ border-bottom: 3px solid #dee6e6;
5
+ z-index: 10;
6
+ font-family: "Open Sans", sans-serif;
7
+ }
8
+
9
+ .mc-navbar .mc-navbrand {
10
+ float: left;
11
+ display: block;
12
+ text-align: center;
13
+ font-size: 0px;
14
+ padding: 7px 15px 5px 20px;
15
+ /* border: 1px solid green; */
16
+ }
17
+
18
+ .mc-navbar .mc-navlink {
19
+ float: left;
20
+ display: block;
21
+ color: #455860;
22
+ font-size: 16px;
23
+ line-height: 32px;
24
+ font-weight: 700;
25
+ text-align: center;
26
+ padding: 14px 15px;
27
+ text-decoration: none;
28
+ /* border: 1px solid green; */
29
+ }
30
+
31
+ /* Change the color of links on hover */
32
+ .mc-navbar a:hover {
33
+ color: #8fa5af;
34
+ }
35
+
36
+ /* Add an active class to highlight the current page */
37
+ .mc-navbar a.active {
38
+ background-color: #fbfcfc;
39
+ color: #cc1b30;
40
+ }
41
+
42
+ .more-dropdown {
43
+ padding: 14px 0px;
44
+ float: right;
45
+ /* border: 1px solid rgb(128, 0, 0); */
46
+ /* overflow: hidden; */
47
+ }
48
+
49
+ .more-btn {
50
+ color: #455860;
51
+ font-size: 16px;
52
+ line-height: 32px;
53
+ /* display: block; */
54
+ text-decoration: none;
55
+ font-weight: 700;
56
+ cursor: pointer;
57
+ text-align: center;
58
+ padding: 21px 20px;
59
+ /* border: 1px solid green; */
60
+ /* margin: 0; Important for vertical align on mobile phones */
61
+ user-select: none;
62
+ }
63
+
64
+ .dropdown-content {
65
+ display: none;
66
+ position: absolute;
67
+ right: 0;
68
+ background-color: #ffffff;
69
+ min-width: 220px;
70
+ border-radius: 6px;
71
+ border: 2px solid #dee6e6;
72
+ z-index: 100;
73
+ padding: 5px 0px;
74
+ }
75
+
76
+ .dropdown-content a {
77
+ float: none;
78
+ color: #455860;
79
+ font-weight: 300;
80
+ padding: 10px 14px;
81
+ text-decoration: none;
82
+ display: block;
83
+ text-align: left;
84
+ font-size: 16px;
85
+ line-height: 10px;
86
+ z-index: 100;
87
+ }
88
+
89
+ .dropdown-content a:hover {
90
+ background-color: #fbfcfc;
91
+ }
92
+
93
+ .dropdown-open {
94
+ display: block;
95
+ }
96
+
97
+ /* Show the dropdown menu on hover */
98
+ /* .more-dropdown:hover .dropdown-content {
99
+ display: block;
100
+ } */
101
+
102
+ @media screen and (max-width: 680px) {
103
+ /* .mc-navbar a.menu {
104
+ float: right;
105
+ display: block;
106
+ border: 2px solid #455860;
107
+ } */
108
+ /* .mc-navbar {
109
+ position: relative;
110
+ } */
111
+ .mc-navbar .mc-navlink {
112
+ position: relative;
113
+ float: none;
114
+ display: block;
115
+ text-align: left;
116
+ padding: 2px 20px 2px;
117
+ z-index: 10;
118
+ }
119
+ .mc-navbar .mc-navbrand {
120
+ float: none;
121
+ display: block;
122
+ text-align: left;
123
+ }
124
+ .mc-navbar .more-dropdown {
125
+ position: absolute;
126
+ top: 0;
127
+ right: 0;
128
+ }
129
+ }