blue-react 8.4.0-beta1 → 8.4.2

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 v8.4.0-beta1 (https://bruegmann.github.io/blue-react)
2
+ * Blue React v8.4.2 (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
 
@@ -9,10 +9,9 @@
9
9
  // Configuration
10
10
  @import "node_modules/bootstrap/scss/functions";
11
11
  @import "node_modules/bootstrap/scss/variables";
12
- @import "node_modules/bootstrap/scss/maps";
13
12
  @import "node_modules/bootstrap/scss/mixins";
14
13
 
15
- // @import "./_bootstrap-mixins_overwritten.scss";
14
+ @import "./_bootstrap-mixins_overwritten.scss";
16
15
 
17
16
  @import "node_modules/bootstrap/scss/utilities";
18
17
 
@@ -21,10 +21,10 @@ $theme-colors: map-merge(
21
21
  );
22
22
 
23
23
  // Since Bootstrap 5.1 this needs to be set. Otherwise we couldn't use .bg-* and .text-* utils with our custom $theme
24
- // $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value");
25
- // $utilities-colors: map-merge($utilities-colors, $theme-colors-rgb);
26
- // $utilities-text-colors: map-merge($utilities-text-colors, map-loop($utilities-colors, rgba-css-var, "$key", "text"));
27
- // $utilities-bg-colors: map-merge($utilities-bg-colors, map-loop($utilities-colors, rgba-css-var, "$key", "bg"));
24
+ $theme-colors-rgb: map-loop($theme-colors, to-rgb, "$value");
25
+ $utilities-colors: map-merge($utilities-colors, $theme-colors-rgb);
26
+ $utilities-text-colors: map-merge($utilities-text-colors, map-loop($utilities-colors, rgba-css-var, "$key", "text"));
27
+ $utilities-bg-colors: map-merge($utilities-bg-colors, map-loop($utilities-colors, rgba-css-var, "$key", "bg"));
28
28
 
29
29
  // Alpha value (RGBA) e.g. for header background.
30
30
  $shimmering: 0.7 !default;
@@ -94,4 +94,7 @@ $scrollbar-size: 10px;
94
94
 
95
95
  :root {
96
96
  --theme: #{$theme};
97
+
98
+ --blue-sidebar-width: #{$bla-sidebar-width};
99
+ --blue-theme: #{$theme};
97
100
  }
@@ -11,13 +11,14 @@
11
11
  .blue-menu-item-label {
12
12
  display: inline-block;
13
13
  }
14
-
15
14
  .blue-sidebar {
16
15
  z-index: 42;
17
16
  box-shadow: 0.6rem 6rem 6rem rgba(0, 0, 0, 0.4);
18
17
  // background-color: darken($theme, 30%);
19
18
  }
20
19
 
20
+ --blue-sidebar-width: #{$bla-sidebar-width};
21
+
21
22
  .blue-sidebar,
22
23
  .blue-sidebar .blue-menu-item {
23
24
  width: $bla-sidebar-width;
@@ -77,7 +78,10 @@
77
78
  &::before {
78
79
  content: "";
79
80
  position: absolute;
80
- top: 0.25rem; right: 0.25rem; bottom: 0.25rem; left: 0.25rem;
81
+ top: 0.25rem;
82
+ right: 0.25rem;
83
+ bottom: 0.25rem;
84
+ left: 0.25rem;
81
85
  background-color: currentColor;
82
86
  border-radius: $border-radius;
83
87
  transform: scale(0.9);
@@ -113,6 +117,10 @@
113
117
  }
114
118
  }
115
119
 
120
+ :root {
121
+ --blue-sidebar-width: #{$width};
122
+ }
123
+
116
124
  .blue-sidebar {
117
125
  width: $width;
118
126
  color: $sidebar-color;
@@ -1,11 +1,12 @@
1
1
  /// <reference types="react" />
2
- export interface ActionMenuSwitchProps {
3
- className?: string;
4
- checked?: boolean;
2
+ import { SwitchProps } from "./Switch";
3
+ export interface ActionMenuSwitchProps extends SwitchProps {
5
4
  onChange?: () => void;
6
5
  label?: any;
7
6
  }
8
7
  /**
8
+ * @deprecated
9
+ * Use a solution with Bootstrap's `.form-check.form-switch` or `MenuItem` with a switch icon.
9
10
  * Switch for the Action Menu.
10
11
  */
11
- export default function ActionMenuSwitch(props: ActionMenuSwitchProps): JSX.Element;
12
+ export default function ActionMenuSwitch({ label, ...props }: ActionMenuSwitchProps): JSX.Element;
@@ -4,8 +4,8 @@ export interface ModalProviderProps {
4
4
  }
5
5
  declare const ModalProvider: ({ children, ...rest }: ModalProviderProps) => JSX.Element;
6
6
  declare const useModal: () => {
7
- ask: (text: string, title?: string | undefined) => Promise<string | boolean>;
8
- tell: (text: string, title?: string | undefined) => Promise<boolean>;
9
- verify: (text: string, title?: string | undefined) => Promise<boolean>;
7
+ ask: (text: string, title?: string) => Promise<string | boolean>;
8
+ tell: (text: string, title?: string) => Promise<boolean>;
9
+ verify: (text: string, title?: string) => Promise<boolean>;
10
10
  };
11
11
  export { ModalProvider, useModal };
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { ReactNode } from "react";
2
2
  export interface SwitchProps {
3
3
  className?: string;
4
4
  checked?: boolean;
@@ -12,10 +12,22 @@ export interface SwitchProps {
12
12
  */
13
13
  elementType?: string;
14
14
  disabled?: boolean;
15
+ /**
16
+ * Set prop to use the older look and feel. Will disappear in future releases.
17
+ */
18
+ legacy?: boolean;
19
+ label?: ReactNode | string;
15
20
  }
16
21
  /**
17
- * Switch.
22
+ * @deprecated
23
+ * Use Bootstrap's `.form-check.form-switch` instead:
24
+ * https://getbootstrap.com/docs/5.2/forms/checks-radios/#switches
25
+ *
26
+ * For now, this component acts as proxy for Bootstrap's Switch.
27
+ * To place a label next to the switch, use the new `label` prop.
28
+ *
29
+ * Migrate to Blue React 8.4.0 and use legacy support: Set the `label` with a string. Or set the `legacy` prop to use the previous look and behaviour.
18
30
  */
19
- export default function Switch({ className, checked, onChange, sliderLabel, disabled, elementType }: SwitchProps): React.ReactElement<{
31
+ export default function Switch({ className, checked, onChange, sliderLabel, disabled, elementType, legacy, label }: SwitchProps): React.ReactElement<{
20
32
  className: string;
21
33
  }, string | React.JSXElementConstructor<any>>;
@@ -1,17 +1,39 @@
1
- export default Utilities;
2
- declare namespace Utilities {
3
- function hasClass(el: any, className: any): any;
4
- function addClass(el: any, className: any): void;
5
- function removeClass(el: any, className: any): void;
6
- function toggleClass(element: any, className: any): void;
7
- function startLoading(): void;
8
- function finishLoading(): void;
9
- function showSuccess(): void;
10
- function hideSuccess(): void;
11
- function toggleActions(): void;
12
- function resetAlertMessage(alertClassName?: string): void;
13
- function setAlertMessage(message: any, alertClassName: string | undefined, close: any, detailText: any): void;
14
- function guid(): string;
15
- function scrollToTop(): void;
16
- function fetchData(input: any, init?: any, showErrorDetail?: boolean, onError?: any): Promise<Response>;
17
- }
1
+ import { StatusType } from "./shared";
2
+ export declare function hasClass(el: HTMLElement | null, className: string): boolean;
3
+ export declare function addClass(el: HTMLElement | null, className: string): void;
4
+ export declare function removeClass(el: HTMLElement | null, className: string): void;
5
+ /**
6
+ * @deprecated Use (el as HTMLElement).classList.toggle("my-class") instead.
7
+ */
8
+ export declare function toggleClass(element: HTMLElement | null, className: string): void;
9
+ export declare function startLoading(): void;
10
+ export declare function finishLoading(): void;
11
+ export declare function showSuccess(): void;
12
+ export declare function hideSuccess(): void;
13
+ export declare function toggleActions(): void;
14
+ /**
15
+ * Resets alert messages that was set with `setAlertMessage`.
16
+ * @param alertClassName Leave empty to reset messages of any status type
17
+ */
18
+ export declare function resetAlertMessage(alertClassName?: StatusType): void;
19
+ export declare function setAlertMessage(message: string, alertClassName?: StatusType, close?: boolean, detailText?: string): void;
20
+ export declare const guid: () => string;
21
+ export declare function scrollToTop(): void;
22
+ export declare function fetchData(input: RequestInfo | URL, init?: RequestInit | undefined, showErrorDetail?: boolean | undefined, onError?: (errorMessage: string, reason: Response) => void): Promise<Response>;
23
+ declare const _default: {
24
+ hasClass: typeof hasClass;
25
+ addClass: typeof addClass;
26
+ removeClass: typeof removeClass;
27
+ toggleClass: typeof toggleClass;
28
+ startLoading: typeof startLoading;
29
+ finishLoading: typeof finishLoading;
30
+ showSuccess: typeof showSuccess;
31
+ hideSuccess: typeof hideSuccess;
32
+ toggleActions: typeof toggleActions;
33
+ resetAlertMessage: typeof resetAlertMessage;
34
+ setAlertMessage: typeof setAlertMessage;
35
+ guid: () => string;
36
+ scrollToTop: typeof scrollToTop;
37
+ fetchData: typeof fetchData;
38
+ };
39
+ export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blue-react",
3
- "version": "8.4.0-beta1",
3
+ "version": "8.4.2",
4
4
  "description": "Blue React Components",
5
5
  "license": "LGPL-3.0-or-later",
6
6
  "main": "index.js",
@@ -26,12 +26,12 @@
26
26
  "predeploy": "npm run build-docs",
27
27
  "deploy": "gh-pages --dist build --dest v8",
28
28
  "prepublishOnly": "npm i && npm run build-release",
29
- "release": "npm publish --tag next && npm run deploy",
29
+ "release": "npm publish && npm run deploy",
30
30
  "prettier": "npx prettier --write ."
31
31
  },
32
32
  "dependencies": {
33
- "@popperjs/core": "^2.11.5",
34
- "bootstrap": "^5.2.0-beta1",
33
+ "@popperjs/core": "^2.10.2",
34
+ "bootstrap": "^5.1.3",
35
35
  "clsx": "^1.1.1"
36
36
  },
37
37
  "peerDependencies": {
@@ -60,12 +60,12 @@
60
60
  "postcss-minify": "^1.1.0",
61
61
  "prettier": "2.4.1",
62
62
  "react": "^18.1.0",
63
- "react-bootstrap-icons": "^1.8.2",
63
+ "react-bootstrap-icons": "^1.8.4",
64
64
  "react-docgen": "^5.4.0",
65
65
  "react-dom": "^18.1.0",
66
- "react-markdown-github": "^3.3.1",
66
+ "react-markdown": "^8.0.3",
67
67
  "react-router-dom": "^5.3.3",
68
- "react-scripts": "^4.0.3",
68
+ "react-scripts": "^5.0.1",
69
69
  "react-syntax-highlighter": "^15.4.3",
70
70
  "reactstrap": "^9.0.0-0",
71
71
  "typescript": "^4.3.5"