blue-react 9.0.1 → 9.1.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 v9.0.1-alpha2 (https://bruegmann.github.io/blue-react)
2
+ * Blue React v9.1.0-alpha2 (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
 
@@ -54,17 +54,9 @@
54
54
  // Support for MenuItems
55
55
  .blue-menu-item {
56
56
  width: auto;
57
- margin-top: 0;
58
- margin-bottom: 0;
59
57
 
60
58
  &.active::after {
61
- top: initial;
62
- bottom: 0.125rem;
63
- left: 0.625rem;
64
- right: 0.625rem;
65
- width: auto;
66
- height: 0.25rem;
67
- animation: sidebar-menu-item-indicator-in-from-below 0.2s ease-in-out;
59
+ @include blue-menu-item-indicator-horizontal();
68
60
  }
69
61
  }
70
62
 
@@ -258,8 +258,6 @@
258
258
  transition: width 0.5s, background-color 0.3s, color 0.15s, box-shadow 0.3s, opacity 0.3s !important;
259
259
  padding: 0.5rem 0.75rem;
260
260
  border: none;
261
- margin-top: 0.125rem;
262
- margin-bottom: 0.125rem;
263
261
 
264
262
  &:focus {
265
263
  box-shadow: none;
@@ -1,6 +1,7 @@
1
- @import "./mixins/_misc.scss";
2
- @import "./mixins/_sidebar.scss";
3
- @import "./mixins/action-menu.scss";
4
- @import "./mixins/_switch.scss";
5
- @import "./mixins/custom-property.scss";
1
+ @import "./mixins/misc";
2
+ @import "./mixins/menu-item";
3
+ @import "./mixins/sidebar";
4
+ @import "./mixins/action-menu";
5
+ @import "./mixins/switch";
6
+ @import "./mixins/custom-property";
6
7
  @import "./mixins/scroll-shadow";
@@ -0,0 +1,21 @@
1
+ @mixin blue-menu-item-indicator() {
2
+ content: "";
3
+ position: absolute;
4
+ top: 0.625rem;
5
+ bottom: 0.625rem;
6
+ left: 0.125rem;
7
+ width: 0.25rem;
8
+ background-color: var(--blue-menu-item-indicator-bg);
9
+ border-radius: 1rem;
10
+ animation: blue-menu-item-indicator-in-from-side 0.2s ease-in-out;
11
+ }
12
+
13
+ @mixin blue-menu-item-indicator-horizontal() {
14
+ top: initial;
15
+ bottom: 0.125rem;
16
+ left: 0.625rem;
17
+ right: 0.625rem;
18
+ width: auto;
19
+ height: 0.25rem;
20
+ animation: blue-menu-item-indicator-in-from-below 0.2s ease-in-out;
21
+ }
@@ -65,6 +65,14 @@
65
65
  .blue-header-logo.sidebar {
66
66
  transform: translateX(0);
67
67
  }
68
+
69
+ .blue-sidebar-menu-horizontal-on-open {
70
+ .blue-menu-item {
71
+ &.active::after {
72
+ @include blue-menu-item-indicator-horizontal();
73
+ }
74
+ }
75
+ }
68
76
  }
69
77
 
70
78
  @mixin blue-sidebar($width) {
@@ -119,15 +127,7 @@
119
127
  }
120
128
 
121
129
  &.active::after {
122
- content: "";
123
- position: absolute;
124
- top: 0.625rem;
125
- bottom: 0.625rem;
126
- left: 0.125rem;
127
- width: 0.25rem;
128
- background-color: var(--blue-menu-item-indicator-bg);
129
- border-radius: 1rem;
130
- animation: sidebar-menu-item-indicator-in-from-side 0.2s ease-in-out;
130
+ @include blue-menu-item-indicator();
131
131
  }
132
132
 
133
133
  & > * + .blue-menu-item-label {
@@ -172,7 +172,7 @@
172
172
  }
173
173
  }
174
174
 
175
- @keyframes sidebar-menu-item-indicator-in-from-side {
175
+ @keyframes blue-menu-item-indicator-in-from-side {
176
176
  from {
177
177
  transform: translateX(-100%);
178
178
  }
@@ -181,7 +181,7 @@
181
181
  }
182
182
  }
183
183
 
184
- @keyframes sidebar-menu-item-indicator-in-from-below {
184
+ @keyframes blue-menu-item-indicator-in-from-below {
185
185
  from {
186
186
  transform: translateY(100%);
187
187
  }
@@ -0,0 +1,19 @@
1
+ /// <reference types="react" />
2
+ import { MenuItemProps } from "./MenuItem";
3
+ export interface IconMenuItemProps extends MenuItemProps {
4
+ outerClass?: string;
5
+ /**
6
+ * Tooltip will be placed to the end/right by default. You can change the direction with this prop.
7
+ */
8
+ tooltipClass?: string;
9
+ /**
10
+ * When used inside of the sidebar: active indicator will be displayed underneath instead of before.
11
+ * The prop to `false` to disable this behavior.
12
+ */
13
+ horizontalOnOpenSidebar?: boolean;
14
+ }
15
+ /**
16
+ * Variant of `MenuItem` to primarily display an icon without a label.
17
+ * The label prop will be displayed as a tooltip.
18
+ */
19
+ export default function IconMenuItem({ label, outerClass, tooltipClass, horizontalOnOpenSidebar, className, ...props }: IconMenuItemProps): JSX.Element;
@@ -18,6 +18,10 @@ export interface MenuItemProps {
18
18
  * Icon component or a class name.
19
19
  */
20
20
  icon?: any;
21
+ /**
22
+ * Addition to class name of icon wrapper element
23
+ */
24
+ iconClassName?: string;
21
25
  /**
22
26
  * Icon component or a class name when the MenuItem is active.
23
27
  */
package/index.d.ts CHANGED
@@ -27,6 +27,9 @@ export { HeaderProps } from "./dist/types/components/Header"
27
27
  export { default as HeaderTitle } from "./dist/types/components/HeaderTitle"
28
28
  export { HeaderTitleProps } from "./dist/types/components/HeaderTitle"
29
29
 
30
+ export { default as IconMenuItem } from "./dist/types/components/IconMenuItem"
31
+ export { IconMenuItemProps } from "./dist/types/components/IconMenuItem"
32
+
30
33
  export { default as Intro } from "./dist/types/components/Intro"
31
34
  export { IntroProps } from "./dist/types/components/Intro"
32
35
 
package/index.js CHANGED
@@ -5,6 +5,7 @@ exports.Caret = require("./dist/components/Caret.js")["default"]
5
5
  exports.Layout = require("./dist/components/Layout.js")["default"]
6
6
  exports.Header = require("./dist/components/Header.js")["default"]
7
7
  exports.HeaderTitle = require("./dist/components/HeaderTitle.js")["default"]
8
+ exports.IconMenuItem = require("./dist/components/IconMenuItem.js")["default"]
8
9
  exports.Intro = require("./dist/components/Intro.js")["default"]
9
10
  exports.MenuItem = require("./dist/components/MenuItem.js")["default"]
10
11
  exports.Modal = require("./dist/components/Modal.js")["default"]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blue-react",
3
- "version": "9.0.1",
3
+ "version": "9.1.0",
4
4
  "description": "Blue React Components",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "main": "index.js",