blue-react 10.1.3 → 10.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/components/ActionMenu.d.ts +1 -0
- package/dist/components/ActionMenu.js +1 -0
- package/dist/components/ActionMenuItem.js +73 -0
- package/dist/components/ActionMenuSwitch.js +44 -0
- package/dist/components/Actions.d.ts +16 -0
- package/dist/components/Actions.js +60 -0
- package/dist/components/Caret.js +25 -0
- package/dist/components/Layout/LayoutHeader.js +1 -1
- package/dist/components/Layout.d.ts +4 -2
- package/dist/components/Layout.js +12 -11
- package/dist/components/SidebarMenuItem.js +115 -0
- package/dist/components/SimpleLayout.d.ts +4 -2
- package/dist/components/SimpleLayout.js +14 -12
- package/dist/components/Switch.js +65 -0
- package/dist/components/shared.js +2 -1
- package/dist/style.css +16286 -0
- package/dist/style.min.css +12 -0
- package/dist/types/components/A.d.ts +9 -0
- package/dist/types/components/ActionMenu.d.ts +25 -0
- package/dist/types/components/ActionMenuItem.d.ts +35 -0
- package/dist/types/components/ActionMenuSwitch.d.ts +12 -0
- package/dist/types/components/Body.d.ts +21 -0
- package/dist/types/components/Caret.d.ts +18 -0
- package/dist/types/components/Chevron.d.ts +17 -0
- package/dist/types/components/Header.d.ts +8 -0
- package/dist/types/components/HeaderTitle.d.ts +40 -0
- package/dist/types/components/IconMenuItem.d.ts +19 -0
- package/dist/types/components/Intro.d.ts +23 -0
- package/dist/types/components/Layout.d.ts +144 -0
- package/dist/types/components/MenuItem.d.ts +149 -0
- package/dist/types/components/Modal.d.ts +30 -0
- package/dist/types/components/ModalProvider.d.ts +21 -0
- package/dist/types/components/Outside.d.ts +17 -0
- package/dist/types/components/Page.d.ts +12 -0
- package/dist/types/components/Search.d.ts +36 -0
- package/dist/types/components/SidebarMenu.d.ts +32 -0
- package/dist/types/components/SidebarMenuItem.d.ts +22 -0
- package/dist/types/components/SidebarToggler.d.ts +10 -0
- package/dist/types/components/SlimContainer.d.ts +10 -0
- package/dist/types/components/Status.d.ts +12 -0
- package/dist/types/components/StatusProvider.d.ts +15 -0
- package/dist/types/components/Switch.d.ts +33 -0
- package/dist/types/components/ToastProvider.d.ts +22 -0
- package/dist/types/components/Utilities.d.ts +41 -0
- package/dist/types/components/shared.d.ts +15 -0
- package/package.json +2 -2
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export interface SidebarMenuProps {
|
|
3
|
+
/**
|
|
4
|
+
* Extends the class name by the sidebar.
|
|
5
|
+
*/
|
|
6
|
+
sidebarClass?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Sets the `style` prop by the sidebar.
|
|
9
|
+
*/
|
|
10
|
+
sidebarStyle?: object;
|
|
11
|
+
/**
|
|
12
|
+
* Extends the class name by the menu.
|
|
13
|
+
*/
|
|
14
|
+
menuClass?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Sets the `style` prop by the menu.
|
|
17
|
+
*/
|
|
18
|
+
menuStyle?: object;
|
|
19
|
+
/**
|
|
20
|
+
* Content on top of the menu.
|
|
21
|
+
*/
|
|
22
|
+
topContent?: any;
|
|
23
|
+
/**
|
|
24
|
+
* Content for the bottom part of the sidebar.
|
|
25
|
+
*/
|
|
26
|
+
bottomContent?: any;
|
|
27
|
+
children?: any;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Sidebar for the `Layout` component.
|
|
31
|
+
*/
|
|
32
|
+
export default function SidebarMenu(props: SidebarMenuProps): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { MenuItemProps } from "./MenuItem";
|
|
3
|
+
export interface SidebarMenuItemProps extends MenuItemProps {
|
|
4
|
+
outerClass?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated `MenuItem` now has all the features of `SidebarMenuItem`. Use `MenuItem` instead.
|
|
8
|
+
* Extends `MenuItem` with following features:
|
|
9
|
+
* * Shows provided label as tooltip if sidebar is closed.
|
|
10
|
+
* * Children will be displayed on the right side of the parent item.
|
|
11
|
+
*
|
|
12
|
+
* **Important!** Set the following props to the surrounding `SidebarMenu` to provide problems with tooltips:
|
|
13
|
+
* ```jsx
|
|
14
|
+
* <SidebarMenu
|
|
15
|
+
* sidebarClass="overflow-visible"
|
|
16
|
+
* menuClass="overflow-visible"
|
|
17
|
+
* >
|
|
18
|
+
* ...
|
|
19
|
+
* </SidebarMenu>
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
export default function SidebarMenuItem({ outerClass, children, onClick, ...props }: SidebarMenuItemProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { MouseEventHandler, ReactNode } from "react";
|
|
2
|
+
export interface SidebarTogglerProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
sidebarToggleIconComponent: ReactNode;
|
|
5
|
+
onClick: MouseEventHandler<HTMLButtonElement>;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Button to toggle sidebar state. Designed for internal use inside of `Layout`.
|
|
9
|
+
*/
|
|
10
|
+
export default function SidebarToggler({ className, sidebarToggleIconComponent, onClick }: SidebarTogglerProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface SlimContainerProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
className?: string;
|
|
5
|
+
innerClassName?: string;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Shortcut for a combination using Bootstrap's Grid System to create a slim responsive container.
|
|
9
|
+
*/
|
|
10
|
+
export default function SlimContainer({ children, className, innerClassName }: SlimContainerProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { StatusAlert, StatusType } from "./shared";
|
|
3
|
+
export interface StatusProps {
|
|
4
|
+
alert?: StatusAlert;
|
|
5
|
+
onUnsetAlert?: () => void;
|
|
6
|
+
successIcon?: ReactNode;
|
|
7
|
+
infoIcon?: ReactNode;
|
|
8
|
+
warningIcon?: ReactNode;
|
|
9
|
+
dangerIcon?: ReactNode;
|
|
10
|
+
status?: StatusType;
|
|
11
|
+
}
|
|
12
|
+
export default function Status({ alert, onUnsetAlert, successIcon, infoIcon, warningIcon, dangerIcon, status }: StatusProps): JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import { StatusAlert, StatusType } from "./shared";
|
|
3
|
+
export interface StatusProviderProps {
|
|
4
|
+
children?: ReactNode;
|
|
5
|
+
successIcon?: ReactNode;
|
|
6
|
+
infoIcon?: ReactNode;
|
|
7
|
+
warningIcon?: ReactNode;
|
|
8
|
+
dangerIcon?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const StatusProvider: ({ children, successIcon, infoIcon, warningIcon, dangerIcon, ...rest }: StatusProviderProps) => JSX.Element;
|
|
11
|
+
declare const useStatus: () => {
|
|
12
|
+
setAlert: (alert: StatusAlert | null) => void;
|
|
13
|
+
setStatus: (status: StatusType) => void;
|
|
14
|
+
};
|
|
15
|
+
export { useStatus, StatusProvider };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
export interface SwitchProps {
|
|
3
|
+
className?: string;
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
onChange?: (event: React.ChangeEvent) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Sets label inside of the switch. If you set this, you should also set the className "lg" to make the switch larger.
|
|
8
|
+
*/
|
|
9
|
+
sliderLabel?: string;
|
|
10
|
+
/**
|
|
11
|
+
* You can change the type of the wrapper element. If you do, the `onChange` event might not be triggered.
|
|
12
|
+
*/
|
|
13
|
+
elementType?: string;
|
|
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;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
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.
|
|
30
|
+
*/
|
|
31
|
+
export default function Switch({ className, checked, onChange, sliderLabel, disabled, elementType, legacy, label }: SwitchProps): React.ReactElement<{
|
|
32
|
+
className: string;
|
|
33
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
export interface ToastProviderProps {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
successIcon?: ReactNode;
|
|
5
|
+
infoIcon?: ReactNode;
|
|
6
|
+
warningIcon?: ReactNode;
|
|
7
|
+
dangerIcon?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare type ToastItemType = "success" | "danger" | "info" | "warning";
|
|
10
|
+
export interface ToastItem {
|
|
11
|
+
type: ToastItemType;
|
|
12
|
+
title?: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Push notifications to your visitors using Bootstrap's toast component.
|
|
17
|
+
*/
|
|
18
|
+
export declare function ToastProvider({ children, successIcon, infoIcon, warningIcon, dangerIcon }: ToastProviderProps): JSX.Element;
|
|
19
|
+
export declare const useToast: () => {
|
|
20
|
+
addToast: (toastItem: ToastItem) => void;
|
|
21
|
+
clearToasts: () => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { startLoading, finishLoading, showSuccess, hideSuccess, resetAlertMessage, setAlertMessage, scrollToTop, fetchData } from "blue-web/dist/js/utils";
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use (el as HTMLElement).classList.contains("my-class") instead.
|
|
4
|
+
*/
|
|
5
|
+
export declare function hasClass(el: HTMLElement | null, className: string): boolean;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use (el as HTMLElement).classList.add("my-class") instead.
|
|
8
|
+
*/
|
|
9
|
+
export declare function addClass(el: HTMLElement | null, className: string): void;
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Use (el as HTMLElement).classList.remove("my-class") instead.
|
|
12
|
+
*/
|
|
13
|
+
export declare function removeClass(el: HTMLElement | null, className: string): void;
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use (el as HTMLElement).classList.toggle("my-class") instead.
|
|
16
|
+
*/
|
|
17
|
+
export declare function toggleClass(element: HTMLElement | null, className: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Is handled inside of `ActioMenu` component now
|
|
20
|
+
*/
|
|
21
|
+
export declare function toggleActions(): void;
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated In future versions of Blue React, you will need to use utils of Blue Web directly.
|
|
24
|
+
*/
|
|
25
|
+
declare const _default: {
|
|
26
|
+
hasClass: typeof hasClass;
|
|
27
|
+
addClass: typeof addClass;
|
|
28
|
+
removeClass: typeof removeClass;
|
|
29
|
+
toggleClass: typeof toggleClass;
|
|
30
|
+
startLoading: typeof startLoading;
|
|
31
|
+
finishLoading: typeof finishLoading;
|
|
32
|
+
showSuccess: typeof showSuccess;
|
|
33
|
+
hideSuccess: typeof hideSuccess;
|
|
34
|
+
toggleActions: typeof toggleActions;
|
|
35
|
+
resetAlertMessage: typeof resetAlertMessage;
|
|
36
|
+
setAlertMessage: typeof setAlertMessage;
|
|
37
|
+
guid: () => string;
|
|
38
|
+
scrollToTop: typeof scrollToTop;
|
|
39
|
+
fetchData: typeof fetchData;
|
|
40
|
+
};
|
|
41
|
+
export default _default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare type breakOption = "sm" | "md" | "lg" | "xl";
|
|
2
|
+
export declare type ModalType = "ask" | "tell" | "verify";
|
|
3
|
+
export declare type StatusType = null | "loading" | "success" | "info" | "warning" | "danger";
|
|
4
|
+
export interface StatusAlert {
|
|
5
|
+
title?: string;
|
|
6
|
+
alertClassName?: string;
|
|
7
|
+
close?: boolean;
|
|
8
|
+
detailText?: string;
|
|
9
|
+
status?: StatusType;
|
|
10
|
+
}
|
|
11
|
+
interface Phrases {
|
|
12
|
+
[key: string]: string[];
|
|
13
|
+
}
|
|
14
|
+
export declare function getPhrase(keyword: string, countryCode?: string | undefined, _phrases?: Phrases | undefined): string;
|
|
15
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "blue-react",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.2.0",
|
|
4
4
|
"description": "Blue React Components",
|
|
5
5
|
"license": "LGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@popperjs/core": "^2.11.5",
|
|
38
|
-
"blue-web": "^1.
|
|
38
|
+
"blue-web": "^1.17.4",
|
|
39
39
|
"bootstrap": "~5.3.3",
|
|
40
40
|
"clsx": "^1.1.1"
|
|
41
41
|
},
|