blue-react 9.0.0 → 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.0-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
 
@@ -7,7 +7,7 @@
7
7
 
8
8
  @media (hover: hover) {
9
9
  .blue-d-hover {
10
- &:not(:hover):not(:focus):not(:active):not(.active) {
10
+ &:not(:hover):not(:focus):not(:active):not(.active):not(:focus-within) {
11
11
  .blue-d-hover-content-active {
12
12
  display: none;
13
13
  }
@@ -16,7 +16,8 @@
16
16
  &:hover,
17
17
  &:focus,
18
18
  &:active,
19
- &.active {
19
+ &.active,
20
+ &:focus-within {
20
21
  .blue-d-hover-content-default {
21
22
  display: none;
22
23
  }
@@ -24,7 +25,7 @@
24
25
  }
25
26
 
26
27
  .blue-opacity-hover {
27
- &:not(:hover):not(:focus):not(:active):not(.active) {
28
+ &:not(:hover):not(:focus):not(:active):not(.active):not(:focus-within) {
28
29
  .blue-opacity-hover-content-active {
29
30
  opacity: 0;
30
31
  }
@@ -33,7 +34,8 @@
33
34
  &:hover,
34
35
  &:focus,
35
36
  &:active,
36
- &.active {
37
+ &.active,
38
+ &:focus-within {
37
39
  .blue-opacity-hover-content-default {
38
40
  opacity: 0;
39
41
  }
@@ -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
  */
@@ -13,12 +13,12 @@ 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
+ * When using React, you should use `StatusProvider` instead: https://bruegmann.github.io/blue-react/v9/component/StatusProvider
17
17
  * @param alertClassName Leave empty to reset messages of any status type
18
18
  */
19
19
  export declare function resetAlertMessage(alertClassName?: StatusType): void;
20
20
  /**
21
- * When using React, you should use `StatusProvider` instead: https://bruegmann.github.io/blue-react/v8/component/StatusProvider
21
+ * When using React, you should use `StatusProvider` instead: https://bruegmann.github.io/blue-react/v9/component/StatusProvider
22
22
  */
23
23
  export declare function setAlertMessage(message: string, alertClassName?: StatusType, close?: boolean, detailText?: string): void;
24
24
  export declare const guid: () => string;
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.0",
3
+ "version": "9.1.0",
4
4
  "description": "Blue React Components",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "main": "index.js",
@@ -19,6 +19,7 @@
19
19
  "build-types": "tsc --declaration --emitDeclarationOnly --declarationDir ./dist/types --noEmit false",
20
20
  "build": "babel ./src/components --out-dir ./dist/components --extensions \".tsx,.js,.ts\"",
21
21
  "build-css": "node ./setVersionToStyleScss.js && node-sass ./dist/style.scss ./dist/style.css && npx postcss ./dist/style.css --use autoprefixer -r && npx postcss ./dist/style.css --use postcss-minify -o ./dist/style.min.css",
22
+ "build-neu-css": "node-sass ./dist/neu.scss ./dist/neu.css && npx postcss ./dist/neu.css --use autoprefixer -r && npx postcss ./dist/neu.css --use postcss-minify -o ./dist/neu.min.css",
22
23
  "build-release": "npm run build-types && npm run build && npm run build-css && npm run docgen",
23
24
  "docgen": "react-docgen ./src/components/ -o ./src/docs/data/docs.json --exclude Utilities.js --extension tsx && node followUpDocs && npm run license-report",
24
25
  "test": "react-scripts test",