blue-react 9.1.7 → 9.2.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.1.7-alpha2 (https://bruegmann.github.io/blue-react)
2
+ * Blue React v9.2.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
 
@@ -24,3 +24,4 @@
24
24
  @import "./styles/_caret";
25
25
  @import "./styles/_tooltips";
26
26
  @import "./styles/_hover";
27
+ @import "./styles/buttons";
@@ -0,0 +1,91 @@
1
+ // Inspired by Bootstrap's button system but extended with more variants
2
+
3
+ // scss-docs-start btn-variant-loops
4
+ @each $color, $value in $theme-colors {
5
+ $bg: tint-color($value, 80%);
6
+ $text-color: shade-color($value, 60%);
7
+
8
+ .blue-btn-soft-#{$color} {
9
+ @if $color == "light" {
10
+ $text-color: color-contrast($value);
11
+ }
12
+
13
+ @include button-variant(
14
+ $bg,
15
+ $bg,
16
+ $text-color,
17
+ $hover-background: shade-color($bg, $btn-hover-bg-shade-amount),
18
+ $hover-border: shade-color($bg, $btn-hover-border-shade-amount),
19
+ $active-background: shade-color($bg, $btn-active-bg-shade-amount),
20
+ $active-border: shade-color($bg, $btn-active-border-shade-amount)
21
+ );
22
+ }
23
+ }
24
+
25
+ @include color-mode(dark) {
26
+ @each $color, $value in $theme-colors {
27
+ $bg: shade-color($value, 80%);
28
+ $text-color: tint-color($value, 60%);
29
+
30
+ .blue-btn-soft-#{$color} {
31
+ @if $color == "dark" {
32
+ $text-color: color-contrast($value);
33
+ }
34
+
35
+ @include button-variant(
36
+ $bg,
37
+ $bg,
38
+ $text-color,
39
+ $hover-background: tint-color($bg, $btn-hover-bg-tint-amount),
40
+ $hover-border: tint-color($bg, $btn-hover-border-tint-amount),
41
+ $active-background: tint-color($bg, $btn-active-bg-tint-amount),
42
+ $active-border: tint-color($bg, $btn-active-border-tint-amount)
43
+ );
44
+ }
45
+ }
46
+ }
47
+
48
+ // scss-docs-start btn-variant-loops
49
+ @each $color, $value in $theme-colors {
50
+ $bg: tint-color($value, 80%);
51
+ $text-color: $value;
52
+
53
+ .blue-btn-plain-#{$color} {
54
+ @if $color == "light" {
55
+ $text-color: color-contrast($value);
56
+ }
57
+
58
+ @include button-variant(
59
+ transparent,
60
+ transparent,
61
+ $text-color,
62
+ $hover-background: shade-color($bg, $btn-hover-bg-shade-amount),
63
+ $hover-border: shade-color($bg, $btn-hover-border-shade-amount),
64
+ $active-background: shade-color($bg, $btn-active-bg-shade-amount),
65
+ $active-border: shade-color($bg, $btn-active-border-shade-amount)
66
+ );
67
+ }
68
+ }
69
+
70
+ @include color-mode(dark) {
71
+ @each $color, $value in $theme-colors {
72
+ $bg: shade-color($value, 80%);
73
+ $text-color: $value;
74
+
75
+ .blue-btn-plain-#{$color} {
76
+ @if $color == "dark" {
77
+ $text-color: color-contrast($value);
78
+ }
79
+
80
+ @include button-variant(
81
+ transparent,
82
+ transparent,
83
+ $text-color,
84
+ $hover-background: tint-color($bg, $btn-hover-bg-tint-amount),
85
+ $hover-border: tint-color($bg, $btn-hover-border-tint-amount),
86
+ $active-background: tint-color($bg, $btn-active-bg-tint-amount),
87
+ $active-border: tint-color($bg, $btn-active-border-tint-amount)
88
+ );
89
+ }
90
+ }
91
+ }
@@ -276,7 +276,10 @@
276
276
  }
277
277
 
278
278
  &:focus-visible {
279
- box-shadow: inset 0 0 0.25rem;
279
+ &,
280
+ &.active {
281
+ box-shadow: inset 0 0 0.25rem;
282
+ }
280
283
  }
281
284
  }
282
285
 
@@ -4,7 +4,9 @@
4
4
  top: 0.625rem;
5
5
  bottom: 0.625rem;
6
6
  left: 0.125rem;
7
+ right: initial;
7
8
  width: 0.25rem;
9
+ height: auto;
8
10
  background-color: var(--blue-menu-item-indicator-bg);
9
11
  border-radius: 1rem;
10
12
  animation: blue-menu-item-indicator-in-from-side 0.2s ease-in-out;
@@ -73,6 +73,14 @@
73
73
  }
74
74
  }
75
75
  }
76
+
77
+ .blue-sidebar-menu-vertical-on-open {
78
+ .blue-menu-item {
79
+ &.active::after {
80
+ @include blue-menu-item-indicator();
81
+ }
82
+ }
83
+ }
76
84
  }
77
85
 
78
86
  @mixin blue-sidebar($width) {
@@ -74,6 +74,10 @@ export interface MenuItemProps {
74
74
  * Defines dropdown status from outside.
75
75
  */
76
76
  showDropdown?: boolean;
77
+ /**
78
+ * Callback when `showDropdown` changes.
79
+ */
80
+ onShowDropdown?: (showDropdown: boolean) => void;
77
81
  /**
78
82
  * Close on click outside.
79
83
  */
@@ -1,4 +1,4 @@
1
- import { CSSProperties, MutableRefObject } from "react";
1
+ import { CSSProperties, MouseEventHandler, MutableRefObject } from "react";
2
2
  /**
3
3
  * Hook that alerts clicks outside of the passed ref
4
4
  */
@@ -7,9 +7,10 @@ export interface OutsideProps {
7
7
  children: any;
8
8
  className?: string;
9
9
  onClickOutside?: (event: MouseEvent) => void;
10
+ onClick?: MouseEventHandler<HTMLDivElement> | undefined;
10
11
  style?: CSSProperties;
11
12
  }
12
13
  /**
13
14
  * Component that fires an event if you click outside of it
14
15
  */
15
- export default function Outside({ children, className, onClickOutside, style }: OutsideProps): JSX.Element;
16
+ export default function Outside({ children, className, onClickOutside, onClick, style }: OutsideProps): JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blue-react",
3
- "version": "9.1.7",
3
+ "version": "9.2.0",
4
4
  "description": "Blue React Components",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "main": "index.js",